mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 v3 1/5] net: mvneta: lift the per-queue TX rate limits
Date: Mon, 09 Nov 2026 00:23:41 +0000	[thread overview]
Message-ID: <179418382115.994134.7847184519215065308@kernel.org> (raw)
In-Reply-To: <20261104224518.66487-2-pepe.schlehofer@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In drivers/net/ethernet/marvell/mvneta.c,
  mvneta_disable_per_queue_rate_limit() now writes every…

--

net: mvneta: lift the per-queue TX rate limits

When the per-queue TX rate limit is disabled, this commit sets the token
bucket refill registers of all TX queues to full rate. Without it, the
limits set by an earlier mqprio shaper stayed in effect after the shaper
was turned off.

> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index ea755cf05b9ef..9b9efac2846ef 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -5204,9 +5204,16 @@ static int mvneta_enable_per_queue_rate_limit(struct mvneta_port *pp)
>  static void mvneta_disable_per_queue_rate_limit(struct mvneta_port *pp)
>  {
>  	u32 val = mvreg_read(pp, MVNETA_TXQ_CMD1_REG);
> +	int queue;
>  
>  	val |= (MVNETA_TXQ_CMD1_BW_LIM_SEL_V1 | MVNETA_TXQ_CMD1_BW_LIM_EN);
>  	mvreg_write(pp, MVNETA_TXQ_CMD1_REG, val);
> +
> +	/* The token buckets still limit the queues, refill them at full rate */
> +	val = (1 << MVNETA_TXQ_BUCKET_REFILL_PERIOD_SHIFT) |
> +	      MVNETA_TXQ_BUCKET_REFILL_VALUE_MAX;
> +	for (queue = 0; queue < txq_number; queue++)
> +		mvreg_write(pp, MVNETA_TXQ_BUCKET_REFILL_REG(queue), val);

[Severity: Low]
Does "full rate" here depend on MVNETA_REFILL_NUM_CLK_REG having been
programmed first?

A period of 1 means one base refill period. The length of that period
comes from MVNETA_REFILL_NUM_CLK_REG. As far as I can see, the only write
to that register in the driver is in mvneta_enable_per_queue_rate_limit():

	/* Set the base refill rate */
	mvreg_write(pp, MVNETA_REFILL_NUM_CLK_REG, refill_cycles);

mvneta_setup_mqprio() can reach the disable path without the enable path
ever having run:

	if (!num_tc) {
		mvneta_disable_per_queue_rate_limit(pp);
		...

	if (mqprio->shaper != TC_MQPRIO_SHAPER_BW_RATE) {
		mvneta_disable_per_queue_rate_limit(pp);
		return 0;
	}

One example is the first offloaded mqprio after boot with no bw_rlimit
shaper, such as one that only maps VLAN priorities to RX queues. Later
in the series, deleting such an offload, or a setup that fails before
mvneta_enable_per_queue_rate_limit() runs, also takes this path.

In those cases the per-queue refill registers are overwritten while
MVNETA_REFILL_NUM_CLK_REG still holds its hardware reset value. Before
this patch they kept their defaults on a port where the shaper was never
enabled.

If the reset period is long, could this cap the TX queues below line
rate? For example, with NUM_CLK at 0xffff cycles, MAX tokens per period
works out to roughly 2 Gbit/s, which is below a 2.5G port's rate.

This depends on the reset value of MVNETA_REFILL_NUM_CLK_REG, which
can't be checked from the code. Period 1 with the maximum value is the
fastest setting the register can encode, so this may never be visible in
practice.

Would it make sense to also program MVNETA_REFILL_NUM_CLK_REG on the
disable path, so the "full rate" setting doesn't depend on the enable
path having run first?

>  }
>  
>  static int mvneta_setup_queue_rates(struct mvneta_port *pp, int queue,

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261104224518.66487-1-pepe.schlehofer%40gmail.com

  reply	other threads:[~2026-11-09  0:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 22:45 [PATCH net v3 0/5] net: mvneta: fix the TX queue arbitration and the mqprio offload Josef Schlehofer
2026-11-04 22:45 ` [PATCH net v3 1/5] net: mvneta: lift the per-queue TX rate limits Josef Schlehofer
2026-11-09  0:23   ` netdev-bot+sashiko [this message]
2026-11-04 22:45 ` [PATCH net v3 2/5] net: mvneta: fix the removal of the mqprio offload Josef Schlehofer
2026-11-09  0:23   ` netdev-bot+sashiko
2026-11-04 22:45 ` [PATCH net v3 3/5] net: mvneta: unwind a failed mqprio setup Josef Schlehofer
2026-11-09  0:23   ` netdev-bot+sashiko
2026-11-04 22:45 ` [PATCH net v3 4/5] net: mvneta: keep the TX rate limits across open and MTU change Josef Schlehofer
2026-11-09  0:23   ` netdev-bot+sashiko
2026-11-04 22:45 ` [PATCH net v3 5/5] net: mvneta: serve the TX queues in weighted round robin Josef Schlehofer

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=179418382115.994134.7847184519215065308@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®