[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709182339.GJ721198@horms.kernel.org>
Date: Wed, 9 Jul 2025 19:23:39 +0100
From: Simon Horman <horms@...nel.org>
To: Mingming Cao <mmc@...ux.ibm.com>
Cc: netdev@...r.kernel.org, kuba@...nel.org, nnac123@...ux.ibm.com,
bjking1@...ux.ibm.com, haren@...ux.ibm.com, ricklind@...ux.ibm.com,
davemarq@...ux.ibm.com
Subject: Re: [PATCH net] ibmvnic: Fix hardcoded NUM_RX_STATS/NUM_TX_STATS
with dynamic sizeof
On Wed, Jul 09, 2025 at 08:33:32AM -0700, Mingming Cao wrote:
> The previous hardcoded definitions of NUM_RX_STATS and
> NUM_TX_STATS were not updated when new fields were added
> to the ibmvnic_{rx,tx}_queue_stats structures. Specifically,
> commit 2ee73c54a615 ("ibmvnic: Add stat for tx direct vs tx
> batched") added a fourth TX stat, but NUM_TX_STATS remained 3,
> leading to a mismatch.
>
> This patch replaces the static defines with dynamic sizeof-based
> calculations to ensure the stat arrays are correctly sized.
> This fixes incorrect indexing and prevents incomplete stat
> reporting in tools like ethtool.
>
> Fixes: 2ee73c54a615 ("ibmvnic: Add stat for tx direct vs tx batched")
> Signed-off-by: Mingming Cao <mmc@...ux.ibm.com>
> Reviewed-by: Dave Marquardt <davemarq@...ux.ibm.com>
> Reviewed-by: Haren Myneni <haren@...ux.ibm.com>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists