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: 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
Signed-off-by: Yeounsu Moon <yyyynoom@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250823182927.6063-3-yyyynoom@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yeounsu Moon and committed by
Jakub Kicinski
007a5ffa 97766512

+1 -1
+1 -1
drivers/net/ethernet/dlink/dl2k.c
··· 1099 1099 dev->stats.rx_bytes += dr32(OctetRcvOk); 1100 1100 dev->stats.tx_bytes += dr32(OctetXmtOk); 1101 1101 1102 - dev->stats.multicast = dr32(McstFramesRcvdOk); 1102 + dev->stats.multicast += dr32(McstFramesRcvdOk); 1103 1103 dev->stats.collisions += dr32(SingleColFrames) 1104 1104 + dr32(MultiColFrames); 1105 1105