diff options
| author | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-08-30 16:06:38 -0700 | 
| commit | 1ac731c529cd4d6adbce134754b51ff7d822b145 (patch) | |
| tree | 143ab3f35ca5f3b69f583c84e6964b17139c2ec1 /drivers/net/ethernet/intel/ice/ice_vf_lib.c | |
| parent | 07b4c950f27bef0362dc6ad7ee713aab61d58149 (diff) | |
| parent | 54116d442e001e1b6bd482122043b1870998a1f3 (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.6 merge window.
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_vf_lib.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_vf_lib.c | 34 | 
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c index 0e57bd1b85fd..bf74a2f3a4f8 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c @@ -186,6 +186,25 @@ int ice_check_vf_ready_for_cfg(struct ice_vf *vf)  }  /** + * ice_check_vf_ready_for_reset - check if VF is ready to be reset + * @vf: VF to check if it's ready to be reset + * + * The purpose of this function is to ensure that the VF is not in reset, + * disabled, and is both initialized and active, thus enabling us to safely + * initialize another reset. + */ +int ice_check_vf_ready_for_reset(struct ice_vf *vf) +{ +	int ret; + +	ret = ice_check_vf_ready_for_cfg(vf); +	if (!ret && !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) +		ret = -EAGAIN; + +	return ret; +} + +/**   * ice_trigger_vf_reset - Reset a VF on HW   * @vf: pointer to the VF structure   * @is_vflr: true if VFLR was issued, false if not @@ -496,10 +515,7 @@ void ice_reset_all_vfs(struct ice_pf *pf)  	/* clear all malicious info if the VFs are getting reset */  	ice_for_each_vf(pf, bkt, vf) -		if (ice_mbx_clear_malvf(&hw->mbx_snapshot, pf->vfs.malvfs, -					ICE_MAX_SRIOV_VFS, vf->vf_id)) -			dev_dbg(dev, "failed to clear malicious VF state for VF %u\n", -				vf->vf_id); +		ice_mbx_clear_malvf(&vf->mbx_info);  	/* If VFs have been disabled, there is no need to reset */  	if (test_and_set_bit(ICE_VF_DIS, pf->state)) { @@ -601,12 +617,10 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)  	struct ice_pf *pf = vf->pf;  	struct ice_vsi *vsi;  	struct device *dev; -	struct ice_hw *hw;  	int err = 0;  	bool rsd;  	dev = ice_pf_to_dev(pf); -	hw = &pf->hw;  	if (flags & ICE_VF_RESET_NOTIFY)  		ice_notify_vf_reset(vf); @@ -705,10 +719,7 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)  	ice_eswitch_replay_vf_mac_rule(vf);  	/* if the VF has been reset allow it to come up again */ -	if (ice_mbx_clear_malvf(&hw->mbx_snapshot, pf->vfs.malvfs, -				ICE_MAX_SRIOV_VFS, vf->vf_id)) -		dev_dbg(dev, "failed to clear malicious VF state for VF %u\n", -			vf->vf_id); +	ice_mbx_clear_malvf(&vf->mbx_info);  out_unlock:  	if (flags & ICE_VF_RESET_LOCK) @@ -764,6 +775,9 @@ void ice_initialize_vf_entry(struct ice_vf *vf)  	ice_vf_ctrl_invalidate_vsi(vf);  	ice_vf_fdir_init(vf); +	/* Initialize mailbox info for this VF */ +	ice_mbx_init_vf_info(&pf->hw, &vf->mbx_info); +  	mutex_init(&vf->cfg_lock);  }  |