Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: dsa: realtek: rtl8365mb: remove 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().

Link: https://lore.kernel.org/netdev/878777925.105015.1763423928520@mail.yahoo.com/
Fixes: 4af2950c50c8 ("net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC")
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260303-realtek_namiltd_fix2-v1-1-bfa433d3401e@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Mieczyslaw Nalewaj and committed by
Jakub Kicinski
f76a9324 abacaf55

+1 -2
+1 -2
drivers/net/dsa/realtek/rtl8365mb.c
··· 1480 1480 1481 1481 stats->rx_packets = cnt[RTL8365MB_MIB_ifInUcastPkts] + 1482 1482 cnt[RTL8365MB_MIB_ifInMulticastPkts] + 1483 - cnt[RTL8365MB_MIB_ifInBroadcastPkts] - 1484 - cnt[RTL8365MB_MIB_ifOutDiscards]; 1483 + cnt[RTL8365MB_MIB_ifInBroadcastPkts]; 1485 1484 1486 1485 stats->tx_packets = cnt[RTL8365MB_MIB_ifOutUcastPkts] + 1487 1486 cnt[RTL8365MB_MIB_ifOutMulticastPkts] +