From: Josef Schlehofer <pepe.schlehofer@gmail.com>
To: netdev@vger.kernel.org
Cc: marcin.s.wojtas@gmail.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, maxime.chevallier@bootlin.com, w@1wt.eu,
linux-kernel@vger.kernel.org
Subject: [PATCH net v2 2/5] net: mvneta: fix the removal of the mqprio offload
Date: Tue, 3 Nov 2026 13:50:18 +0100 [thread overview]
Message-ID: <20261103125021.70845-3-pepe.schlehofer@gmail.com> (raw)
In-Reply-To: <20261103125021.70845-1-pepe.schlehofer@gmail.com>
Deleting an offloaded mqprio qdisc leaves its traffic classes and
per-queue rate limits in place.
mqprio_disable_offload() passes an all-zero configuration, so qopt.hw
is 0 and mvneta_setup_mqprio() returns before it reaches the teardown
code.
Check qopt.hw only when traffic classes are set up.
A replacement qdisc is set up before the old one is torn down.
Replacing an offloaded mqprio qdisc with another mqprio under a new
handle therefore loses the new configuration, as with software mqprio.
Tested on a Turris Omnia (Armada 385) with 10 Mbit/s limits on a
100 Mbit/s link. After the qdisc was deleted, only TX queues 0-3 were
used and the link carried 19 Mbit/s. With this patch and the previous
one, the queues above 3 are used again and the link reaches 94 Mbit/s.
Fixes: e7ca75fe6662 ("net: mvneta: Don't force-set the offloading flag")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
drivers/net/ethernet/marvell/mvneta.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 9b9efac2846e..79711a117c39 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -5251,11 +5251,12 @@ static int mvneta_setup_mqprio(struct net_device *dev,
int rxq, txq, tc, ret;
u8 num_tc;
- if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS)
- return 0;
-
num_tc = mqprio->qopt.num_tc;
+ /* On removal the qdisc passes an all-zero qopt, with hw 0 */
+ if (num_tc && mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS)
+ return 0;
+
if (num_tc > rxq_number)
return -EINVAL;
--
2.54.0 (Apple Git-157)
next prev parent reply other threads:[~2026-11-03 12:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 12:50 [PATCH net v2 0/5] net: mvneta: fix the TX queue arbitration and " Josef Schlehofer
2026-11-03 12:50 ` [PATCH net v2 1/5] net: mvneta: lift the per-queue TX rate limits Josef Schlehofer
2026-11-03 18:56 ` Maxime Chevallier
2026-11-03 12:50 ` Josef Schlehofer [this message]
2026-11-03 19:00 ` [PATCH net v2 2/5] net: mvneta: fix the removal of the mqprio offload Maxime Chevallier
2026-11-03 12:50 ` [PATCH net v2 3/5] net: mvneta: serve the TX queues in weighted round robin Josef Schlehofer
2026-11-03 12:50 ` [PATCH net v2 4/5] net: mvneta: unwind a failed mqprio setup Josef Schlehofer
2026-11-03 19:01 ` Maxime Chevallier
2026-11-03 12:50 ` [PATCH net v2 5/5] net: mvneta: keep the TX rate limits across open and MTU change Josef Schlehofer
2026-11-03 18:56 ` [PATCH net v2 0/5] net: mvneta: fix the TX queue arbitration and the mqprio offload Maxime Chevallier
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=20261103125021.70845-3-pepe.schlehofer@gmail.com \
--to=pepe.schlehofer@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcin.s.wojtas@gmail.com \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=w@1wt.eu \
/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
all inboxes | Powered by JetHome®