Article View: linux.kernel.netdev
Article #18732[PATCH net 3/4] net: bcmgenet: reset the Rx discard count with the ring
From: Nicolai Buchwitz
Date: Wed, 18 Nov 2026 19:55
Date: Wed, 18 Nov 2026 19:55
30 lines
9501 bytes
9501 bytes
Ring init clears the hardware discard counter but not
ring->old_discards. Discards after an ifdown and ifup or a resume are
then missing from rx_missed. On a CM4, after an ifdown and ifup, 3666
discards showed up as 0 in rx_missed.
Reset old_discards together with the ring.
Fixes: d26ea6cc48da ("net: bcmgenet: collect Rx discarded packet count")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 96620d298677..69c6139d3b23 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2825,6 +2825,8 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
ring->read_ptr = start_ptr;
ring->cb_ptr = start_ptr;
ring->end_ptr = end_ptr - 1;
+ /* Zeroing RDMA_PROD_INDEX below also clears the discard counter */
+ ring->old_discards = 0;
ret = bcmgenet_rx_ring_create_pool(priv, ring);
if (ret)
--
2.53.0
Technical Details
Message-ID:
<20261118-nb-genet-dim-stats-net-v1-3-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-366410-linux-kernel-netdev=dewy.ruReferences:
<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-366410-linux-kernel-netdev=dewy.ru From: nb@tipi-net.de (Nicolai Buchwitz) Newsgroups: linux.kernel.netdev Subject: [PATCH net 3/4] net: bcmgenet: reset the Rx discard count with the ring Date: Wed, 18 Nov 2026 20:55:32 +0100 Organization: Usenet Network Message-ID: <20261118-nb-genet-dim-stats-net-v1-3-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="2686175"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:RAhl7RKccrlBe2AKuH03fpYhuuM= sha256:RUd7oKoJLEAWkUPa1gjhsY/X7E9JekKLOnNV7w8WDkU= sha1:5U5PzD9Fg3qnrlrXmhzFXfjh1v8= sha256:duDYB9h6tOKxSAO/hJb5tkzSaPvaBoOBRF31Hz372n4= 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 EEEDB1153C0; Wed, 18 Nov 2026 22:56:37 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.15 X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31 tests=[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, URIBL_BLOCKED=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 ct2GmsgpKdE8; Wed, 18 Nov 2026 22:56:35 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-366410-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 07DA31153BE; Wed, 18 Nov 2026 22:56:26 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 635EB6A515B; Wed, 18 Nov 2026 19:56:25 +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=1795031776; b=UMGYKcB2IbUS7T/JLDvn6cn3nvYPhFaH0qxwRjusjtH4TwUP78sEDoBY3Y5zJDaa7ppe yA08WsqLpFfMGHWqO0R1Cl9b4kX9d4BJkPb7r1M7DGE7tW6uuudLncea05QWPEOOupik7 +zVR1S1beFfu1ulEvvvlxuU8rAmH21GOMsd2vFWPZTS5HpQJxJyq+qBE1Fgdz0yaHLmqJ YQ96alF3x26rwRESZ7hDT4xk70sd+wqf4USlHpq6EOecc2eM6BkJT3pASZF8h+RERy3DW ZQVTt+spuVGsnilo0hYSCJmyh47gjrybi90PszqDevaGmA9irvgToU2ICclA6AzuEpA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795031776; 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=PQA+eM2ZmuP8sZzf49+j1vbkc1r7w3BDX+sdyod5IDQ=; b=e8iWK3jB7ZxNQglKnEyLRp09r3caDlpEm1flRiIEmLh3LN43Lref9EBfgIWwXS/ijRwS QMGnKYZQEy1myr1znZC8QvPyOgHz52iTNsTrHO5r+enYb9UdtaDpODGHNhj3dMUOkhYkl 9imLwbbXwmSXpmVU1rXcXKXRh1zVkI/IXtfe6Sew90KEURw2xtUxBx75oq1psF9/g28bf wGvIcdktowkphva9HXGkgZ2hfAN0xMJQN9BOx4ddm59VpctQgNmoYjID/OBckKxX8+6xI qBGelumopAJCQ6inkVPisq4D+aizKKL+qpBUeWOFDuU5ALag4MCFo1cnRvfga/JZUUA== 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=Vj9J7p2l; 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 4E6A5606A336; Wed, 18 Nov 2026 19:56:16 +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=Vj9J7p2l 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=n/KcVEDi6OI6baI4rmpcRy1kWLdbfvnn6kYv3f3EI6wWMjg7XDR5yGHR9wZw+wbc0n2X 5dawtawTrmKWLb7Da2ZbRPpy8EsPctRf9nILfi9MYf6ge180zStwkMETuT70L7rVpA2vP /bO/iDn6bOJX99yHa+Mzy05RtompNR9GKxgBi7/lHokRNNrokOGF46LhN3w/l9jxRYYOe UQhI+vLXg8o15TQHwaewzj1KHYDWl64bhKS1jzZVj7NbucnB6Os1rJ0eIixBZUjUlZsJy 5HBbHyiux8gL4cLegz5hnMK6h+jkp8KZWKvUct2Kq8ihX2OVRpsRAD2obidDJ1J6xWg== 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=PQA+eM2ZmuP8sZzf49+j1vbkc1r7w3BDX+sdyod5IDQ=; b=J+ufOQaHhwdwHVdfQFK2AkfauC6dGO0gY0JzbF2SmS5W8QlY9RpmqcnftLOHIKWD96eS jhZwTGq6Hv8mk340yOH9bOxPpKfIt1r2EbJhUMQt9n4mJRv62Jd7yK1CH21e7JBxeQBmj XLcoUV/QsI9FyoxAsc1g3yf6WTbcoky01wAwMs3QOl8IpaTFygv6+olZ6UdXezS3keSD3 7BoZYPv1D7wVBhjtbSbpOFUuiSUldI7yBFIApfMfQPTnnsMY7cfXgOCd5E9h1By4TNfuK 9Omxg+Z1C85mExfyQFT/RbJhNGnoeqHsxO6ByM1gwXROMf/4eQQQid/eeoxUnepwn1Q== 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=Vj9J7p2l; 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)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3084606A333; Wed, 18 Nov 2026 19:56:09 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F3084606A333 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 D1C81A2320; Wed, 18 Nov 2026 20:56:07 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim; t=1795031768; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=PQA+eM2ZmuP8sZzf49+j1vbkc1r7w3BDX+sdyod5IDQ=; b=Vj9J7p2lvAcVOjdQXav1RIqtuR9IHNDI2+1WkPeu3joy3UiPXJt8/Ei8y9BLfJkGa8rA9T llmGUXdTcWDwgKLLpbEMMsSjIXJTYp9ioPtp8UuXBWgnZOcjBJGCxa9oHr/bx8ppHj89yE scWAg6Xgjtcp5NkUpJ122YGaqzCUsgVihL6KWY4L/T/6TPLvbrL7hwyOCajH8MBIUKOjdc mf1kdMNVfTsXzGcDDV6KY8NJ/ZApW+2ihVplPxLWO8OcJ5AdwNyxUliugW3fXGuvaXu8cm xtzedm7503upPQ5GxP+me5B3KfzPs3CbOQBQFcJiyZgmkOvIh8G7aPJ0n1gaWg== 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