diff mbox series

[net,12/13] ice: handle the VF VSI rebuild failure

Message ID 20210226211932.46683-12-anthony.l.nguyen@intel.com
State Accepted
Delegated to: Anthony Nguyen
Headers show
Series [net,01/13] ice: Fix allowing VF to request more/less queues via virtchnl | expand

Commit Message

Tony Nguyen Feb. 26, 2021, 9:19 p.m. UTC
From: Haiyue Wang <haiyue.wang@intel.com>

VSI rebuild can be failed for LAN queue config, then the VF's VSI will
be NULL, the VF reset should be stopped with the VF entering into the
disable state.

Fixes: 12bb018c538c ("ice: Refactor VF reset")
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Jankowski, Konrad0 April 21, 2021, 7:17 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: piÄ…tek, 26 lutego 2021 22:20
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH net 12/13] ice: handle the VF VSI rebuild
> failure
> 
> From: Haiyue Wang <haiyue.wang@intel.com>
> 
> VSI rebuild can be failed for LAN queue config, then the VF's VSI will be NULL,
> the VF reset should be stopped with the VF entering into the disable state.
> 
> Fixes: 12bb018c538c ("ice: Refactor VF reset")
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> index 5a581e759111..de438aba29cd 100644
> --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
> @@ -1377,7 +1377,12 @@ bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)
>  	}
> 
>  	ice_vf_pre_vsi_rebuild(vf);
> -	ice_vf_rebuild_vsi_with_release(vf);
> +
> +	if (ice_vf_rebuild_vsi_with_release(vf)) {
> +		dev_err(dev, "Failed to release and setup the VF%u's VSI\n",
> vf->vf_id);
> +		return false;
> +	}
> +
>  	ice_vf_post_vsi_rebuild(vf);
> 
>  	return true;

Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index 5a581e759111..de438aba29cd 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -1377,7 +1377,12 @@  bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)
 	}
 
 	ice_vf_pre_vsi_rebuild(vf);
-	ice_vf_rebuild_vsi_with_release(vf);
+
+	if (ice_vf_rebuild_vsi_with_release(vf)) {
+		dev_err(dev, "Failed to release and setup the VF%u's VSI\n", vf->vf_id);
+		return false;
+	}
+
 	ice_vf_post_vsi_rebuild(vf);
 
 	return true;