public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: unlisted-recipients:; (no To-header on input)
Cc: "Jesper Dangaard Brouer" <brouer@redhat.com>,
	netdev@vger.kernel.org,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	ruxandra.radulescu@nxp.com, ioana.ciornei@nxp.com,
	nipun.gupta@nxp.com, shawnguo@kernel.org
Subject: [PATCH net-next 2/2] dpaa2-eth: fix return codes used in ndo_setup_tc
Date: Thu, 23 Apr 2020 16:57:50 +0200	[thread overview]
Message-ID: <158765387082.1613879.14971732890635443222.stgit@firesoul> (raw)
In-Reply-To: <158765382862.1613879.11444486146802159959.stgit@firesoul>

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>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index 873b66ed3aee..a72f5a0d9e7c 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -2055,7 +2055,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);
@@ -2067,7 +2067,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) {



  parent reply	other threads:[~2020-04-23 14:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 14:57 [PATCH net-next 0/2] Fix qdisc noop issue caused by driver and identify future bugs Jesper Dangaard Brouer
2020-04-23 14:57 ` [PATCH net-next 1/2] net: sched: report ndo_setup_tc failures via extack Jesper Dangaard Brouer
2020-04-23 19:51   ` Ioana Ciornei
2020-04-23 14:57 ` Jesper Dangaard Brouer [this message]
2020-04-23 15:28   ` [PATCH net-next 2/2] dpaa2-eth: fix return codes used in ndo_setup_tc Stephen Hemminger
2020-04-23 15:38     ` Jesper Dangaard Brouer
2020-04-23 19:33       ` Stephen Hemminger
2020-04-23 19:56         ` Jakub Kicinski
2020-04-24  7:04           ` Jesper Dangaard Brouer
2020-04-25  0:28             ` Jakub Kicinski
2020-04-27 14:18               ` Marcelo Ricardo Leitner
2020-04-23 19:49   ` Ioana Ciornei
2020-04-24 23:45 ` [PATCH net-next 0/2] Fix qdisc noop issue caused by driver and identify future bugs David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158765387082.1613879.14971732890635443222.stgit@firesoul \
    --to=brouer@redhat.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=nipun.gupta@nxp.com \
    --cc=ruxandra.radulescu@nxp.com \
    --cc=shawnguo@kernel.org \
    --cc=toke@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox