net: macb: Fix offset error in gem_update_stats
Subsystems (3)
PATCH 1/1 net: macb: Fix offset error in gem_update_stats
hw_stats now has only one variable for tx_octets/rx_octets, so we should only increment p once, not twice. This would cause the statistics to be reported under the wrong categories in ethtool -S --all-groups (which uses hw_stats) but not ethtool -S (which uses ethtool_stats).
---
drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +1 -1
@@ -3090,7 +3090,7 @@ static void gem_update_stats(struct macb *bp)/* Add GEM_OCTTXH, GEM_OCTRXH */ val = bp->macb_reg_readl (bp, offset +4 ); bp->ethtool_stats[i] += ((u64 )val) <<32 ; - *(p++) += ((u64 )val) <<32 ; + *p += ((u64 )val) <<32 ; } }
Signature · 1 line
2.35.1.1320.gc452695387.dirty
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 9 lines · On Mon, 25 Aug 2025 13:21:34 -0400 you wrote:
hw_statsnow has only one variable for tx_octets/rx_octets, so we should only increment p once, not twice. This would cause the statistics to be reported under the wrong categories inethtool -S --all-groups(which useshw_stats) but notethtool -S(which usesethtool_stats).Signed-off-by Sean Anderson <[email protected]>Fixes f6af690a295a ("net: cadence: macb: Report standard stats")[...]
Here is the summary with links:
- [net] net: macb: Fix offset error in gem_update_stats
https://git.kernel.org/netdev/net/c/16c8a3a67ec7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html