[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240529071736.224973-1-karen.ostrowska@intel.com>
Date: Wed, 29 May 2024 09:17:36 +0200
From: Karen Ostrowska <karen.ostrowska@...el.com>
To: intel-wired-lan@...ts.osuosl.org
Cc: netdev@...r.kernel.org,
Jan Sokolowski <jan.sokolowski@...el.com>,
Wojciech Drewek <wojciech.drewek@...el.com>,
Karen Ostrowska <karen.ostrowska@...el.com>
Subject: [PATCH iwl-net v1] ice: Rebuild TC queues on VSI queue reconfiguration
From: Jan Sokolowski <jan.sokolowski@...el.com>
TC queues needs to be correctly updated when the number of queues on
a VSI is reconfigured, so netdev's queue and TC settings will be
dynamically adjusted and could accurately represent the underlying
hardware state after changes to the VSI queue counts.
Fixes: 0754d65bd4be ("ice: Add infrastructure for mqprio support via ndo_setup_tc")
Reviewed-by: Wojciech Drewek <wojciech.drewek@...el.com>
Signed-off-by: Jan Sokolowski <jan.sokolowski@...el.com>
Signed-off-by: Karen Ostrowska <karen.ostrowska@...el.com>
---
drivers/net/ethernet/intel/ice/ice_main.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 1b61ca3a6eb6..a1798ec4d904 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -4136,7 +4136,7 @@ bool ice_is_wol_supported(struct ice_hw *hw)
int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)
{
struct ice_pf *pf = vsi->back;
- int err = 0, timeout = 50;
+ int i, err = 0, timeout = 50;
if (!new_rx && !new_tx)
return -EINVAL;
@@ -4162,6 +4162,14 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)
ice_vsi_close(vsi);
ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
+
+ ice_for_each_traffic_class(i) {
+ if (vsi->tc_cfg.ena_tc & BIT(i))
+ netdev_set_tc_queue(vsi->netdev,
+ vsi->tc_cfg.tc_info[i].netdev_tc,
+ vsi->tc_cfg.tc_info[i].qcount_tx,
+ vsi->tc_cfg.tc_info[i].qoffset);
+ }
ice_pf_dcb_recfg(pf, locked);
ice_vsi_open(vsi);
done:
--
2.31.1
Powered by blists - more mailing lists