public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets
@ 2026-03-03 20:25 Luiz Angelo Daros de Luca
  2026-03-05 11:16 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Angelo Daros de Luca @ 2026-03-03 20:25 UTC (permalink / raw)
  To: Linus Walleij, Alvin Šipraga, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Florian Fainelli, Michael Rasmussen
  Cc: netdev, linux-kernel, Mieczyslaw Nalewaj,
	Luiz Angelo Daros de Luca

From: Mieczyslaw Nalewaj <namiltd@yahoo.com>

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>
---
I'm taking over the original patch submitted by Mieczyslaw Nalewaj
(with his authorization). The original message is referenced in the
Link tag.
---
 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 c575e164368c..5c094fcafc21 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] +

---
base-commit: ed0abfe93fd135dac223e87a3c945017b1fa8bfc
change-id: 20260303-realtek_namiltd_fix2-f72c45f4c424

Best regards,
-- 
Luiz Angelo Daros de Luca <luizluca@gmail.com>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets
  2026-03-03 20:25 [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets Luiz Angelo Daros de Luca
@ 2026-03-05 11:16 ` Simon Horman
  2026-03-05 12:13 ` Linus Walleij
  2026-03-06  3:24 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2026-03-05 11:16 UTC (permalink / raw)
  To: Luiz Angelo Daros de Luca
  Cc: Linus Walleij, Alvin Šipraga, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Florian Fainelli, Michael Rasmussen, netdev, linux-kernel,
	Mieczyslaw Nalewaj

On Tue, Mar 03, 2026 at 05:25:12PM -0300, Luiz Angelo Daros de Luca wrote:
> From: Mieczyslaw Nalewaj <namiltd@yahoo.com>
> 
> 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>
> ---
> I'm taking over the original patch submitted by Mieczyslaw Nalewaj
> (with his authorization). The original message is referenced in the
> Link tag.

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets
  2026-03-03 20:25 [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets Luiz Angelo Daros de Luca
  2026-03-05 11:16 ` Simon Horman
@ 2026-03-05 12:13 ` Linus Walleij
  2026-03-06  3:24 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2026-03-05 12:13 UTC (permalink / raw)
  To: Luiz Angelo Daros de Luca
  Cc: Alvin Šipraga, Andrew Lunn, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Fainelli,
	Michael Rasmussen, netdev, linux-kernel, Mieczyslaw Nalewaj

On Tue, Mar 3, 2026 at 9:25 PM Luiz Angelo Daros de Luca
<luizluca@gmail.com> wrote:

> From: Mieczyslaw Nalewaj <namiltd@yahoo.com>
>
> 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>

Acked-by: Linus Walleij <linusw@kernel.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets
  2026-03-03 20:25 [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets Luiz Angelo Daros de Luca
  2026-03-05 11:16 ` Simon Horman
  2026-03-05 12:13 ` Linus Walleij
@ 2026-03-06  3:24 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-06  3:24 UTC (permalink / raw)
  To: Luiz Angelo Daros de Luca
  Cc: linusw, alsi, andrew, olteanv, davem, edumazet, kuba, pabeni,
	f.fainelli, mir, netdev, linux-kernel, namiltd

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 03 Mar 2026 17:25:12 -0300 you wrote:
> From: Mieczyslaw Nalewaj <namiltd@yahoo.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets
    https://git.kernel.org/netdev/net/c/f76a93241d71

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-06  3:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-03 20:25 [PATCH net-next] net: dsa: realtek: rtl8365mb: remove ifOutDiscards from rx_packets Luiz Angelo Daros de Luca
2026-03-05 11:16 ` Simon Horman
2026-03-05 12:13 ` Linus Walleij
2026-03-06  3:24 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox