diff options
author | Raed Salem <raeds@mellanox.com> | 2019-04-08 15:42:11 +0300 |
---|---|---|
committer | Simon Horman <simon.horman@netronome.com> | 2019-04-08 16:20:26 +0200 |
commit | 2e1fd552a48e65fba7437392dc9c42d03d4c1adc (patch) | |
tree | 8089aa25b2cee3f8238813a1be14baefa7f0da3e | |
parent | 01d8bf2967453d51127cbc1a3b75a549e282e31d (diff) | |
download | openvswitch-2e1fd552a48e65fba7437392dc9c42d03d4c1adc.tar.gz |
netdev-tc-offloads: Fix probe tc block support
Current implementation will try to create an qdisk of type ingress with
block id 1 to check for kernel ingress block support, this check is
insufficient as old kernels without ingress block support will
successfully create an ingress qdisc, ignoring the ingress block.
Fix by trying to add a test rule on the ingress block.
Fixes 093c9458fb02 ("tc: allow offloading of block ids")
Signed-off-by: Raed Salem <raeds@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Acked-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
-rw-r--r-- | lib/netdev-tc-offloads.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c index 8ae25b8b9..0a427a30b 100644 --- a/lib/netdev-tc-offloads.c +++ b/lib/netdev-tc-offloads.c @@ -1297,6 +1297,7 @@ out: static void probe_tc_block_support(int ifindex) { + struct tc_flower flower; uint32_t block_id = 1; int error; @@ -1305,10 +1306,21 @@ probe_tc_block_support(int ifindex) return; } + memset(&flower, 0, sizeof flower); + + flower.key.eth_type = htons(ETH_P_IP); + flower.mask.eth_type = OVS_BE16_MAX; + memset(&flower.key.dst_mac, 0x11, sizeof flower.key.dst_mac); + memset(&flower.mask.dst_mac, 0xff, sizeof flower.mask.dst_mac); + + error = tc_replace_flower(ifindex, 1, 1, &flower, block_id); + tc_add_del_ingress_qdisc(ifindex, false, block_id); - block_support = true; - VLOG_INFO("probe tc: block offload is supported."); + if (!error) { + block_support = true; + VLOG_INFO("probe tc: block offload is supported."); + } } int |