lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <878777925.105015.1763423928520@mail.yahoo.com>
Date: Mon, 17 Nov 2025 23:58:48 +0000 (UTC)
From: Mieczyslaw Nalewaj <namiltd@...oo.com>
To: Netdev <netdev@...r.kernel.org>
Cc: "inus.walleij@...aro.org" <inus.walleij@...aro.org>, 
	"edumazet@...gle.com" <edumazet@...gle.com>, 
	"alsi@...g-olufsen.dk" <alsi@...g-olufsen.dk>, 
	"olteanv@...il.com" <olteanv@...il.com>, 
	"kuba@...nel.org" <kuba@...nel.org>, 
	"pabeni@...hat.com" <pabeni@...hat.com>, 
	"davem@...emloft.net" <davem@...emloft.net>, 
	Andrew Lunn <andrew@...n.ch>
Subject: [PATCH] net: dsa: realtek: rtl8365mb: Do not subtract ifOutDiscards
 from rx_packets

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().

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

diff --git a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c
index 964a56e..af0d84d 100644
--- a/drivers/net/dsa/realtek/rtl8365mb.c
+++ b/drivers/net/dsa/realtek/rtl8365mb.c
@@ -1480,8 +1480,7 @@ static void rtl8365mb_stats_update(struct realtek_priv *priv, int port)
 
     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] +
-- 
2.46.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ