From: netdev-bot+sashiko@kernel.org
To: pepe.schlehofer@gmail.com
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
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 [thread overview]
Message-ID: <179530217425.3135.3188367185761117756@kernel.org> (raw)
In-Reply-To: <20261118093012.90121-5-pepe.schlehofer@gmail.com>
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
next prev parent reply other threads:[~2026-11-21 23:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 9:30 [PATCH net-next v4 0/6] net: mvneta: fix the TX queue arbitration and the mqprio offload Josef Schlehofer
2026-11-18 9:30 ` [PATCH net-next v4 1/6] net: mvneta: lift the per-queue TX rate limits Josef Schlehofer
2026-11-18 9:30 ` [PATCH net-next v4 2/6] net: mvneta: fix the removal of the mqprio offload Josef Schlehofer
2026-11-21 23:02 ` netdev-bot+sashiko
2026-11-18 9:30 ` [PATCH net-next v4 3/6] net: mvneta: check the TX queue range of an " Josef Schlehofer
2026-11-18 9:30 ` [PATCH net-next v4 4/6] net: mvneta: keep the TX rate limits across open and MTU change Josef Schlehofer
2026-11-21 23:02 ` netdev-bot+sashiko [this message]
2026-11-18 9:30 ` [PATCH net-next v4 5/6] net: mvneta: validate an mqprio setup before applying it Josef Schlehofer
2026-11-18 9:30 ` [PATCH net-next v4 6/6] net: mvneta: serve the TX queues in weighted round robin Josef Schlehofer
2026-11-21 23:02 ` netdev-bot+sashiko
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=179530217425.3135.3188367185761117756@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--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=pepe.schlehofer@gmail.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®