Commit d47bf9a4 authored by Eric Joyner's avatar Eric Joyner Committed by Tony Nguyen
Browse files

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: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: default avatarEric Joyner <eric.joyner@intel.com>
Signed-off-by: default avatarKaren Ostrowska <karen.ostrowska@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 4dbb4f9b
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -4158,13 +4158,17 @@ int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx, bool locked)

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

	ice_vsi_close(vsi);
	ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
	err = ice_vsi_rebuild(vsi, ICE_VSI_FLAG_NO_INIT);
	if (err)
		goto rebuild_err;

	ice_for_each_traffic_class(i) {
		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)
	}
	ice_pf_dcb_recfg(pf, locked);
	ice_vsi_open(vsi);
	goto done;

rebuild_err:
	dev_err(ice_pf_to_dev(pf), "Error during VSI rebuild: %d. Unload and reload the driver.\n",
		err);
done:
	clear_bit(ICE_CFG_BUSY, pf->state);
	return err;