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-next v4 6/6] net: mvneta: serve the TX queues in weighted round robin
Date: Sat, 21 Nov 2026 23:02:55 +0000	[thread overview]
Message-ID: <179530217537.3135.2864178231067849132@kernel.org> (raw)
In-Reply-To: <20261118093012.90121-7-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] Nothing in the driver confirms that the fix works on Armada
  370/XP.

--

net: mvneta: serve the TX queues in weighted round robin

This patch gives every TX queue the same WRR weight and clears the fixed
TX queue priority. It writes both the newer register set and the separate
version 1 arbiter registers listed for Armada 370/XP. While an mqprio
offload is active, fixed priority stays in place.

Link: https://github.com/openwrt/openwrt/issues/5411

> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 89ade2ed7ce49..35409695d3d78 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -118,6 +118,7 @@
>  #define      MVNETA_HSGMII_SERDES_PROTO		 0x1107
>  #define MVNETA_TYPE_PRIO                         0x24bc
>  #define      MVNETA_FORCE_UNI                    BIT(21)
> +#define MVETH_TXQ_FIXED_PRIO_REG                 0x24dc
>  #define MVNETA_TXQ_CMD_1                         0x24e4
>  #define MVNETA_TXQ_CMD                           0x2448

[ ... ]

> @@ -1632,6 +1640,39 @@ static void mvneta_txq_max_tx_size_set(struct mvneta_port *pp, int max_tx_size)
>  	}
>  }
>  
> +static void mvneta_txq_wrr_weight(struct mvneta_port *pp, u32 reg, u32 weight)
> +{
> +	u32 val = mvreg_read(pp, reg);
> +
> +	val &= ~MVNETA_TXQ_WRR_WEIGHT_MASK;
> +	mvreg_write(pp, reg, val | weight);
> +}
> +
> +/* With the default fixed priority, a busy queue starves the others.
> + * The Armada 370 and XP manuals list separate registers for the
> + * version 1 arbiter, which runs without a shaper, so set both.
> + */
> +static void mvneta_txq_wrr_set(struct mvneta_port *pp, int max_tx_size)
> +{
> +	/* In units of 256 bytes, must exceed the largest packet */
> +	u32 weight = max_tx_size / 256 + 1;
> +	int queue;
> +
> +	for (queue = 0; queue < txq_number; queue++) {
> +		mvneta_txq_wrr_weight(pp, MVNETA_TXQ_WRR_ARB_REG(queue), weight);
> +		mvneta_txq_wrr_weight(pp, MVETH_TXQ_WRR_ARB_REG(queue), weight);
> +	}
> +}
> +
> +/* Only the traffic classes of an mqprio offload keep the fixed priority */
> +static void mvneta_txq_fixed_prio_set(struct mvneta_port *pp)
> +{
> +	u32 val = pp->txq_fixed_prio ? MVNETA_TXQ_FIXED_PRIO_ALL : 0;
> +
> +	mvreg_write(pp, MVNETA_TXQ_FIXED_PRIO_REG, val);
> +	mvreg_write(pp, MVETH_TXQ_FIXED_PRIO_REG, val);
> +}

[Severity: Medium]
Is the version 1 arbiter on Armada 370/XP actually running WRR when these
registers are written?

In the same legacy 0x24xx block, mvneta_defaults_set() writes 0 to the v1
TXQ command register:

drivers/net/ethernet/marvell/mvneta.c:mvneta_defaults_set() {
    ...
	/* Disable Legacy WRR, Disable EJP, Release from reset */
	mvreg_write(pp, MVNETA_TXQ_CMD_1, 0);
    ...
}

That runs from mvneta_init() and mvneta_resume(), and nothing in this
patch sets MVNETA_TXQ_CMD_1 again. When an mqprio setup has no shaper, or
when the offload is removed, mvneta_disable_per_queue_rate_limit() sets
MVNETA_TXQ_CMD1_BW_LIM_SEL_V1, which selects the v1 algorithm.

Suppose the "Legacy WRR" bit in MVNETA_TXQ_CMD_1 is what turns on WRR in
the v1 arbiter. On 370/XP, would the weights written to
MVETH_TXQ_WRR_ARB_REG() then be ignored? Clearing MVETH_TXQ_FIXED_PRIO_REG
would also leave the arbiter in a mode the driver never programs, and the
multi-flow TX starvation could still happen on those boards.

The 256-byte unit used for the v1 weight field seems to depend on the same
assumption.

The commit message says only the Armada 385 was tested, and on that SoC
the two register sets are the same registers. That test doesn't exercise
the separate v1 path. Could this be checked against the Armada 370/XP
functional spec, or tested on 370/XP hardware?

[ ... ]

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

      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
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 [this message]

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