๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20268

Re: [PATCH net-next v4 6/6] net: mvneta: serve the TX queues in weighted round robin

#20268
From: netdev-bot+sashiko
Date: Sat, 21 Nov 2026 23:02
114 lines
12168 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] 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
Technical Details
Message-ID: <179530217537.3135.2864178231067849132@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368503-linux-kernel-netdev=dewy.ru
References: <20261118093012.90121-7-pepe.schlehofer@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368503-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179530217537.3135.2864178231067849132@kernel.org>
References: <20261118093012.90121-7-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="3516379"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:AOEMnDI28fl2p13VtyQg06ESfu4= sha256:AB5WGA0w/caxcfft2/EPxsHx4hchBSubJoOwcocMwCg=
	sha1:gSdU61o+FQE6cnQSvJdrYIvrXhg= sha256:7CNxsA9mLWn8k0aPGIW4Or4Qj8wqoro2sAn0l5IqHNs=
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 DD6AF115C1F; Sun, 22 Nov 2026 02:03:17 +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 ACHJQc7EnApP;
	Sun, 22 Nov 2026 02:03:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-368503-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id E7216115C1C; Sun, 22 Nov 2026 02:03:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id AD14528EAB; Sat, 21 Nov 2026 23:03:00 +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=1795302177;
	b=q6q21VAuhvIHwwJCTeOygovn2dhm94sWMvLv+Vbm8Ka1NyNP/WAkNVHlm7zOoMyWAOmf
	 wcZp89rf4Zb/4l+7/MP6SVuOmRpD3VqChgdQDnxfTWVQTp3wWnAWkVmanxBcOehk5gQuR
	 b7rDtQeJlBEYMSAWja6QOsHRPrgZ8oSRIlLgJmUmynNIGrkcsCDIo1qRS2dvghnfKRhzy
	 Hrr6TPRuYS4t+Ec1BJi5Z6o+C3+rrGYvCz9GhtSdYegyEt1d3kZn2SIEzlUaEx19fp4wP
	 5lNSEMUH0/C8d9cHZNdrQo72Mib5YuFVO4udRbjffb2TkHtE4rjUCFjxHjfXoc03JtA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795302177;
	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=iFUv2lIek8geqEsLfyH9iDG/cs5MT6KhQ4IgQhPr934=;
	b=OsBKNxKJ0i6I7YFejw1JQ53E6IhALzadwh0oXI+5mFi4uugEKrw0m5tG5woQH1+WMUkg
	 XHa2Bc/zhc4+zonItxRNrcujLJ0NVEPGQIEAmssUt+/HX2NkcV7zhYzFq8cd+970tf9Ws
	 HAa1VjU5sWfxqS95qsPoCzHbKhuFWnvAjaw+mNjW9saIz6B+Uub4Pj/tzZe58kEi/3FrP
	 cREZGAd1sypKacQmpICdkyMvPgAKXTftStsxQOw3lPHT7SmMT01qNsCib4Wv4biiQHk9O
	 JF1lBYECZrhWJ742F1Mw7Ld3+k7qlDiuWDfRuDdbYtTUSBx3kRtP6X0gBqhrN/sR0ug==
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=QHTUg+gw;
	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 84EFB606A333;
	Sat, 21 Nov 2026 23:02:57 +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=QHTUg+gw
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=1795302176;
	b=3z7vcGlmPiqKHzgc9gU87QlkU6wlGGly2BDPFUtp9GNfOvGXAAv/c+K3DPGiLoQVUUyG
	 rvdSCnkHzgwSPIhOuXWGG659NTPb/ofH1DK4yRnkJAarC1dWeKSQaiiSB/tls0a6Ka123
	 HU/kkJn05hGxf+UvHAwHgfVPvzSiKh67NT+SMXNfMs9k9wQz96JHxJ+hZ0XyzBcq2dLH8
	 f2iLwY+aZgnja7nrwk06dln2GXOXYHCib6818MSHAx1VbIIV6gJGiqtrA09JBk0nPMs7o
	 VYhJsvPGtBimxd4DQ59EiuH6Gle8r2Z4DOvwRSZ4jfZTfWqoE1YubH2AgWLMEHBPaIw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795302176;
	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=iFUv2lIek8geqEsLfyH9iDG/cs5MT6KhQ4IgQhPr934=;
	b=XhiWvWSMNvcBhWQeLDI+9/mY6aKx9H9GGDGxg6/B7/ZFwUn5oWknfII3r/TIMA/umR6W
	 PO6BsESmgcFGDnaYG1AnmjThQzhvqCG+6MR+mjy/vV6PvaQUuFO/z1nmY8kSbZO5T3fcb
	 xVAY9U1xQFAiDHDhuADAlgWsfQuMnR0n8anmbxlyQ16rHQi+0Jh6oVzfeQ8JMlwXSWsT3
	 apSK/Pzw/agvAGoL/giMYwpRouYTswTon9Qe7DKKSe+x1oZpYDY1B2Nzp2JonT9ddiDHm
	 mjMqcDXMIUbE+J1SfeaNgX+KgEBvoE4RUHKr/YSETrkOEXGh9BF90H1nmaBQhSaOpSQ==
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=QHTUg+gw;
	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 A5C21606A331;
	Sat, 21 Nov 2026 23:02:56 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1FC11F000C6;
	Sat, 21 Nov 2026 23:02:55 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795302176;
	bh=iFUv2lIek8geqEsLfyH9iDG/cs5MT6KhQ4IgQhPr934=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=QHTUg+gwjVJ9RhOLpnk3xBkp2Nsog6f74hYFwCkptMXJswYZtEJwWDORU5FsfrutW
	 OhTjQA3CX3IaYFE+mRYo6FvDEF9rDBb7KeSY9ubxKj4oGhlFNy8dllF8zxGWnRwMDf
	 jwnYD+y8oQYwOArE8/Gp3dhBJXJEYLd2MjEz/8XuYgnzwWubJr+PfK7opph2tGDzDD
	 C0HPkrWecFiuKtCzHyF4F+EGCbTsltwLehECRxn8VZpqrfGD5ayW3UNQ5XWSGsfcVF
	 DpJ/nUUsFJ0OQWjw6jVyINr6qsse1WFuPTo6mAt6JdjDwQBsh7tTlH9EQcvhx1dahi
	 CgEqss/Kx8ZJw==
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-7-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