Article View: linux.kernel.netdev
Article #20272Re: [PATCH net-next v4 4/6] net: mvneta: keep the TX rate limits across open and MTU change
From: netdev-bot+sashiko
Date: Sat, 21 Nov 2026 23:02
Date: Sat, 21 Nov 2026 23:02
128 lines
12413 bytes
12413 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In this patch, a rejected mqprio shaper config leaves the new
`bucket_refill` copy set, and `mvneta_restore_per_queue_rate_limit()`…
--
net: mvneta: keep the TX rate limits across open and MTU change
This commit saves the refill value of each rate limited TX queue in a new
bucket_refill field of struct mvneta_tx_queue. A new helper,
mvneta_restore_per_queue_rate_limit(), writes the limits back from
mvneta_start_dev(). Before this, mvneta_txq_hw_init() reset every limit to
10.23 Mbit/s after ifup, an MTU change or resume.
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 76dfbc484269e..58453c69be361 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
[ ... ]
> @@ -5239,11 +5247,32 @@ static int mvneta_setup_queue_rates(struct mvneta_port *pp, int queue,
> val |= (MVNETA_TXQ_BUCKET_REFILL_PERIOD <<
> MVNETA_TXQ_BUCKET_REFILL_PERIOD_SHIFT);
>
> + pp->txqs[queue].bucket_refill = val;
> mvreg_write(pp, MVNETA_TXQ_BUCKET_REFILL_REG(queue), val);
>
> return 0;
> }
[Severity: Medium]
Can a rejected mqprio shaper config leave bucket_refill set for some
queues?
mvneta_setup_mqprio() calls mvneta_setup_queue_rates() one traffic class
at a time. If a later class fails (nonzero min_rate, a rate that is not a
multiple of 10 kbit/s, zero, or above the maximum), it returns in the
middle of the loop:
mvneta_setup_mqprio() {
...
ret = mvneta_setup_queue_rates(pp, txq,
mqprio->min_rate[tc],
mqprio->max_rate[tc]);
if (ret)
return ret;
...
}
The queues of the earlier classes keep a nonzero bucket_refill.
In net/sched/sch_mqprio.c, mqprio_enable_offload() sets priv->hw_offload
only when the offload succeeds. So mqprio_destroy() takes the
netdev_set_num_tc(dev, 0) branch and does not call the driver with
num_tc == 0.
That means mvneta_disable_per_queue_rate_limit() never runs, and it is
the only place that clears bucket_refill. This also breaks the "0 when
not limited" comment on the new field.
For example:
tc qdisc add ... mqprio ... hw 1 mode channel shaper bw_rlimit \
max_rate 10Mbit 10001kbit
mvneta_setup_mqprio()
class 0 sets bucket_refill for its queues
class 1 returns -EINVAL
hw_offload stays 0, mqprio_destroy() does not call the driver
ip link set dev ... down; ip link set dev ... up (or an MTU change)
mvneta_start_dev()
mvneta_restore_per_queue_rate_limit()
> +/* The TX queue setup overwrites the rate limits, program them again */
> +static void mvneta_restore_per_queue_rate_limit(struct mvneta_port *pp)
> +{
> + int queue;
> +
> + for (queue = 0; queue < txq_number; queue++) {
> + if (pp->txqs[queue].bucket_refill)
> + break;
> + }
> +
> + if (queue == txq_number || mvneta_enable_per_queue_rate_limit(pp))
> + return;
> +
> + for (; queue < txq_number; queue++) {
> + if (pp->txqs[queue].bucket_refill)
> + mvreg_write(pp, MVNETA_TXQ_BUCKET_REFILL_REG(queue),
> + pp->txqs[queue].bucket_refill);
> + }
> +}
At every later mvneta_start_dev(), would this find the leftover entries,
turn the v3 limiter back on, and write back the limits of the rejected
config?
No mqprio qdisc is installed at that point, so tc cannot show or delete
these limits. Installing and then deleting a valid shaper is the only way
to clear them.
Before this patch, a rejected config already left the hardware partly
configured, but that state did not survive a port restart.
The next patch in the series, "net: mvneta: validate an mqprio setup
before applying it", appears to fix this. With it, mvneta_setup_mqprio()
validates every class with mvneta_txq_refill_val() before touching the
hardware, and bucket_refill is written only after that.
Both patches carry the same Fixes: tag. Should they go to stable together,
or should this patch only store bucket_refill once the whole config has
been accepted?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118093012.90121-1-pepe.schlehofer%40gmail.com
Technical Details
Message-ID:
<179530217425.3135.3188367185761117756@kernel.org>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368502-linux-kernel-netdev=dewy.ruReferences:
<20261118093012.90121-5-pepe.schlehofer@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368502-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v4 4/6] net: mvneta: keep the TX rate limits across open and MTU change Date: Sat, 21 Nov 2026 23:02:54 +0000 Organization: Usenet Network Message-ID: <179530217425.3135.3188367185761117756@kernel.org> References: <20261118093012.90121-5-pepe.schlehofer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3516642"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:aUNYSbP96o/vtc91y/wP6vkYl8o= sha256:KWxXFv+3euZgMYjFCIJ6O3yPD6pkmqTdfQBJsqJADEk= sha1:XZHTL+7uDUmYZX7aWEIlGo9jIk8= sha256:pY6Fuaea5o3vPIvLquxvRT8uqxjjUxJbzZ7GaFb/W/A= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1B14F115C22; Sun, 22 Nov 2026 02:03:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eDFOYbrEZIO6; Sun, 22 Nov 2026 02:03:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368502-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 37AAC115C20; Sun, 22 Nov 2026 02:03:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id EFAE83B240; Sat, 21 Nov 2026 23:03:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795302181; b=WH+sNs9UHot2h8doxb+tgEpbHe9SxQgQYZ9SJZ3M2niuNLklnkd+l8rq2UJHJfYGBW2Z 0aqqq3TccQGhkTzdzif+XeYomAHPMII0E2jIHEGfPBFTq4MHJkuJH9BV/nC4unmecUquT cL+Bhqviigye3y34A89sDLPOYhecowLHCzTZu9WHr+AniVgJx2MgzWsRmXoDRnAy6SL5o PYYi60sLIobtuLhQ39f0DJD2FiFJNQGl6mzq/p4DLqOi7xs4bOZLYZ1b43C7Yliva1ypd c2Q971xw3uJwNDcYUgTlNXE346EKVh0NDp1MNL2oddTL0CwuWIlcYNqi7tq6rpcoOBg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302181; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=BcwfrCF7f7T5NQYQ4yDuCUyKOzQJSTxR3lI9Uml7xAg=; b=LgVnURcFINsesdMPWWWZRhXZ+yRE+BzNc45HQj3uNYX3kv9IZ6toC4YiMgRXmyhS5fBQ t+x96lgSsiFZe7aZLOUsES9qr0XBxXHkK6hpcIY7SLtLWd8jgYcrZE6lD3IOIpGPL+g4d csgzJ3NMb4VDGiv27C/7jSadrkQrLxPegk9GGzXSHY9CXGP5kXWq6ZiTiDuVlf5i1jXJb qSmXvpwdHpVsdm1+RwmJr1nPUcrInimj9jJfveKqTXwzk11GazrQPsD0zdGx/ZISd5XHx e8pGwQAub3XEbzejEbF/1DEuWGoiROmPaTRxonntvxavjJGXMNaKDqj8xZUCZkqPGyg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KFCFmOi+; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F81B606A688; Sat, 21 Nov 2026 23:03:01 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KFCFmOi+ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795302175; b=Iuy/d1nNsj6zFP98lZUe8sMSY58pXs4tj9Mg6gZ3EsKvkO2uul8V2YCQa4BVcTvW+5L8 4varhjxngBktvIji9+G2kySA99ZLq1g7wDdLw52surpz2XmJQFCJ/f17T2plIzpqqQUf+ 2wZDj+QKfJVXpTfiTzRld6aJXjPeY4G3wvM344uGH7FifxNPu9n5sq063XbjW4CxiBYii hEIFFLhfpzESlfilyy+LCq58z5nv8ZzOdeord/7arQ1dpsKDOvU7XtXpyLy5ExrsR81iJ EM0T1BriIIlBRTLWP00e3bw6ahjmG46D8uZ02AoZsWyrDevm040sH7CrKkRCi+STRjQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795302175; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=BcwfrCF7f7T5NQYQ4yDuCUyKOzQJSTxR3lI9Uml7xAg=; b=1J7U5SZT1JExbedEMity3KTi/dUWJeizRcBfV6p31fteYcnkNjj0KSqDlh077Y/nR7mU BfXyYhoeDRg8vFCYhiqm5PHksERxYj4JwudEIHxxVJL9omx04kzkZcG3j3OhmAUsUNvwY qJUR9r+8QShqjuL7qg+uDJDZybbWp9mHeGRfr1WRe57fn1SUH9iSmCYMcHvsJca2plIqO gBjFstOAUFPAK2HYdq8IV0JKK6pWEIKq0dnQ0FRWQc8s2DlzKnzJarsMuFyjMMy3HQd9N svX73yaBmuuL5CrkzXqkuctgHlXCw7r6MsM/dMm8xYohLp2t+lkzuMEkV89ONHCZi/w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=KFCFmOi+; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 821EB606A33E; Sat, 21 Nov 2026 23:02:55 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A53DF1F000C6; Sat, 21 Nov 2026 23:02:54 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795302175; bh=BcwfrCF7f7T5NQYQ4yDuCUyKOzQJSTxR3lI9Uml7xAg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=KFCFmOi++nS91OlAYII9Okgq0ZwLlUgi8yRP2FFDoU0WUKA00+bNCHKa6kgrTjshN sNKw0hcEh63MyA1b2u3smhvQGM7EcGpZcKLmJaUkTbdV2XKJan0aZuA+wr9ZsIqtZT lOlAEHt7BJLHxZEYEo1My8K9VNdo4tMfXliwCOLbG4iFung8jXiyJfJqTnn0JfaCtC 2UYP1Ygmq3tEoBCFcnSZkoIo0DpRIjLsejSjuztYzm4IgltN8XcO50ugXMMnm6F3If kU++mtWx1WbPoHtgbeS4Paw24aThJ/SxXUfgNKcCPwwQlNv56qaf0iN8VrbtJmGV6F qhhA80l+TlhMQ== X-Cc: netdev@vger.kernel.org, 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 X-In-Reply-To: <20261118093012.90121-5-pepe.schlehofer@gmail.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list