Thread (31 messages) 31 messages, 3 authors, 8d ago

RE: [PATCH iwl-net 04/10] ice: restore the default XPS map after a netdev TC change

flat view

From: Loktionov, Aleksandr <hidden>
Date: 2026-10-05 10:25:25
Also in: bpf, intel-wired-lan, lkml

quoted hunk ↗ jump to hunk
-----Original Message-----
From: Petr Oros <redacted>
Sent: Friday, October 2, 2026 3:08 PM
To: netdev@vger.kernel.org
Cc: Oros, Petr <redacted>; Nguyen, Anthony L
[off-list ref]; Kitszel, Przemyslaw
[off-list ref]; Andrew Lunn [off-list ref];
David S. Miller [off-list ref]; Eric Dumazet
[off-list ref]; Jakub Kicinski [off-list ref]; Paolo Abeni
[off-list ref]; Lobakin, Aleksander
[off-list ref]; Alexei Starovoitov [off-list ref];
Daniel Borkmann [off-list ref]; Jesper Dangaard Brouer
[off-list ref]; John Fastabend [off-list ref];
Stanislav Fomichev [off-list ref]; Henry Tieman
[off-list ref]; Anirudh Venkataramanan
[off-list ref]; Michal Swiatkowski
[off-list ref]; Jesse Brandeburg
[off-list ref]; Preethi Banala [off-list ref];
Kiran Patil [off-list ref]; Dan Nowlin
[off-list ref]; Stephen Hemminger
[off-list ref]; intel-wired-lan@lists.osuosl.org; linux-
kernel@vger.kernel.org; bpf@vger.kernel.org
Subject: [PATCH iwl-net 04/10] ice: restore the default XPS map after
a netdev TC change

ice_cfg_xps_tx_ring() programs the default XPS map only once per ring,
guarded by ICE_TX_XPS_INIT_DONE. netdev_reset_tc() and
netdev_set_num_tc() drop all XPS maps of the device, but the bit is
never cleared, so the default map is not programmed again.

Since commit 122045ca7704 ("ice: config netdev tc before setting
queues
number") ice_vsi_open() calls ice_vsi_cfg_netdev_tc() after the Tx
queues have been configured, so the map is wiped right after it was
written on every open and stays empty:

  # cat /sys/class/net/enp4s0f0np0/queues/tx-*/xps_cpus
  0000
  0000
  ...

A DCB reconfiguration ends the same way through ice_vsi_cfg_tc().

Clear ICE_TX_XPS_INIT_DONE in ice_vsi_cfg_netdev_tc(), which resets
the netdev TC state, and configure the netdev TCs in ice_vsi_open()
before the Tx queues so the default map is applied after the reset,
not before it.

i40e fixed the same stale bit in commit 82e0572b2302 ("i40e: Fix not
setting default xps_cpus after reset").

Fixes: 122045ca7704 ("ice: config netdev tc before setting queues
number")
Assisted-by: LLM
Signed-off-by: Petr Oros <redacted>
---
 drivers/net/ethernet/intel/ice/ice_lib.c  | 6 ++++++
drivers/net/ethernet/intel/ice/ice_main.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c
b/drivers/net/ethernet/intel/ice/ice_lib.c
index 5e183314e0d792..416e2d6a6f1709 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -3218,6 +3218,12 @@ void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi,
u8 ena_tc)
 	if (vsi->type == ICE_VSI_CHNL)
 		return;

+	if (vsi->tx_rings)
+		ice_for_each_txq(vsi, i)
+			if (vsi->tx_rings[i])
+				clear_bit(ICE_TX_XPS_INIT_DONE,
+					  vsi->tx_rings[i]->xps_state);
+
 	if (!ena_tc) {
 		netdev_reset_tc(netdev);
 		return;
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
b/drivers/net/ethernet/intel/ice/ice_main.c
index e62a8f544345a3..8a21f87eb6ca21 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -7559,6 +7559,9 @@ int ice_vsi_open(struct ice_vsi *vsi)
 	if (err)
 		goto err_setup_rx;

+	if (bitmap_empty(pf->txtime_txqs, pf->max_pf_txqs))
+		ice_vsi_cfg_netdev_tc(vsi, vsi->tc_cfg.ena_tc);
+
 	err = ice_vsi_cfg_lan(vsi);
 	if (err)
 		goto err_stop_tx;
@@ -7569,9 +7572,6 @@ int ice_vsi_open(struct ice_vsi *vsi)
 	if (err)
 		goto err_stop_tx;

-	if (bitmap_empty(pf->txtime_txqs, pf->max_pf_txqs))
-		ice_vsi_cfg_netdev_tc(vsi, vsi->tc_cfg.ena_tc);
-
 	if (vsi->type == ICE_VSI_PF || vsi->type == ICE_VSI_SF) {
 		/* Notify the stack of the actual queue counts. */
 		err = netif_set_real_num_tx_queues(vsi->netdev, vsi-
quoted
num_txq);
--
2.55.0
Reviewed-by: Aleksandr Loktionov <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help