net: dlink: fix multicast stats being counted incorrectly
Subsystems (2)
PATCH 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.
Tested-on: D-Link DGE-550T Rev-A3
--- drivers/net/ethernet/dlink/dl2k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/dlink/dl2k.c +1 -1
@@ -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
Quoted 9 lines · Yeounsu Moon
McstFramesRcvdOkcounts the number of received multicast packets, and it reports the value correctly.However, reading
McstFramesRcvdOkclears 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.
This looks like a fix. Please could you add a Fixes: tag and submit to net.
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
Andrew
---
pw-bot: cr
Thank you for the review!
I sometimes get confused about whether a patch should go to net or net-next. I will send v2 with the changes you suggested.
Yeounsu Moon