91 lines
3.6 KiB
Diff
91 lines
3.6 KiB
Diff
From 6f322ccf8a9989905b7c29420239d5f6d81f0002 Mon Sep 17 00:00:00 2001
|
|
From: Ilya Maximets <i.maximets@ovn.org>
|
|
Date: Fri, 19 Aug 2022 21:51:27 +0200
|
|
Subject: [PATCH] netdev-offload-tc: Parse tunnel options only for geneve
|
|
ports.
|
|
|
|
Cited commit correctly fixed the issue of incorrect reporting
|
|
of zero-length geneve option matches as wildcarded. But as a
|
|
side effect, exact match on the metadata length was added to
|
|
every tunnel flow match, even if the tunnel is not geneve.
|
|
That doesn't generate any functional issues, but it maybe
|
|
confusing to see 'tunnel(...,geneve(),...)' while looking at
|
|
datapath flow dumps for, e.g., vxlan tunnel flows.
|
|
|
|
Fix that by checking the port type before parsing geneve options.
|
|
tunnel() attribute itself doesn't have enough information to
|
|
figure out the tunnel type.
|
|
|
|
Fixes: 7a6c8074c5d2 ("netdev-offload-tc: Fix the mask for tunnel metadata length.")
|
|
Acked-by: Eelco Chaudron <echaudro@redhat.com>
|
|
Reviewed-by: Roi Dayan <roid@nvidia.com>
|
|
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
|
|
|
|
Reference:https://github.com/openvswitch/ovs/commit/6f322ccf8a9989905b7c29420239d5f6d81f0002
|
|
Conflict: Implement terse dump support: The parse_tc_flower_to_match function has an extra parameter.
|
|
|
|
---
|
|
lib/netdev-offload-tc.c | 18 ++++++++++++------
|
|
1 file changed, 12 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
|
|
index 2383fe2..b8c3738 100644
|
|
--- a/lib/netdev-offload-tc.c
|
|
+++ b/lib/netdev-offload-tc.c
|
|
@@ -515,7 +515,8 @@ flower_tun_opt_to_match(struct match *match, struct tc_flower *flower)
|
|
}
|
|
|
|
static int
|
|
-parse_tc_flower_to_match(struct tc_flower *flower,
|
|
+parse_tc_flower_to_match(const struct netdev *netdev,
|
|
+ struct tc_flower *flower,
|
|
struct match *match,
|
|
struct nlattr **actions,
|
|
struct dpif_flow_stats *stats,
|
|
@@ -634,7 +635,9 @@ parse_tc_flower_to_match(struct tc_flower *flower,
|
|
match_set_tun_tp_dst(match, flower->key.tunnel.tp_dst);
|
|
}
|
|
|
|
- flower_tun_opt_to_match(match, flower);
|
|
+ if (!strcmp(netdev_get_type(netdev), "geneve")) {
|
|
+ flower_tun_opt_to_match(match, flower);
|
|
+ }
|
|
}
|
|
|
|
act_off = nl_msg_start_nested(buf, OVS_FLOW_ATTR_ACTIONS);
|
|
@@ -760,8 +763,8 @@ netdev_tc_flow_dump_next(struct netdev_flow_dump *dump,
|
|
continue;
|
|
}
|
|
|
|
- if (parse_tc_flower_to_match(&flower, match, actions, stats, attrs,
|
|
- wbuffer)) {
|
|
+ if (parse_tc_flower_to_match(netdev, &flower, match, actions,
|
|
+ stats, attrs, wbuffer)) {
|
|
continue;
|
|
}
|
|
|
|
@@ -1145,7 +1148,9 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
|
|
flower.mask.tunnel.tos = tnl_mask->ip_tos;
|
|
flower.mask.tunnel.ttl = tnl_mask->ip_ttl;
|
|
flower.mask.tunnel.id = (tnl->flags & FLOW_TNL_F_KEY) ? tnl_mask->tun_id : 0;
|
|
- flower_match_to_tun_opt(&flower, tnl, tnl_mask);
|
|
+ if (!strcmp(netdev_get_type(netdev), "geneve")) {
|
|
+ flower_match_to_tun_opt(&flower, tnl, tnl_mask);
|
|
+ }
|
|
flower.tunnel = true;
|
|
}
|
|
memset(&mask->tunnel, 0, sizeof mask->tunnel);
|
|
@@ -1458,7 +1463,8 @@ netdev_tc_flow_get(struct netdev *netdev OVS_UNUSED,
|
|
}
|
|
|
|
in_port = netdev_ifindex_to_odp_port(ifindex);
|
|
- parse_tc_flower_to_match(&flower, match, actions, stats, attrs, buf);
|
|
+ parse_tc_flower_to_match(netdev, &flower, match, actions,
|
|
+ stats, attrs, buf);
|
|
|
|
match->wc.masks.in_port.odp_port = u32_to_odp(UINT32_MAX);
|
|
match->flow.in_port.odp_port = in_port;
|
|
--
|
|
2.33.0
|
|
|