net: dsa: realtek: rtl8365mb: Do not subtract ifOutDiscards from rx_packets
PATCH 1/1 net: dsa: realtek: rtl8365mb: Do not subtract ifOutDiscards from rx_packets
In reply to a message not in the archiverx_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().
---
drivers/net/dsa/realtek/rtl8365mb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/dsa/realtek/rtl8365mb.c +0 -0
@@ -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
Andrew Lunn
maintainerQuoted 8 lines · Mieczyslaw Nalewaj
rx_packetsshould 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 viarx_dropped(e.g. etherStatsDropEvents), so there is no need to adjustrx_packets.This patch removes the subtraction of ifOutDiscards from
rx_packetsinrtl8365mb_stats_update().
It does look like a cut/paste error of some sort.
Please could you figure out a Fixes: tag, and submit this to net.
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
Andrew
---
pw-bot: cr
I can't pinpoint the commit that caused this error. The file's history on GitHub starts on October 18, 2021, and this error is already occurring.
W wtorek, 18 listopada 2025 17:55:26 CET, Andrew Lunn <[email protected]> napisał(-a):
Quoted 8 lines · Mieczyslaw Nalewaj
rx_packetsshould 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 viarx_dropped(e.g. etherStatsDropEvents), so there is no need to adjustrx_packets.This patch removes the subtraction of ifOutDiscards from
rx_packetsinrtl8365mb_stats_update().
It does look like a cut/paste error of some sort.
Please could you figure out a Fixes: tag, and submit this to net.
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
Andrew
---
pw-bot: cr
Andrew Lunn
maintainerQuoted 1 line · Mieczyslaw Nalewaj
I can't pinpoint the commit that caused this error. The file's history on GitHub starts on October 18, 2021, and this error is already occurring.
Please don't top post.
commit 4af2950c50c8634ed2865cf81e607034f78b84aa
Author: Alvin Šipraga <[email protected]> Date: Mon Oct 18 11:38:01 2021 +0200
net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC
Does appear to suggest it was always broken. So use that for the
Fixes: tag.
Andrew