> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-boun...@osuosl.org> On Behalf Of > Jacob Keller > Sent: Thursday, June 19, 2025 12:25 AM > To: Intel Wired LAN <intel-wired-...@lists.osuosl.org> > Cc: Keller, Jacob E <jacob.e.kel...@intel.com>; net...@vger.kernel.org; > Chittim, Madhu <madhu.chit...@intel.com>; Cao, Yahui > <yahui....@intel.com>; Nguyen, Anthony L <anthony.l.ngu...@intel.com>; > Kitszel, Przemyslaw <przemyslaw.kits...@intel.com> > Subject: [Intel-wired-lan] [PATCH iwl-next 8/8] ice: introduce > ice_get_vf_by_dev() wrapper > > The ice_get_vf_by_id() function is used to obtain a reference to a VF > structure > based on its ID. The ice_sriov_set_msix_vec_count() function needs to get a VF > reference starting from the VF PCI device, and uses > pci_iov_vf_id() to get the VF ID. This pattern is currently uncommon in the > ice > driver. However, the live migration module will introduce many more such > locations. > > Add a helper wrapper ice_get_vf_by_dev() which takes the VF PCI device and > calls ice_get_vf_by_id() using pci_iov_vf_id() to get the VF ID. > > Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com> > --- > drivers/net/ethernet/intel/ice/ice_vf_lib.h | 26 > ++++++++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_sriov.c > | 7 +------ > 2 files changed, 27 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h > b/drivers/net/ethernet/intel/ice/ice_vf_lib.h > index > a5ee380f8c9e53d6e5ac029b9942db380829a84f..e538b4ecc6cec7d8bd26b > 7d198197fd5c3ed2e60 100644 > --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h > +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h > @@ -239,6 +239,26 @@ static inline bool ice_vf_is_lldp_ena(struct ice_vf *vf)
Tested-by: Rafal Romanowski <rafal.romanow...@intel.com>