]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
man: tc-pedit: Add examples for dsfield and retain
authorPetr Machata <petrm@mellanox.com>
Fri, 3 Apr 2020 23:05:30 +0000 (02:05 +0300)
committerDavid Ahern <dsahern@gmail.com>
Thu, 9 Apr 2020 14:39:58 +0000 (14:39 +0000)
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>
man/man8/tc-pedit.8

index 3f6baa3ddaf5e9c086b29ef50d4a3d267d1b751a..d2b37ef07ef8fd7af711055e9036762d22faedd7 100644 (file)
@@ -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),