Commit 8439016c authored by Jacob Keller's avatar Jacob Keller Committed by Tony Nguyen
Browse files

ice: initialize ring_stats->syncp



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: 2b245cb2 ("ice: Implement transmit and NAPI support")
Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent ffe4ccd3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);
		}