diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2022-02-16 13:37:36 -0800 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2022-03-03 10:54:29 -0800 |
commit | 000773c00f52f2a6084ec04c2efdc2a28ee29d9c (patch) | |
tree | ce2d1bfba9900fd98611d323442530731ae3d926 /drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | |
parent | c4c2c7db64e19f815956c750c461d67867f1cdaf (diff) |
ice: factor VF variables to separate structure
We maintain a number of values for VFs within the ice_pf structure. This
includes the VF table, the number of allocated VFs, the maximum number
of supported SR-IOV VFs, the number of queue pairs per VF, the number of
MSI-X vectors per VF, and a bitmap of the VFs with detected MDD events.
We're about to add a few more variables to this list. Clean this up
first by extracting these members out into a new ice_vfs structure
defined in ice_virtchnl_pf.h
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_virtchnl_pf.h')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h index 9cccb5afb92d..1448e3177215 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h @@ -50,8 +50,8 @@ * Use vf->vf_id to get the id number if needed. */ #define ice_for_each_vf(pf, bkt, entry) \ - for ((bkt) = 0, (entry) = &(pf)->vf[0]; \ - (bkt) < (pf)->num_alloc_vfs; \ + for ((bkt) = 0, (entry) = &(pf)->vfs.table[0]; \ + (bkt) < (pf)->vfs.num_alloc; \ (bkt)++, (entry)++) /* Specific VF states */ @@ -116,6 +116,17 @@ struct ice_vc_vf_ops { int (*dis_vlan_insertion_v2_msg)(struct ice_vf *vf, u8 *msg); }; +/* Virtchnl/SR-IOV config info */ +struct ice_vfs { + struct ice_vf *table; /* table of VF entries */ + u16 num_alloc; /* number of allocated VFs */ + u16 num_supported; /* max supported VFs on this PF */ + u16 num_qps_per; /* number of queue pairs per VF */ + u16 num_msix_per; /* number of MSI-X vectors per VF */ + unsigned long last_printed_mdd_jiffies; /* MDD message rate limit */ + DECLARE_BITMAP(malvfs, ICE_MAX_VF_COUNT); /* malicious VF indicator */ +}; + /* VF information structure */ struct ice_vf { struct ice_pf *pf; |