Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: Rebuild TC queues on VSI queue reconfiguration

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@intel.com>
Signed-off-by: Jan Sokolowski <jan.sokolowski@intel.com>
Signed-off-by: Karen Ostrowska <karen.ostrowska@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jan Sokolowski and committed by
David S. Miller
f4b91c1d 8a67cbd4

+9 -1
+9 -1
drivers/net/ethernet/intel/ice/ice_main.c
··· 4139 4139 int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked) 4140 4140 { 4141 4141 struct ice_pf *pf = vsi->back; 4142 - int err = 0, timeout = 50; 4142 + int i, err = 0, timeout = 50; 4143 4143 4144 4144 if (!new_rx && !new_tx) 4145 4145 return -EINVAL; ··· 4165 4165 4166 4166 ice_vsi_close(vsi); 4167 4167 ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT); 4168 + 4169 + ice_for_each_traffic_class(i) { 4170 + if (vsi->tc_cfg.ena_tc & BIT(i)) 4171 + netdev_set_tc_queue(vsi->netdev, 4172 + vsi->tc_cfg.tc_info[i].netdev_tc, 4173 + vsi->tc_cfg.tc_info[i].qcount_tx, 4174 + vsi->tc_cfg.tc_info[i].qoffset); 4175 + } 4168 4176 ice_pf_dcb_recfg(pf, locked); 4169 4177 ice_vsi_open(vsi); 4170 4178 done: