Skip to content

Commit

Permalink
ice: Rebuild TC queues on VSI queue reconfiguration
Browse files Browse the repository at this point in the history
[ Upstream commit f4b91c1 ]

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: 0754d65 ("ice: Add infrastructure for mqprio support via ndo_setup_tc")
Reviewed-by: Wojciech Drewek <[email protected]>
Signed-off-by: Jan Sokolowski <[email protected]>
Signed-off-by: Karen Ostrowska <[email protected]>
Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
JanJSokolowski authored and gregkh committed Jul 5, 2024
1 parent 5add250 commit 3c27624
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4102,7 +4102,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;
Expand All @@ -4128,6 +4128,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:
Expand Down

0 comments on commit 3c27624

Please sign in to comment.