]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net : sched: cls_api: deal with egdev path only if needed
authorOr Gerlitz <ogerlitz@mellanox.com>
Wed, 23 May 2018 16:24:48 +0000 (19:24 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 5 Sep 2018 08:30:45 +0000 (10:30 +0200)
BugLink: http://bugs.launchpad.net/bugs/1789666
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/sched/cls_api.c

index efad96343a5df20762dd0d16c4eaae2a91b59f9e..64d414198286974d5ac7333ce496065346407373 100644 (file)
@@ -1241,7 +1241,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)