public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Mieczyslaw Nalewaj <namiltd@yahoo•com>
To: Jakub Kicinski <kuba@kernel•org>
Cc: "alsi@bang-olufsen•dk" <alsi@bang-olufsen•dk>,
	"olteanv@gmail•com" <olteanv@gmail•com>,
	Andrew Lunn <andrew@lunn•ch>,
	"davem@davemloft•net" <davem@davemloft•net>,
	Eric Dumazet <edumazet@google•com>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	Paolo Abeni <pabeni@redhat•com>
Subject: [PATCH v5] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets
Date: Sun, 4 Jan 2026 18:39:50 +0100	[thread overview]
Message-ID: <09c19b60-a795-4640-90b8-656b3bb3c161@yahoo.com> (raw)
In-Reply-To: <20260104090132.5b1e676e@kernel.org>

rx_packets should report the number of frames successfully received:
unicast + multicast + broadcast. Subtracting ifOutDiscards (a TX
counter) is incorrect and can undercount RX packets. RX drops are
already reported via rx_dropped (e.g. etherStatsDropEvents), so
there is no need to adjust rx_packets.

This patch removes the subtraction of ifOutDiscards from rx_packets
in rtl8365mb_stats_update().

Fixes: 4af2950c50c8 ("net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC")

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo•com>
---
 drivers/net/dsa/realtek/rtl8365mb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/net/dsa/realtek/rtl8365mb.c
+++ b/drivers/net/dsa/realtek/rtl8365mb.c
@@ -2180,8 +2180,7 @@ static void rtl8365mb_stats_update(struc
 
 	stats->rx_packets = cnt[RTL8365MB_MIB_ifInUcastPkts] +
 			    cnt[RTL8365MB_MIB_ifInMulticastPkts] +
-			    cnt[RTL8365MB_MIB_ifInBroadcastPkts] -
-			    cnt[RTL8365MB_MIB_ifOutDiscards];
+			    cnt[RTL8365MB_MIB_ifInBroadcastPkts];
 
 	stats->tx_packets = cnt[RTL8365MB_MIB_ifOutUcastPkts] +
 			    cnt[RTL8365MB_MIB_ifOutMulticastPkts] +


  reply	other threads:[~2026-01-04 17:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2114795695.8721689.1763312184906.ref@mail.yahoo.com>
2025-11-16 16:56 ` [PATCH] net: dsa: realtek: rtl8365mb: fix return value in rtl8365mb_phy_ocp_write Mietek N
2025-11-16 17:18   ` Mietek N
2025-11-16 19:32     ` Andrew Lunn
2025-11-16 20:09       ` Mietek N
2026-01-03 19:12       ` [PATCH v2] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets Mieczyslaw Nalewaj
2026-01-03 19:17     ` [PATCH v3] " Mieczyslaw Nalewaj
2026-01-04 15:31       ` Jakub Kicinski
2026-01-04 15:54         ` [PATCH v4] " Mieczyslaw Nalewaj
2026-01-04 17:01           ` Jakub Kicinski
2026-01-04 17:39             ` Mieczyslaw Nalewaj [this message]
2026-01-04 17:52               ` [PATCH v5] " Jakub Kicinski
2026-01-05  8:35                 ` Mieczyslaw Nalewaj
2026-01-05 14:23                   ` Andrew Lunn
2026-01-04 11:25     ` [PATCH] net: dsa: realtek: rtl8365mb: fix return value in rtl8365mb_phy_ocp_write Mieczyslaw Nalewaj
2026-01-04 21:11       ` Andrew Lunn

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=09c19b60-a795-4640-90b8-656b3bb3c161@yahoo.com \
    --to=namiltd@yahoo$(echo .)com \
    --cc=alsi@bang-olufsen$(echo .)dk \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=olteanv@gmail$(echo .)com \
    --cc=pabeni@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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