tc: f_flower: add geneve option match support to flower
Subsystems (2)
PATCH 1/1 tc: f_flower: add geneve option match support to flower
From: Pieter Jansen van Vuuren <[email protected]>
Allow matching on options in Geneve tunnel headers.
The options can be described in the form CLASS:TYPE:DATA/CLASS_MASK:TYPE_MASK:DATA_MASK, where CLASS is represented as a 16bit hexadecimal value, TYPE as an 8bit hexadecimal value and DATA as a variable length hexadecimal value.
e.g.
# ip link add name geneve0 type geneve dstport 0 external
# tc qdisc add dev geneve0 ingress
# tc filter add dev geneve0 protocol ip parent ffff: \
flower \
enc_src_ip 10.0.99.192 \
enc_dst_ip 10.0.99.193 \
enc_key_id 11 \
geneve_opts 0102:80:1122334421314151/ffff:ff:ffffffffffffffff \
ip_proto udp \
action mirred egress redirect dev eth1--- man/man8/tc-flower.8 | 13 ++- tc/f_flower.c | 282 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 294 insertions(+), 1 deletion(-)
man/man8/tc-flower.8 +12 -1
@@ -80,6 +80,8 @@ flower \- flow based traffic control filter .IR TOS " | " .B enc_ttl .IR TTL " | " +.B geneve_opts +.IR OPTIONS " | " .BR ip_flags .IR IP_FLAGS .SH DESCRIPTION
@@ -283,6 +285,8 @@ bits is assumed. .BI enc_tos " NUMBER" .TQ .BI enc_ttl " NUMBER" +.TQ +.BI geneve_opts " OPTIONS" Match on IP tunnel metadata. Key id .I NUMBER is a 32 bit tunnel key id (e.g. VNI for VXLAN tunnel).
@@ -295,7 +299,14 @@ is a 16 bit UDP dst port. Tos .I NUMBER is an 8 bit tos (dscp+ecn) value, ttl .I NUMBER -is an 8 bit time-to-live value. +is an 8 bit time-to-live value. geneve_opts +.I OPTIONS +must be a valid list of comma-separated geneve options where each option +consists of a key optionally followed by a slash and corresponding mask. If +the masks is missing, \fBtc\fR assumes a full-length match. The options can +be described in the form CLASS:TYPE:DATA/CLASS_MASK:TYPE_MASK:DATA_MASK, +where CLASS is represented as a 16bit hexadecimal value, TYPE as an 8bit +hexadecimal value and DATA as a variable length hexadecimal value. .TP .BI ip_flags " IP_FLAGS" .I IP_FLAGS
tc/f_flower.c +282 -0
312 lines not on this page · raw message
Signature · 1 line
2.11.0
David Ahern
AppliedQuoted 21 lines · Simon Horman
From: Pieter Jansen van Vuuren <[email protected]>
Allow matching on options in Geneve tunnel headers.
The options can be described in the form CLASS:TYPE:DATA/CLASS_MASK:TYPE_MASK:DATA_MASK, where CLASS is represented as a 16bit hexadecimal value, TYPE as an 8bit hexadecimal value and DATA as a variable length hexadecimal value.
e.g.
# ip link add name geneve0 type geneve dstport 0 external # tc qdisc add dev geneve0 ingress # tc filter add dev geneve0 protocol ip parent ffff: \ flower \ enc_src_ip 10.0.99.192 \ enc_dst_ip 10.0.99.193 \ enc_key_id 11 \ geneve_opts 0102:80:1122334421314151/ffff:ff:ffffffffffffffff \ ip_proto udp \ action mirred egress redirect dev eth1
Quoted 6 lines
Signed-off-by Pieter Jansen van Vuuren <[email protected]>Signed-off-by Simon Horman <[email protected]>--- man/man8/tc-flower.8 | 13 ++- tc/f_flower.c | 282 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 294 insertions(+), 1 deletion(-)
applied to iproute2-next. Thanks