linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: macb: Fix offset error in gem_update_stats
@ 2025-08-25 17:21 Sean Anderson
  2025-08-27  0:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Anderson @ 2025-08-25 17:21 UTC (permalink / raw)
  To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev
  Cc: Claudiu Beznea, Nicolas Ferre, linux-kernel, Sean Anderson

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

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Fixes: f6af690a295a ("net: cadence: macb: Report standard stats")
---

 drivers/net/ethernet/cadence/macb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index b29c3beae0b2..106885451147 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -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;
 		}
 	}
 
-- 
2.35.1.1320.gc452695387.dirty


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: macb: Fix offset error in gem_update_stats
  2025-08-25 17:21 [PATCH net] net: macb: Fix offset error in gem_update_stats Sean Anderson
@ 2025-08-27  0:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-27  0:50 UTC (permalink / raw)
  To: Sean Anderson
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	claudiu.beznea, nicolas.ferre, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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).
> 
> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
> 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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-27  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-25 17:21 [PATCH net] net: macb: Fix offset error in gem_update_stats Sean Anderson
2025-08-27  0:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).