diff options
| author | Jacob Keller <jacob.e.keller@intel.com> | 2023-01-19 04:16:48 +0300 | 
|---|---|---|
| committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2023-02-06 20:41:01 +0300 | 
| commit | b5dcff1fd57ac0b67229bc008223b6a67176940a (patch) | |
| tree | 27841683190eb994c7c2c3a2b17e772802882b03 /drivers/net/ethernet/intel/ice/ice_vf_lib.c | |
| parent | aeead3d04fa050a94ed314cc5de97125a957dc9f (diff) | |
| download | linux-b5dcff1fd57ac0b67229bc008223b6a67176940a.tar.xz | |
ice: add a function to initialize vf entry
Some of the initialization code for Single Root IOV VFs will need to be
reused when we introduce Scalable IOV. Pull this code out into a new
ice_initialize_vf_entry helper function.
Co-developed-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Marek Szlosek <marek.szlosek@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.c | 26 | 
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c index 624c7de8b205..b6fd1e852968 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c @@ -699,6 +699,32 @@ void ice_set_vf_state_qs_dis(struct ice_vf *vf)  /* Private functions only accessed from other virtualization files */  /** + * ice_initialize_vf_entry - Initialize a VF entry + * @vf: pointer to the VF structure + */ +void ice_initialize_vf_entry(struct ice_vf *vf) +{ +	struct ice_pf *pf = vf->pf; +	struct ice_vfs *vfs; + +	vfs = &pf->vfs; + +	/* assign default capabilities */ +	vf->spoofchk = true; +	vf->num_vf_qs = vfs->num_qps_per; +	ice_vc_set_default_allowlist(vf); +	ice_virtchnl_set_dflt_ops(vf); + +	/* ctrl_vsi_idx will be set to a valid value only when iAVF +	 * creates its first fdir rule. +	 */ +	ice_vf_ctrl_invalidate_vsi(vf); +	ice_vf_fdir_init(vf); + +	mutex_init(&vf->cfg_lock); +} + +/**   * ice_dis_vf_qs - Disable the VF queues   * @vf: pointer to the VF structure   */  | 
