summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@mellanox.com>2018-05-23 19:24:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-06-11 22:48:18 +0200
commit3e1022d62ee621e1ab2635f2d4a34cb1e5754971 (patch)
tree8de25c144c10f599b5a18a32fc8a51f417d948e8
parente9e1ad7477a5cab4d9ef33613f2bf559283d0a08 (diff)
downloadlinux-3e1022d62ee621e1ab2635f2d4a34cb1e5754971.tar.gz
linux-3e1022d62ee621e1ab2635f2d4a34cb1e5754971.tar.bz2
linux-3e1022d62ee621e1ab2635f2d4a34cb1e5754971.zip
net : sched: cls_api: deal with egdev path only if needed
[ Upstream commit f8f4bef322e4600c5856911c7a632c0e3da920d6 ] When dealing with ingress rule on a netdev, if we did fine through the conventional path, there's no need to continue into the egdev route, and we can stop right there. Not doing so may cause a 2nd rule to be added by the cls api layer with the ingress being the egdev. For example, under sriov switchdev scheme, a user rule of VFR A --> VFR B will end up with two HW rules (1) VF A --> VF B and (2) uplink --> VF B Fixes: 208c0f4b5237 ('net: sched: use tc_setup_cb_call to call per-block callbacks') Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/sched/cls_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index c2c732aad87c..86d2d5977f56 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -1587,7 +1587,7 @@ int tc_setup_cb_call(struct tcf_block *block, struct tcf_exts *exts,
return ret;
ok_count = ret;
- if (!exts)
+ if (!exts || ok_count)
return ok_count;
ret = tc_exts_setup_cb_egdev_call(exts, type, type_data, err_stop);
if (ret < 0)