public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v3] net: dlink: fix multicast stats being counted incorrectly
@ 2025-08-23 18:29 Yeounsu Moon
  2025-08-23 18:45 ` Andrew Lunn
  2025-08-26  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yeounsu Moon @ 2025-08-23 18:29 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni
  Cc: Yeounsu Moon, netdev, linux-kernel

`McstFramesRcvdOk` counts the number of received multicast packets, and
it reports the value correctly.

However, reading `McstFramesRcvdOk` clears the register to zero. As a
result, the driver was reporting only the packets since the last read,
instead of the accumulated total.

Fix this by updating the multicast statistics accumulatively instaed of
instantaneously.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Tested-on: D-Link DGE-550T Rev-A3
Signed-off-by: Yeounsu Moon <yyyynoom@gmail.com>
---
Changelog:
v1: https://lore.kernel.org/netdev/20250821114254.3384-1-yyyynoom@gmail.com/
v2: https://lore.kernel.org/netdev/20250822120246.243898-2-yyyynoom@gmail.com/
- Change subject `net-next` to `net`.
- Add `Fixes:` tag.
v3:
- Correct commit reference in `Fixes:` tag.
---
 drivers/net/ethernet/dlink/dl2k.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c
index cc60ee454bf9..6bbf6e5584e5 100644
--- a/drivers/net/ethernet/dlink/dl2k.c
+++ b/drivers/net/ethernet/dlink/dl2k.c
@@ -1099,7 +1099,7 @@ get_stats (struct net_device *dev)
 	dev->stats.rx_bytes += dr32(OctetRcvOk);
 	dev->stats.tx_bytes += dr32(OctetXmtOk);
 
-	dev->stats.multicast = dr32(McstFramesRcvdOk);
+	dev->stats.multicast += dr32(McstFramesRcvdOk);
 	dev->stats.collisions += dr32(SingleColFrames)
 			     +  dr32(MultiColFrames);
 
-- 
2.50.1


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

* Re: [PATCH net v3] net: dlink: fix multicast stats being counted incorrectly
  2025-08-23 18:29 [PATCH net v3] net: dlink: fix multicast stats being counted incorrectly Yeounsu Moon
@ 2025-08-23 18:45 ` Andrew Lunn
  2025-08-26  0:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2025-08-23 18:45 UTC (permalink / raw)
  To: Yeounsu Moon
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel

On Sun, Aug 24, 2025 at 03:29:24AM +0900, Yeounsu Moon wrote:
> `McstFramesRcvdOk` counts the number of received multicast packets, and
> it reports the value correctly.
> 
> However, reading `McstFramesRcvdOk` clears the register to zero. As a
> result, the driver was reporting only the packets since the last read,
> instead of the accumulated total.
> 
> Fix this by updating the multicast statistics accumulatively instaed of
> instantaneously.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Tested-on: D-Link DGE-550T Rev-A3
> Signed-off-by: Yeounsu Moon <yyyynoom@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net v3] net: dlink: fix multicast stats being counted incorrectly
  2025-08-23 18:29 [PATCH net v3] net: dlink: fix multicast stats being counted incorrectly Yeounsu Moon
  2025-08-23 18:45 ` Andrew Lunn
@ 2025-08-26  0:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-26  0:30 UTC (permalink / raw)
  To: Yeounsu Moon
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel

Hello:

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

On Sun, 24 Aug 2025 03:29:24 +0900 you wrote:
> `McstFramesRcvdOk` counts the number of received multicast packets, and
> it reports the value correctly.
> 
> However, reading `McstFramesRcvdOk` clears the register to zero. As a
> result, the driver was reporting only the packets since the last read,
> instead of the accumulated total.
> 
> [...]

Here is the summary with links:
  - [net,v3] net: dlink: fix multicast stats being counted incorrectly
    https://git.kernel.org/netdev/net/c/007a5ffadc4f

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] 3+ messages in thread

end of thread, other threads:[~2025-08-26  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-23 18:29 [PATCH net v3] net: dlink: fix multicast stats being counted incorrectly Yeounsu Moon
2025-08-23 18:45 ` Andrew Lunn
2025-08-26  0:30 ` 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