Skip to content

Commit d47bf9a

Browse files
riceraanguy11
authored andcommitted
ice: Check all ice_vsi_rebuild() errors in function
Check the return value from ice_vsi_rebuild() and prevent the usage of incorrectly configured VSI. Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Eric Joyner <eric.joyner@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>
1 parent 4dbb4f9 commit d47bf9a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4158,13 +4158,17 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)
41584158

41594159
/* set for the next time the netdev is started */
41604160
if (!netif_running(vsi->netdev)) {
4161-
ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
4161+
err = ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
4162+
if (err)
4163+
goto rebuild_err;
41624164
dev_dbg(ice_pf_to_dev(pf), "Link is down, queue count change happens when link is brought up\n");
41634165
goto done;
41644166
}
41654167

41664168
ice_vsi_close(vsi);
4167-
ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
4169+
err = ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
4170+
if (err)
4171+
goto rebuild_err;
41684172

41694173
ice_for_each_traffic_class(i) {
41704174
if (vsi->tc_cfg.ena_tc & BIT(i))
@@ -4175,6 +4179,11 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)
41754179
}
41764180
ice_pf_dcb_recfg(pf, locked);
41774181
ice_vsi_open(vsi);
4182+
goto done;
4183+
4184+
rebuild_err:
4185+
dev_err(ice_pf_to_dev(pf), "Error during VSI rebuild: %d. Unload and reload the driver.\n",
4186+
err);
41784187
done:
41794188
clear_bit(ICE_CFG_BUSY, pf->state);
41804189
return err;

0 commit comments

Comments
 (0)