]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
dpaa2-eth: fix return codes used in ndo_setup_tc
authorJesper Dangaard Brouer <brouer@redhat.com>
Thu, 23 Apr 2020 14:57:50 +0000 (16:57 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
BugLink: https://bugs.launchpad.net/bugs/1885023
[ Upstream commit b89c1e6bdc73f5775e118eb2ab778e75b262b30c ]

Drivers ndo_setup_tc call should return -EOPNOTSUPP, when it cannot
support the qdisc type. Other return values will result in failing the
qdisc setup.  This lead to qdisc noop getting assigned, which will
drop all TX packets on the interface.

Fixes: ab1e6de2bd49 ("dpaa2-eth: Add mqprio support")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

index a935b20effa3a025a933de28e8420b8bda7df934..3177dd8ede8e3abf999b5f5a8471c2c95a48601a 100644 (file)
@@ -1981,7 +1981,7 @@ static int dpaa2_eth_setup_tc(struct net_device *net_dev,
        int i;
 
        if (type != TC_SETUP_QDISC_MQPRIO)
-               return -EINVAL;
+               return -EOPNOTSUPP;
 
        mqprio->hw = TC_MQPRIO_HW_OFFLOAD_TCS;
        num_queues = dpaa2_eth_queue_count(priv);
@@ -1993,7 +1993,7 @@ static int dpaa2_eth_setup_tc(struct net_device *net_dev,
        if (num_tc  > dpaa2_eth_tc_count(priv)) {
                netdev_err(net_dev, "Max %d traffic classes supported\n",
                           dpaa2_eth_tc_count(priv));
-               return -EINVAL;
+               return -EOPNOTSUPP;
        }
 
        if (!num_tc) {