Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
ice: set vf->num_msix in ice_initialize_vf_entry()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jacob-keller authored and anguy11 committed Apr 12, 2024
1 parent ae67389 commit c22f7da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 0 additions & 5 deletions drivers/net/ethernet/intel/ice/ice_sriov.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,6 @@ static int ice_create_vf_entries(struct ice_pf *pf, u16 num_vfs)

pci_dev_get(vfdev);

/* set default number of MSI-X */
vf->num_msix = pf->vfs.num_msix_per;
vf->num_vf_qs = pf->vfs.num_qps_per;
ice_vc_set_default_allowlist(vf);

hash_add_rcu(vfs->table, &vf->entry, vf_id);
}

Expand Down
5 changes: 4 additions & 1 deletion drivers/net/ethernet/intel/ice/ice_vf_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,10 +992,13 @@ void ice_initialize_vf_entry(struct ice_vf *vf)

/* 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);

/* set default number of MSI-X */
vf->num_msix = vfs->num_msix_per;
vf->num_vf_qs = vfs->num_qps_per;

/* ctrl_vsi_idx will be set to a valid value only when iAVF
* creates its first fdir rule.
*/
Expand Down

0 comments on commit c22f7da

Please sign in to comment.