Skip to content

Commit ba82313

Browse files
Cruzer-Sgregkh
authored andcommitted
net: dlink: fix multicast stats being counted incorrectly
[ Upstream commit 007a5ff ] `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: 1da177e ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 43fc5da commit ba82313

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/dlink/dl2k.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ get_stats (struct net_device *dev)
10911091
dev->stats.rx_bytes += dr32(OctetRcvOk);
10921092
dev->stats.tx_bytes += dr32(OctetXmtOk);
10931093

1094-
dev->stats.multicast = dr32(McstFramesRcvdOk);
1094+
dev->stats.multicast += dr32(McstFramesRcvdOk);
10951095
dev->stats.collisions += dr32(SingleColFrames)
10961096
+ dr32(MultiColFrames);
10971097

0 commit comments

Comments
 (0)