🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18731

[PATCH net 1/4] net: bcmgenet: accumulate the DIM packet and byte counters

#18731
From: Nicolai Buchwitz
Date: Wed, 18 Nov 2026 19:55
35 lines
9710 bytes
net_dim() computes rates from the difference between two samples and
needs running totals, but bcmgenet_desc_rx() passes the counts of the
last poll. Adaptive coalescing then picks profiles from wrong rates.

On a CM4 at a steady 300 Mbit/s UDP, DIM changed profile about 1000
times in 20 s. With the fix it settles, and Rx interrupts drop from about
4500/s to 2240/s.

Accumulate the counters instead.

Fixes: 9f4ca05827a2 ("net: bcmgenet: Add support for adaptive RX coalescing")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 4d2be2a21ed1..70c6a6465c81 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2486,8 +2486,8 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
 		bcmgenet_rdma_ring_writel(priv, ring->index, ring->c_index, RDMA_CONS_INDEX);
 	}
 
-	ring->dim.bytes = bytes_processed;
-	ring->dim.packets = rxpktprocessed;
+	ring->dim.bytes += bytes_processed;
+	ring->dim.packets += rxpktprocessed;
 
 	return rxpktprocessed;
 }

-- 
2.53.0
Technical Details
Message-ID: <20261118-nb-genet-dim-stats-net-v1-1-13b275f1e088@tipi-net.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366409-linux-kernel-netdev=dewy.ru
References: <20261118-nb-genet-dim-stats-net-v1-0-13b275f1e088@tipi-net.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366409-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 1/4] net: bcmgenet: accumulate the DIM packet and byte
 counters
Date: Wed, 18 Nov 2026 20:55:30 +0100
Organization: Usenet Network
Message-ID: <20261118-nb-genet-dim-stats-net-v1-1-13b275f1e088@tipi-net.de>
References: <20261118-nb-genet-dim-stats-net-v1-0-13b275f1e088@tipi-net.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2686119"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:n798Ib1X3XccKAYUVrIxb532lWc= sha256:7oH98efBdlxGyUoKR3T2YUzfIgToiLgEo1zMIzq3Aho=
	sha1:heZnPpGxNpdFgJrxPt6CYtT9+lE= sha256:zHlCupqtXospczNbL4uWGH6LT2eEEaNj7zJdKk2el2g=
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 A4BCA1153C1; Wed, 18 Nov 2026 22:56:33 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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=tipi-net.de
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 BymLxV6FQ65J;
	Wed, 18 Nov 2026 22:56:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366409-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id EEF211153AF; Wed, 18 Nov 2026 22:56:20 +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 DEFA81422B8; Wed, 18 Nov 2026 19:56:15 +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=1795031771;
	b=ag6WHq+mjtk74umdOXc1z0jXkdF3FXgOuNmaSTLK8rvOASZqBkA1CVOWyYfp+aoH0KMl
	 NqcgwFXGgrRMlhXE9SJTLK72EBc8m5Gg4s7S8M/BpxZA4Paz9nROuWzOyusWAfOpUMNGN
	 HsVmAdSapmQDl8OQ383Q2vcPs96klN/0NKaV2IQf8tpBnd7uEReuBByaekCUBm6BbLzhe
	 yGszknaMp5Gv37zVckvbElRg99/czIxmxCHWOUXxNwN3reOtA5mOziaDz0Gd55AmB6YpE
	 ugD4sD2/LsJuts1zZbNBuwnDqUWtUIsnBpSFiESThccnJsyW+Ib9WnfY0brOPyyzXPg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795031771;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:
	 Date:Subject:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer:X-Last-TLS-Session-Version;
	bh=Fe6NwmngpGFMvh00hUNwLYVq+WURZ5Qeqr57JlWT/9w=;
	b=S0HzPGd/v4gTj1F/aKwA/FS8W3yJznVmTT7IVk+l7PW5MfuDtojBFGjm0TSGFJerwJIp
	 SMSE6fUkbOhlLKSBfg9+7rsBTGOMaherlf2xc6v459LKqSYKrcHEYDLiVjmvz7PeCaHny
	 0WmoiSk0r4VcicJQu3F6696f6yR2x7zVkL4FgKlepVvTspzteO0nv3qM3F48U6X01+j13
	 5Jg3+qcaDoMh0XkYxKs+u7RXkq87NigyLX3+fnaNRSCvi7pbFBM34kIpfobha0j59L1rI
	 ve8g1uulhZLhlKqLdKSdCgK3wp+H4Vv+eCY2EtcmagwMhWNfgilvaIQHkMAI8dOgueQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=EPXY0pMs;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	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 3ECA360A2621;
	Wed, 18 Nov 2026 19:56:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=EPXY0pMs
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795031770;
	b=kL3kJZJ+Avdw82/4KIZz9l24d7+CZuCScrenEOGJlBQAv/F823fqr5eLf2hTyYH45wDL
	 5L3sMjZjzRUzbKkLD2lJq22v5rZCJDqM2TLm4fTVRy0JJRvgBVBd9t6ylFnyOET0JEw5x
	 a2oIxE0+JIcluFfzaD2f+JnJDZfg1jYj/OT7fdfIjjxs53EmvpUBTzCVnX5dqyObZVstW
	 SbWR08jGpCnBJ2xp8WePds2D1V90wiaS4TfMhIwB/QptnfFwiDLVsLj54ixShWiVkkEC7
	 2ZNFk5Yt+P7RHHY1SaZOzsL0pNQhAdJja/dOrZccU87cFD2z5Tbp7ff9huEdiz/NZ7g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795031770;
	h=DMARC-Filter:Received:DKIM-Signature:From:Date:Subject:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:Message-Id:References:
	 In-Reply-To:To:Cc:X-Mailer:X-Last-TLS-Session-Version;
	bh=Fe6NwmngpGFMvh00hUNwLYVq+WURZ5Qeqr57JlWT/9w=;
	b=OE7fW+u5n2B4ykOIeLXuoD3BH1ubnTiYVb5A5jjbEqk4MfSkWz+VHjDozpotMLjO4kvH
	 z75Z0rXjuNl97BTeUtNYkh1TR1TdBALgRQXZbcmKffB7Fb0esrU9t3UMRMLAFVe5oiopT
	 C88cNfIJaF0KCVhRbv+jVhunX+vhtI3ocU0gG3a131NXE6kp2PtthmtSairs+skxJvLei
	 0iv19Hq/dZk4ARjqawjMxl11hFhKH03wMEGqsPB9myE6f1c5ESz/WhKfDL4JkMdP5Ye/8
	 PeGc/POk+e8mp/7jGkQRtjInyuUMqwrcFVQMRVczJd9u2EyDIaq5UQ3JNuTntj8rsTg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=EPXY0pMs;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFE96606A33E;
	Wed, 18 Nov 2026 19:56:08 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BFE96606A33E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 75221A21D7;
	Wed, 18 Nov 2026 20:56:06 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1795031767; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=Fe6NwmngpGFMvh00hUNwLYVq+WURZ5Qeqr57JlWT/9w=;
	b=EPXY0pMsn7zHc/2CjglYLq8ukmt2LfHl5NHCtsa8+s+KxAfgacRt8czW2orVeabqBkUvCC
	VgNPMGmOXZHW1C/0RTHgcE0u+1ioHEp8M41q5h20RI+uyiGMrvCwMliIgoffGvPir4Zpyu
	Y5Migvphqx5y5TnmfS/zsyRv0v3mnvG+FHWAxxMk09wEjB//3Csp92GhvcuOrd5v+l7+HH
	Fw7lXMD/ryctDrfczzjsLMcrmZE+5/Bbgfkbb37+q9PFzwFs4Ka6lKr4Dq/I8eR5ympU2d
	OdwPoEloFJE10O85rqYljZvM+jGx8kfvU1lEWfsrZp2nDdLfHV5sFtcbXkNt6g==
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
X-In-Reply-To: <20261118-nb-genet-dim-stats-net-v1-0-13b275f1e088@tipi-net.de>
X-Cc: Justin Chen <justin.chen@broadcom.com>, 
 Petri Gynther <pgynther@google.com>, 
 Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>, 
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 
 Florian Fainelli <f.fainelli@gmail.com>
X-Mailer: b4 0.16.0
X-Last-TLS-Session-Version: TLSv1.3