]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc: pedit: add decrement operation
authorAsbjørn Sloth Tønnesen <asbjorn@asbjorn.st>
Fri, 18 Jun 2021 16:06:35 +0000 (16:06 +0000)
committerDavid Ahern <dsahern@kernel.org>
Sat, 26 Jun 2021 04:45:19 +0000 (04:45 +0000)
commit2ff4761db43e34933cb9eeec598cf15cb7fb4236
treea7804aa778eb3c39c5101e0c4a52e3f3363135aa
parentbc5e8473aab83b9f33c3c9a74490ed5827995de9
tc: pedit: add decrement operation

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 ...

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

v3:
   - Use dedicated flags argument in parse_cmd() (David Ahern)
   - Minor rewording of the man page

v2:
   - Fix whitespace issue (Stephen Hemminger)
   - Add to usage info in explain()

Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@asbjorn.st>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
man/man8/tc-pedit.8
tc/m_pedit.c
tc/m_pedit.h
tc/p_ip.c
tc/p_ip6.c