Skip to contentSkip to conversation

net: dlink: fix multicast stats being counted incorrectly

PATCH Applied Yeounsu Moon 3 participants 3 messages Aug 23, 2025 – Aug 26, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: dlink: fix multicast stats being counted incorrectly

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

---
Changelog:
v1: https://lore.kernel.org/netdev/[email protected]/
v2: https://lore.kernel.org/netdev/[email protected]/
- 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(-)
drivers/net/ethernet/dlink/dl2k.c +1 -1
index cc60ee454bf9..6bbf6e5584e5 100644
@@ -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);
 
Signature · 1 line
2.50.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 7 lines · Yeounsu Moon

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.

Quoted 6 lines

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

Andrew

#2 lore raw
In reply to Yeounsu Moon
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · 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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html