diff options
author | Petr Machata <petrm@mellanox.com> | 2020-04-04 02:05:30 +0300 |
---|---|---|
committer | David Ahern <dsahern@gmail.com> | 2020-04-09 14:39:58 +0000 |
commit | f91f788c70e92a80b53f8e6c83ac3059aa0b9ddc (patch) | |
tree | 41e3cbf8120edafcdaa75faab99c200cb982d1b8 | |
parent | 2d9a8dc439ee75d8f89f88712a33d09b7115fbeb (diff) | |
download | iproute2-f91f788c70e92a80b53f8e6c83ac3059aa0b9ddc.tar.gz |
man: tc-pedit: Add examples for dsfield and retain
Describe a way to update just the DSCP and just the ECN part of the
dsfield. That is useful on its own, but also it shows how retain works.
Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
-rw-r--r-- | man/man8/tc-pedit.8 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/man/man8/tc-pedit.8 b/man/man8/tc-pedit.8 index 3f6baa3dd..d2b37ef07 100644 --- a/man/man8/tc-pedit.8 +++ b/man/man8/tc-pedit.8 @@ -369,6 +369,28 @@ tc filter add dev eth0 parent ffff: u32 \\ action pedit ex munge tcp dport set 22 .EE .RE + +To rewrite just part of a field, use the +.B retain +directive. E.g. to overwrite the DSCP part of a dsfield with $DSCP, without +touching ECN: + +.RS +.EX +tc filter add dev eth0 ingress flower ... \\ + action pedit ex munge ip dsfield set $((DSCP << 2)) retain 0xfc +.EE +.RE + +And vice versa, to set ECN to e.g. 1 without impacting DSCP: + +.RS +.EX +tc filter add dev eth0 ingress flower ... \\ + action pedit ex munge ip dsfield set 1 retain 0x3 +.EE +.RE + .SH SEE ALSO .BR tc (8), .BR tc-htb (8), |