summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ice/ice_sriov.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2022-02-22 16:27:07 -0800
committerTony Nguyen <anthony.l.nguyen@intel.com>2022-03-15 13:22:54 -0700
commit7eb517e434c653a4afa16ec3d0a750c2f46b3560 (patch)
tree3ec32b3684310d6ba0ee4204f79e16acca3dae9a /drivers/net/ethernet/intel/ice/ice_sriov.c
parent4fe193cc9dd09565b61de2bf3dd62924443929dd (diff)
ice: convert ice_reset_vf to take flags
The ice_reset_vf function takes a boolean parameter which indicates whether or not the reset is due to a VFLR event. This is somewhat confusing to read because readers must interpret what "true" and "false" mean when seeing a line of code like "ice_reset_vf(vf, false)". We will want to add another toggle to the ice_reset_vf in a following change. To avoid proliferating many arguments, convert this function to take flags instead. ICE_VF_RESET_VFLR will indicate if this is a VFLR reset. A value of 0 indicates no flags. One could argue that "ice_reset_vf(vf, 0)" is no more readable than "ice_reset_vf(vf, false)".. However, this type of flags interface is somewhat common and using 0 to mean "no flags" makes sense in this context. We could bother to add a define for "ICE_VF_RESET_PLAIN" or something similar, but this can be confusing since its not an actual bit flag. This paves the way to add another flag to the function in a following change. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_sriov.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_sriov.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index 4a8cf8f646c8..c234e4edc7f0 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -1393,7 +1393,7 @@ void ice_process_vflr_event(struct ice_pf *pf)
if (reg & BIT(bit_idx)) {
/* GLGEN_VFLRSTAT bit will be cleared in ice_reset_vf */
mutex_lock(&vf->cfg_lock);
- ice_reset_vf(vf, true);
+ ice_reset_vf(vf, ICE_VF_RESET_VFLR);
mutex_unlock(&vf->cfg_lock);
}
}
@@ -1407,7 +1407,7 @@ void ice_process_vflr_event(struct ice_pf *pf)
static void ice_vc_reset_vf(struct ice_vf *vf)
{
ice_vc_notify_vf_reset(vf);
- ice_reset_vf(vf, false);
+ ice_reset_vf(vf, 0);
}
/**
@@ -1724,7 +1724,7 @@ err:
static void ice_vc_reset_vf_msg(struct ice_vf *vf)
{
if (test_bit(ICE_VF_STATE_INIT, vf->vf_states))
- ice_reset_vf(vf, false);
+ ice_reset_vf(vf, 0);
}
/**