aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_vf_lib.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2022-02-22 16:27:01 -0800
committerTony Nguyen <anthony.l.nguyen@intel.com>2022-03-15 13:22:25 -0700
commit9c6f787897f6863b16659fb8807ff5965eb894f2 (patch)
treee08386faf3b99bb5afec34e18b3b744cb03438e7 /drivers/net/ethernet/intel/ice/ice_vf_lib.c
parentice: fix incorrect dev_dbg print mistaking 'i' for vf->vf_id (diff)
downloadlinux-dev-9c6f787897f6863b16659fb8807ff5965eb894f2.tar.xz
linux-dev-9c6f787897f6863b16659fb8807ff5965eb894f2.zip
ice: introduce VF operations structure for reset flows
The ice driver currently supports virtualization using Single Root IOV, with code in the ice_sriov.c file. In the future, we plan to also implement support for Scalable IOV, which uses slightly different hardware implementations for some functionality. To eventually allow this, we introduce a new ice_vf_ops structure which will contain the basic operations that are different between the two IOV implementations. This primarily includes logic for how to handle the VF reset registers, as well as what to do before and after rebuilding the VF's VSI. Implement these ops structures and call the ops table instead of directly calling the SR-IOV specific function. This will allow us to easily add the Scalable IOV implementation in the future. Additionally, it helps separate the generalized VF logic from SR-IOV specifics. This change allows us to move the reset logic out of ice_sriov.c and into ice_vf_lib.c without placing any Single Root specific details into the generic file. 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_vf_lib.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_vf_lib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
index 7ac06aa8b25a..6fee0a12c996 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
@@ -56,9 +56,7 @@ static void ice_release_vf(struct kref *ref)
{
struct ice_vf *vf = container_of(ref, struct ice_vf, refcnt);
- mutex_destroy(&vf->cfg_lock);
-
- kfree_rcu(vf, rcu);
+ vf->vf_ops->free(vf);
}
/**