๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12896

Re: [PATCH net v3 1/5] net: mvneta: lift the per-queue TX rate limits

#12896
From: netdev-bot+sashiko
Date: Mon, 09 Nov 2026 00:23
90 lines
11330 bytes
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
Technical Details
Message-ID: <179418382115.994134.7847184519215065308@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358924-linux-kernel-netdev=dewy.ru
References: <20261104224518.66487-2-pepe.schlehofer@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358924-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179418382115.994134.7847184519215065308@kernel.org>
References: <20261104224518.66487-2-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="236034"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:LjEvMHOvFuRCae8jNZk7xjtVXuA= sha256:bCMcpJ1kmwYUiLwqKjsRXngAn79mOwYDMMsAfw6Dzy0=
	sha1:gGpBMrOIuqOwe9mD5e2iqk+5HQ8= sha256:AQNdZirD9fTnU1yZ0QXDdpcCuiRb96wnwHow4VpVqWQ=
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 6B34911364F; Mon,  9 Nov 2026 03:24:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 tyUcNN8uX12L;
	Mon,  9 Nov 2026 03:24:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358924-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 2DFD011366B; Mon,  9 Nov 2026 03:23:54 +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 AC853691BC; Mon,  9 Nov 2026 00:23:44 +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=1794183824;
	b=juoD/n1eFQWJOiComX9d20g/TojRX//XBzeOtMnHDSZgfymoDoIGULzWNicp8aG7vWYd
	 NkmUORJoh8MSeaOq+60vD9RLfNdqRrlQQi4QEqXy5KNZE2QJ7On3xFr04vr8ROOgCRHRS
	 JQMyCOj3w/f8iKIy6X2E/LnR/37q9EufQ9HU5hCK/jDYbK2EWwiQz8V8M3Vlg1BiPJ3mq
	 e2D13KKRVtDAwyxK642Hnq3S1YedQ8l8CbMPXmv1JEk6UWCIZUZdPaLuhER1mc8yg2kog
	 Fe7h9uujSc1q28zdcYu+jTDAfzrEQvqWKjwSTUPkQPgNeTdpyQvmcdUKf/4b6vyuw0A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794183824;
	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=fb+OgOz+Kkm9T6KX15g4rjKPgCT3BsFEwLgAd4OsAeo=;
	b=Lub+c1djindHUiFT+g/aWJpiVai11UqD8qS2wMy/0GlADBbTvyd83AKpVSNuRJZLIwTZ
	 dmzuV7An6Kw21jxxRNG/RziAtU6MPHqXPbd/spOE+Mq6CRee8z3N/iElJB8niG7F8oLin
	 LcpAXYJRjTGh4ReLaYXsURntf2sfrDWBjXaxUjP+zBeeokCQuq8uyh9RdgigSUKsXEMwH
	 XpdLwvxCplApwVFUna4uhDz/ToI/0yIM+qe5/t/G7y8YzdMM3i1qqFTrRXKFm+uucYjRB
	 Hu0FRuADj1eeqW4XaG7shW4haV7CqSAheoJ3vmlwgH8n+5GbJApwVuSR1TBgJ/L2X2A==
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=BaCAm4OE;
	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 19B1B606A332;
	Mon,  9 Nov 2026 00:23:44 +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=BaCAm4OE
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=1794183823;
	b=ZpGA+3QunBxbOoGl3E1t+DDyK0AQZcaJvlSnRIikXfpJDF4r4T4gEnJqvGv8K6bMFz4F
	 OLJeXIV9Z0Y/0Qboa/bNReiZhX6pf41J+LIm0JwXljdSzLQKQAokuimf5qb8goD75GKRj
	 k/LzADCKmOtA4k1G/2qyaWvlZQyI+RnMKKeeUYeQ3canoV2lDwCIxAt+ccPNlNR6oHLeW
	 VmHHu2yKt43jvfr+UlQ0uo9VPA1ti9VnjmKdGH8MWXGs4glvPcv0vc1qT4PxkRyCN9lsK
	 TBSeSJGOs83gfCsczsQtlPPZxRWXQz1jvnidC3qxf3UUNBft3VIiibq/GJ18f1j3xww==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794183823;
	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=fb+OgOz+Kkm9T6KX15g4rjKPgCT3BsFEwLgAd4OsAeo=;
	b=ZKijXm8epkkfz7twKErZ1VK/Kg5VVI+CfRu/y4WVvUx33ApXicM3/bVSSgUxTCbO2n45
	 u1+QOpxzFgrRime/ZkSHSZFLJNqp1mcm3qy2yxEYX7P7wIBLrs05goFZTakSq5OwjCO9J
	 gkg6JF/O0muUYhpNHqYvGHg4w10MKh6h7XFXO5qljDLoaWRKnjCtWvii93u/RlavWICE0
	 K7PmIY0Ism/UQ4oD03MkPWKt2O3Hn9dFDF35UFnLCURC1t2GIcMUdBfsdeCoX/DkNzBg/
	 1fFArvXfuF6+QBG/ePfaWNxOPBe/I7rLcWCVP2/8giN1HN2i2DyYLw/4JoGYRSJFJOw==
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=BaCAm4OE;
	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 AB87D606A31C;
	Mon,  9 Nov 2026 00:23:42 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9721D1F0089F;
	Mon,  9 Nov 2026 00:23:41 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794183822;
	bh=fb+OgOz+Kkm9T6KX15g4rjKPgCT3BsFEwLgAd4OsAeo=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=BaCAm4OEoIJaJfq1zmTvbYS4VG7xYuNkmPJqJr4Rx4S5QNMADUzRFPYMZdJ/mXBhx
	 LaCTLMrkcstEd2Xenm9kvm9jaNxQ4KH/WF1wmT3EJMRu9u99JeJk0kCd5IncQbbvo1
	 7CQbBxF9y/93SMxqtkXCrkPuW5DzkiL+9SeSk+/nyR4zqqY0RqqMl+0XGxV8TsBS21
	 NcMVDn0Jfmg4SIspNV+7cguVvO3uJ/yGzziiRp3SzTZ5V0rv8HHrZ1nGwqNCIc54qZ
	 +9hEExyhXGOBS6vWB33N+gPfb436D18EUxWUNrdxbp+SFk/l7lRVCpvlN6NAG8Y5nS
	 ZdNbC5MsLeNAQ==
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: <20261104224518.66487-2-pepe.schlehofer@gmail.com>
X-sashiko-severity: Low
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