intel-wired-lan.osuosl.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	 Alexander Lobakin <aleksander.lobakin@intel.com>,
	 Tony Nguyen <anthony.l.nguyen@intel.com>,
	 Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	 Jacob Keller <jacob.e.keller@intel.com>
Subject: [Intel-wired-lan] [PATCH iwl-next 1/9] ice: initialize ring_stats->syncp
Date: Mon, 03 Nov 2025 17:06:46 -0800	[thread overview]
Message-ID: <20251103-jk-refactor-queue-stats-v1-1-164d2ed859b6@intel.com> (raw)
In-Reply-To: <20251103-jk-refactor-queue-stats-v1-0-164d2ed859b6@intel.com>

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")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_lib.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index bac481e8140d..e7265e877703 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -398,7 +398,10 @@ 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);
+
 		}
 
 		ring->ring_stats = ring_stats;
@@ -417,6 +420,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);
 		}
 

-- 
2.51.0.rc1.197.g6d975e95c9d7


  reply	other threads:[~2025-11-04  1:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-04  1:06 [Intel-wired-lan] [PATCH iwl-next 0/9] ice: properly use u64_stats API for all ring stats Jacob Keller
2025-11-04  1:06 ` Jacob Keller [this message]
2025-11-04  7:22   ` [Intel-wired-lan] [PATCH iwl-next 1/9] ice: initialize ring_stats->syncp Loktionov, Aleksandr
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 2/9] ice: use cacheline groups for ice_rx_ring structure Jacob Keller
2025-11-04  7:23   ` Loktionov, Aleksandr
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 3/9] ice: use cacheline groups for ice_tx_ring structure Jacob Keller
2025-11-04  7:30   ` Loktionov, Aleksandr
2025-11-04 18:40     ` Jacob Keller
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 4/9] ice: move prev_pkt from ice_txq_stats to ice_tx_ring Jacob Keller
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 5/9] ice: pass pointer to ice_fetch_u64_stats_per_ring Jacob Keller
2025-11-04  7:23   ` Loktionov, Aleksandr
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 6/9] ice: remove ice_q_stats struct and use struct_group Jacob Keller
2025-11-04  7:24   ` Loktionov, Aleksandr
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 7/9] ice: use u64_stats API to access pkts/bytes in dim sample Jacob Keller
2025-11-04  7:24   ` Loktionov, Aleksandr
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 8/9] ice: shorten ring stat names and add accessors Jacob Keller
2025-11-04  7:29   ` Loktionov, Aleksandr
2025-11-04  1:06 ` [Intel-wired-lan] [PATCH iwl-next 9/9] ice: convert all ring stats to u64_stats_t Jacob Keller
2025-11-04  7:25   ` Loktionov, Aleksandr
2025-11-04  7:27 ` [Intel-wired-lan] [PATCH iwl-next 0/9] ice: properly use u64_stats API for all ring stats Loktionov, Aleksandr
2025-11-04 18:45   ` Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251103-jk-refactor-queue-stats-v1-1-164d2ed859b6@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).