]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ice: initialize ring_stats->syncp
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 20 Nov 2025 20:20:41 +0000 (12:20 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 13 Jan 2026 19:18:05 +0000 (11:18 -0800)
The u64_stats_sync structure is empty on 64-bit systems. However, on 32-bit
systems it contains a seqcount_t which needs to be initialized. While the
memory is zero-initialized, a lack of u64_stats_init means that lockdep
won't get initialized properly. Fix this by adding u64_stats_init() calls
to the rings just after allocation.

Fixes: 2b245cb29421 ("ice: Implement transmit and NAPI support")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_lib.c

index 15621707fbf81b8a64dcc76a8e4149e5bc5fa5df..9ebbe1bff214e09f9f9e22f269b734cfb10b1bc3 100644 (file)
@@ -398,6 +398,8 @@ static int ice_vsi_alloc_ring_stats(struct ice_vsi *vsi)
                        if (!ring_stats)
                                goto err_out;
 
+                       u64_stats_init(&ring_stats->syncp);
+
                        WRITE_ONCE(tx_ring_stats[i], ring_stats);
                }
 
@@ -417,6 +419,8 @@ static int ice_vsi_alloc_ring_stats(struct ice_vsi *vsi)
                        if (!ring_stats)
                                goto err_out;
 
+                       u64_stats_init(&ring_stats->syncp);
+
                        WRITE_ONCE(rx_ring_stats[i], ring_stats);
                }