Re: [PATCH iproute2 v3 2/2] tc: pedit: add decrement operation
From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2021-06-24 20:24:22
Hi Asbjørn, On 2021-06-22 11:39 a.m., David Ahern wrote:
[ looks fine to me; adding tc folks to make sure they see it ] On 6/18/21 10:06 AM, Asbjørn Sloth Tønnesen wrote:quoted
Implement a decrement operation for ttl and hoplimit. Since this is just syntactic sugar, it goes that: tc filter add ... action pedit ex munge ip ttl dec ... tc filter add ... action pedit ex munge ip6 hoplimit dec ... is just a more readable version of this: tc filter add ... action pedit ex munge ip ttl add 0xff ... tc filter add ... action pedit ex munge ip6 hoplimit add 0xff ...
So you "add" essentially one's complement of the value you are trying to decrement with?
quoted
This feature was suggested by some pseudo tc examples in Mellanox's documentation[1], but wasn't present in neither their mlnx-iproute2 nor iproute2. Tested with skip_sw on Mellanox ConnectX-6 Dx. [1] https://docs.mellanox.com/pages/viewpage.action?pageId=47033989
I didnt see an example which showed using "dec" but what you described above makes sense. And the changes below look sane. So: Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> cheers, jamal