[Intel-wired-lan] [PATCH iwl-next v4 2/6] ice: pass pointer to ice_fetch_u64_stats_per_ring

Jacob Keller jacob.e.keller at intel.com
Wed Dec 3 22:12:52 UTC 2025



On 11/25/2025 2:16 AM, Simon Horman wrote:
> On Thu, Nov 20, 2025 at 12:20:42PM -0800, Jacob Keller wrote:
>> The ice_fetch_u64_stats_per_ring function takes a pointer to the syncp from
>> the ring stats to synchronize reading of the packet stats. It also takes a
>> *copy* of the ice_q_stats fields instead of a pointer to the stats. This
>> completely defeats the point of using the u64_stats API. We pass the stats
>> by value, so they are static at the point of reading within the
>> u64_stats_fetch_retry loop.
>>
>> Simplify the function to take a pointer to the ice_ring_stats instead of
>> two separate parameters. Additionally, since we never call this outside of
>> ice_main.c, make it a static function.
>>
>> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
>> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> 
> The *copy* was certainly working against us here.
> But TBH, C syntax led me to read the code more than
> once before seeing it.
> 

Yes, I had the exact same issue. It took me a while while refactoring to
notice this particular bug...

> Reviewed-by: Simon Horman <horms at kernel.org>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20251203/a5a27ef8/attachment-0001.sig>


More information about the Intel-wired-lan mailing list