Netdev List
 help / color / mirror / Atom feed
From: Ivan Vecera <ivecera@redhat.com>
To: intel-wired-lan@osuosl.org, Petr Oros <poros@redhat.com>,
	netdev@vger.kernel.org
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Henry Tieman <henry.w.tieman@intel.com>,
	Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>,
	Michal Swiatkowski <michal.swiatkowski@linux.intel.com>,
	Jesse Brandeburg <jbrandeb@kernel.org>,
	Preethi Banala <preethi.banala@intel.com>,
	Kiran Patil <kiran.patil@intel.com>,
	Dan Nowlin <dan.nowlin@intel.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org
Subject: Re: [PATCH iwl-net 04/10] ice: restore the default XPS map after a netdev TC change
Date: Sat, 03 Oct 2026 11:55:06 +0200	[thread overview]
Message-ID: <83677D09-EC66-48A1-94CA-6DE008FE1AE5@redhat.com> (raw)
In-Reply-To: <20261002130752.2597259-5-poros@redhat.com>

On October 2, 2026 3:07:46 PM GMT+02:00, Petr Oros <poros@redhat.com> wrote:
>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 <poros@redhat.com>
>---
> 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->num_txq);

Reviewed-by: Ivan Vecera <ivecera@redhat.com>


  reply	other threads:[~2026-10-03  9:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 13:07 [PATCH iwl-net 00/10] ice: port missing i40e fixes Petr Oros
2026-10-02 13:07 ` [PATCH iwl-net 01/10] ice: replay UDP tunnel ports after a core or global reset Petr Oros
2026-10-03  9:52   ` Ivan Vecera
2026-10-05 10:24   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 02/10] ice: fix IRQ freeing in ice_vsi_req_irq_msix() error path Petr Oros
2026-10-03  9:53   ` Ivan Vecera
2026-10-05 10:24   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 03/10] ice: stop the LAN Tx queues when ice_vsi_open() fails Petr Oros
2026-10-03  9:54   ` Ivan Vecera
2026-10-05 12:03     ` Petr Oros
2026-10-02 13:07 ` [PATCH iwl-net 04/10] ice: restore the default XPS map after a netdev TC change Petr Oros
2026-10-03  9:55   ` Ivan Vecera [this message]
2026-10-05 10:25   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 05/10] ice: report VF tx_dropped with tx_errors instead of tx_discards Petr Oros
2026-10-03  9:55   ` Ivan Vecera
2026-10-05 10:26   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 06/10] ice: keep adding MAC filters after one that already exists Petr Oros
2026-10-03  9:55   ` Ivan Vecera
2026-10-05 10:26   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 07/10] ice: take the switch rule AQ error from the response descriptor Petr Oros
2026-10-03  9:55   ` Ivan Vecera
2026-10-05 10:27   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 08/10] ice: detect a PF reset that does not complete Petr Oros
2026-10-03  9:55   ` Ivan Vecera
2026-10-05 10:27   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 09/10] ice: program multicast magic wake before tearing down the main VSI Petr Oros
2026-10-03  9:56   ` Ivan Vecera
2026-10-05 10:27   ` Loktionov, Aleksandr
2026-10-02 13:07 ` [PATCH iwl-net 10/10] ice: fix unsigned stat widths Petr Oros
2026-10-02 13:12   ` Loktionov, Aleksandr
2026-10-03  9:56   ` Ivan Vecera

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=83677D09-EC66-48A1-94CA-6DE008FE1AE5@redhat.com \
    --to=ivecera@redhat.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=dan.nowlin@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=henry.w.tieman@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=intel-wired-lan@osuosl.org \
    --cc=jbrandeb@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kiran.patil@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=poros@redhat.com \
    --cc=preethi.banala@intel.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sdf@fomichev.me \
    --cc=stephen@networkplumber.org \
    /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