diff options
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c index 9ee2b3ebe486..d46f7579c650 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c @@ -536,6 +536,12 @@ void ice_free_vfs(struct ice_pf *pf) ice_free_vf_res(vf); } + /* clear malicious info since the VF is getting released */ + if (ice_mbx_clear_malvf(&hw->mbx_snapshot, pf->malvfs, + ICE_MAX_VF_COUNT, vf->vf_id)) + dev_dbg(dev, "failed to clear malicious VF state for VF %u\n", + vf->vf_id); + mutex_unlock(&vf->cfg_lock); mutex_destroy(&vf->cfg_lock); @@ -566,13 +572,6 @@ void ice_free_vfs(struct ice_pf *pf) } } - /* clear malicious info if the VFs are getting released */ - for (i = 0; i < tmp; i++) - if (ice_mbx_clear_malvf(&hw->mbx_snapshot, pf->malvfs, - ICE_MAX_VF_COUNT, i)) - dev_dbg(dev, "failed to clear malicious VF state for VF %u\n", - i); - clear_bit(ICE_VF_DIS, pf->state); clear_bit(ICE_FLAG_SRIOV_ENA, pf->flags); } |