Skip to contentSkip to conversation

net: macb: Fix offset error in gem_update_stats

PATCH Applied Sean Anderson 2 participants 2 messages Aug 25, 2025 – Aug 27, 2025

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

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).

Fixes f6af690a295a ("net: cadence: macb: Report standard 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
index b29c3beae0b2..106885451147 100644
@@ -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
#1 lore raw
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_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).

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