On 2022-07-29 5:53 PM, Ilya Maximets wrote:
If the key is zero, it doesn't mean we don't need to match on it.
Masks should be checked instead.
For the metadata length that's a bit tricky, because the length in the
mask section of the 'flower' structure represents the actual length of
the mask and not the mask of the length field in the key. But lengths
of the mask and the key must be equal in the OVS use case, so we can
use them interchangeably.
Fixes: 49a7961fca65 ("lib/tc: Avoid matching on tunnel ttl or tos if not
needed")
Fixes: a468645c6d33 ("lib/tc: add geneve with option match offload")
Signed-off-by: Ilya Maximets <[email protected]>
---
lib/netdev-offload-tc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 336507d59..a3eee8df3 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -1106,19 +1106,19 @@ parse_tc_flower_to_match(struct tc_flower *flower,
&flower->key.tunnel.ipv6.ipv6_src,
&flower->mask.tunnel.ipv6.ipv6_src);
}
- if (flower->key.tunnel.tos) {
+ if (flower->mask.tunnel.tos) {
match_set_tun_tos_masked(match, flower->key.tunnel.tos,
flower->mask.tunnel.tos);
}
- if (flower->key.tunnel.ttl) {
+ if (flower->mask.tunnel.ttl) {
match_set_tun_ttl_masked(match, flower->key.tunnel.ttl,
flower->mask.tunnel.ttl);
}
- if (flower->key.tunnel.tp_dst) {
+ if (flower->mask.tunnel.tp_dst) {
match_set_tun_tp_dst_masked(match, flower->key.tunnel.tp_dst,
flower->mask.tunnel.tp_dst);
}
- if (flower->key.tunnel.metadata.present.len) {
+ if (flower->mask.tunnel.metadata.present.len) {
flower_tun_opt_to_match(match, flower);
}
}
Reviewed-by: Roi Dayan <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev