]> git.karo-electronics.de Git - linux-beck.git/commitdiff
net: relax setup_tc ndo op handle restriction
authorJohn Fastabend <john.fastabend@gmail.com>
Mon, 29 Feb 2016 19:26:13 +0000 (11:26 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Mar 2016 21:25:15 +0000 (16:25 -0500)
I added this check in setup_tc to multiple drivers,

 if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)

Unfortunately restricting to TC_H_ROOT like this breaks the old
instantiation of mqprio to setup a hardware qdisc. This patch
relaxes the test to only check the type to make it equivalent
to the check before I broke it. With this the old instantiation
continues to work.

A good smoke test is to setup mqprio with,

# tc qdisc add dev eth4 root mqprio num_tc 8 \
  map 0 1 2 3 4 5 6 7 \
  queues 0@0 1@1 2@2 3@3 4@4 5@5 6@6 7@7

Fixes: e4c6734eaab9 ("net: rework ndo tc op to consume additional qdisc handle paramete")
Reported-by: Singh Krishneil <krishneil.k.singh@intel.com>
Reported-by: Jake Keller <jacob.e.keller@intel.com>
CC: Murali Karicheri <m-karicheri2@ti.com>
CC: Shradha Shah <sshah@solarflare.com>
CC: Or Gerlitz <ogerlitz@mellanox.com>
CC: Ariel Elior <ariel.elior@qlogic.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
CC: Bruce Allan <bruce.w.allan@intel.com>
CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/sfc/tx.c
drivers/net/ethernet/ti/netcp_core.c

index 33606840ae159f06400e0a1031c8f4835fb2acaa..ebf9224b2d312fa1ecc4d43434bde81d751c8df0 100644 (file)
@@ -1632,7 +1632,7 @@ static int xgbe_setup_tc(struct net_device *netdev, u32 handle, __be16 proto,
        struct xgbe_prv_data *pdata = netdev_priv(netdev);
        u8 tc;
 
-       if (handle != TC_H_ROOT || tc_to_netdev->type != TC_SETUP_MQPRIO)
+       if (tc_to_netdev->type != TC_SETUP_MQPRIO)
                return -EINVAL;
 
        tc = tc_to_netdev->tc;
index 45843d15086846f2d68b5d3005629927e5294da3..a949783c8fc3bbb4c2ba1926492bf4de376ca166 100644 (file)
@@ -4275,7 +4275,7 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
 int __bnx2x_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
                     struct tc_to_netdev *tc)
 {
-       if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
+       if (tc->type != TC_SETUP_MQPRIO)
                return -EINVAL;
        return bnx2x_setup_tc(dev, tc->tc);
 }
index aa6a3189caca38d3764c94b9c3d1430d4e359c6f..ce6b075842ee592ee4757ebde82887eef963fb36 100644 (file)
@@ -5447,7 +5447,7 @@ static int bnxt_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
        struct bnxt *bp = netdev_priv(dev);
        u8 tc;
 
-       if (handle != TC_H_ROOT || ntc->type != TC_SETUP_MQPRIO)
+       if (ntc->type != TC_SETUP_MQPRIO)
                return -EINVAL;
 
        tc = ntc->tc;
index dc1a82148ff01d27dba588221ae777c1c7c8ca4f..d09a8dd71fc2e4d28eac12be113e84b528dc142d 100644 (file)
@@ -1207,7 +1207,7 @@ err_queueing_scheme:
 static int __fm10k_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
                            struct tc_to_netdev *tc)
 {
-       if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
+       if (tc->type != TC_SETUP_MQPRIO)
                return -EINVAL;
 
        return fm10k_setup_tc(dev, tc->tc);
index b893ff8e65f598e580bf618a39c639c4088b925d..4d6223da4a19b7ad337714760552bf226b00f23f 100644 (file)
@@ -8419,7 +8419,7 @@ int __ixgbe_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
                }
        }
 
-       if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
+       if (tc->type != TC_SETUP_MQPRIO)
                return -EINVAL;
 
        return ixgbe_setup_tc(dev, tc->tc);
index e26b110e27da8ef25b57a9941be1f8782f673a8f..16b26d17c54c2d0374112d293ff0f0377f3ecdef 100644 (file)
@@ -73,7 +73,7 @@ int mlx4_en_setup_tc(struct net_device *dev, u8 up)
 static int __mlx4_en_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
                              struct tc_to_netdev *tc)
 {
-       if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
+       if (tc->type != TC_SETUP_MQPRIO)
                return -EINVAL;
 
        return mlx4_en_setup_tc(dev, tc->tc);
index 2cdb5718ed66a580c0748023f1c6ecd755c51855..2337789115579972ae4608445872af0b933b3759 100644 (file)
@@ -571,7 +571,7 @@ int efx_setup_tc(struct net_device *net_dev, u32 handle, __be16 proto,
        unsigned tc, num_tc;
        int rc;
 
-       if (handle != TC_H_ROOT || ntc->type != TC_SETUP_MQPRIO)
+       if (ntc->type != TC_SETUP_MQPRIO)
                return -EINVAL;
 
        num_tc = ntc->tc;
index ed0c30f590d49fd57f691b7f3894f9082a155197..1d0942c531209ea5b581ede060398b33fa7d61a7 100644 (file)
@@ -1860,7 +1860,7 @@ static int netcp_setup_tc(struct net_device *dev, u32 handle, __be16 proto,
        /* setup tc must be called under rtnl lock */
        ASSERT_RTNL();
 
-       if (handle != TC_H_ROOT || tc->type != TC_SETUP_MQPRIO)
+       if (tc->type != TC_SETUP_MQPRIO)
                return -EINVAL;
 
        /* Sanity-check the number of traffic classes requested */