Skip to content

Commit 4035c72

Browse files
Michal Swiatkowskianguy11
authored andcommitted
ice: reconfig host after changing MSI-X on VF
During VSI reconfiguration filters and VSI config which is set in ice_vf_init_host_cfg() are lost. Recall the host configuration function to restore them. Without this config VF on which MSI-X amount was changed might had a connection problems. Fixes: 4d38cb4 ("ice: manage VFs MSI-X using resource tracking") Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: Michal Swiatkowski <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 99099c6 commit 4035c72

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
10681068
struct ice_pf *pf = pci_get_drvdata(pdev);
10691069
u16 prev_msix, prev_queues, queues;
10701070
bool needs_rebuild = false;
1071+
struct ice_vsi *vsi;
10711072
struct ice_vf *vf;
10721073
int id;
10731074

@@ -1102,6 +1103,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11021103
if (!vf)
11031104
return -ENOENT;
11041105

1106+
vsi = ice_get_vf_vsi(vf);
1107+
if (!vsi)
1108+
return -ENOENT;
1109+
11051110
prev_msix = vf->num_msix;
11061111
prev_queues = vf->num_vf_qs;
11071112

@@ -1122,7 +1127,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11221127
if (vf->first_vector_idx < 0)
11231128
goto unroll;
11241129

1125-
if (ice_vf_reconfig_vsi(vf)) {
1130+
if (ice_vf_reconfig_vsi(vf) || ice_vf_init_host_cfg(vf, vsi)) {
11261131
/* Try to rebuild with previous values */
11271132
needs_rebuild = true;
11281133
goto unroll;
@@ -1148,8 +1153,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
11481153
if (vf->first_vector_idx < 0)
11491154
return -EINVAL;
11501155

1151-
if (needs_rebuild)
1156+
if (needs_rebuild) {
11521157
ice_vf_reconfig_vsi(vf);
1158+
ice_vf_init_host_cfg(vf, vsi);
1159+
}
11531160

11541161
ice_ena_vf_mappings(vf);
11551162
ice_put_vf(vf);

0 commit comments

Comments
 (0)