Skip to content

Commit c22f7da

Browse files
jacob-kelleranguy11
authored andcommitted
ice: set vf->num_msix in ice_initialize_vf_entry()
Commit fe1c5ca ("ice: implement num_msix field per VF") updated the driver to allow for per-VF MSI-X configuration. The initial defaults were set in ice_create_vf_entries(). This logic is better placed in ice_initialize_vf_entry(). Indeed, that function already sets vf->num_vf_qs, as well as initializes the allow list via calling ice_vc_set_default_allowlist(). Move this logic into ice_initialize_vf_entry(). This makes the code clear, and ensures that these VF fields will be initialized properly for both SR-IOV VFs and the upcoming Scalable IOV VFs. Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Jesse Brandeburg <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent ae67389 commit c22f7da

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

drivers/net/ethernet/intel/ice/ice_sriov.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -831,11 +831,6 @@ static int ice_create_vf_entries(struct ice_pf *pf, u16 num_vfs)
831831

832832
pci_dev_get(vfdev);
833833

834-
/* set default number of MSI-X */
835-
vf->num_msix = pf->vfs.num_msix_per;
836-
vf->num_vf_qs = pf->vfs.num_qps_per;
837-
ice_vc_set_default_allowlist(vf);
838-
839834
hash_add_rcu(vfs->table, &vf->entry, vf_id);
840835
}
841836

drivers/net/ethernet/intel/ice/ice_vf_lib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,10 +992,13 @@ void ice_initialize_vf_entry(struct ice_vf *vf)
992992

993993
/* assign default capabilities */
994994
vf->spoofchk = true;
995-
vf->num_vf_qs = vfs->num_qps_per;
996995
ice_vc_set_default_allowlist(vf);
997996
ice_virtchnl_set_dflt_ops(vf);
998997

998+
/* set default number of MSI-X */
999+
vf->num_msix = vfs->num_msix_per;
1000+
vf->num_vf_qs = vfs->num_qps_per;
1001+
9991002
/* ctrl_vsi_idx will be set to a valid value only when iAVF
10001003
* creates its first fdir rule.
10011004
*/

0 commit comments

Comments
 (0)