]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net/sched: Fix the logic error to decide the ingress qdisc
authorChris Mi <chrism@mellanox.com>
Fri, 18 Aug 2017 11:24:20 +0000 (07:24 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Aug 2017 17:29:04 +0000 (10:29 -0700)
The offending commit used a newly added helper function.
But the logic is wrong. Without this fix, the affected NICs
can't do HW offload. Error -EOPNOTSUPP will be returned directly.

Fixes: a2e8da9378cc ("net/sched: use newly added classid identity helpers")
Signed-off-by: Chris Mi <chrism@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/netronome/nfp/bpf/main.c
drivers/net/ethernet/netronome/nfp/flower/offload.c

index 77538cd8184a9b6b36f4b351d47efc54dc25bab0..e55a9299547a2030eb04714d03b55441a11bf13e 100644 (file)
@@ -2892,7 +2892,7 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate)
 static int cxgb_setup_tc_cls_u32(struct net_device *dev,
                                 struct tc_cls_u32_offload *cls_u32)
 {
-       if (is_classid_clsact_ingress(cls_u32->common.classid) ||
+       if (!is_classid_clsact_ingress(cls_u32->common.classid) ||
            cls_u32->common.chain_index)
                return -EOPNOTSUPP;
 
index f9fd8d8f1bef5dbd4fffe5b064cc0afeda590913..56d7ef014d0d08705fa986908d8a83b03f613c4a 100644 (file)
@@ -9230,7 +9230,7 @@ static int ixgbe_setup_tc_cls_u32(struct net_device *dev,
 {
        struct ixgbe_adapter *adapter = netdev_priv(dev);
 
-       if (is_classid_clsact_ingress(cls_u32->common.classid) ||
+       if (!is_classid_clsact_ingress(cls_u32->common.classid) ||
            cls_u32->common.chain_index)
                return -EOPNOTSUPP;
 
index 8633ca5af6ed44466bdb24fb4f66d69d34a7cf33..2fc3832bc2f3e697f9aa9a375fc71a5bd098172e 100644 (file)
@@ -3031,7 +3031,7 @@ static int mlx5e_setup_tc_cls_flower(struct net_device *dev,
 {
        struct mlx5e_priv *priv = netdev_priv(dev);
 
-       if (is_classid_clsact_ingress(cls_flower->common.classid) ||
+       if (!is_classid_clsact_ingress(cls_flower->common.classid) ||
            cls_flower->common.chain_index)
                return -EOPNOTSUPP;
 
index f34c00fbf78c31b8bfd6f42388e87882b54f1cab..7a9f53f74976111af057a401a35eb5606e8ba03d 100644 (file)
@@ -657,7 +657,7 @@ mlx5e_rep_setup_tc_cls_flower(struct net_device *dev,
 {
        struct mlx5e_priv *priv = netdev_priv(dev);
 
-       if (is_classid_clsact_ingress(cls_flower->common.classid) ||
+       if (!is_classid_clsact_ingress(cls_flower->common.classid) ||
            cls_flower->common.chain_index)
                return -EOPNOTSUPP;
 
index 0e6864922d5cc30ecdbbfa888eb390240262b0c2..f4de3a7377b0d953053a16e2fa65763c01b0d054 100644 (file)
@@ -127,7 +127,7 @@ static int nfp_bpf_setup_tc(struct nfp_app *app, struct net_device *netdev,
        struct nfp_net *nn = netdev_priv(netdev);
 
        if (type != TC_SETUP_CLSBPF || !nfp_net_ebpf_capable(nn) ||
-           is_classid_clsact_ingress(cls_bpf->common.classid) ||
+           !is_classid_clsact_ingress(cls_bpf->common.classid) ||
            cls_bpf->common.protocol != htons(ETH_P_ALL) ||
            cls_bpf->common.chain_index)
                return -EOPNOTSUPP;
index 3ad5aaa210a473ffe4b3a44b8a7e0dc570c33fa2..d868a5700e01595ddc763ab526324403380ab116 100644 (file)
@@ -390,7 +390,7 @@ int nfp_flower_setup_tc(struct nfp_app *app, struct net_device *netdev,
        struct tc_cls_flower_offload *cls_flower = type_data;
 
        if (type != TC_SETUP_CLSFLOWER ||
-           is_classid_clsact_ingress(cls_flower->common.classid) ||
+           !is_classid_clsact_ingress(cls_flower->common.classid) ||
            !eth_proto_is_802_3(cls_flower->common.protocol) ||
            cls_flower->common.chain_index)
                return -EOPNOTSUPP;