Skip to contentSkip to conversation

ice: reconfig host after changing MSI-X on VF

PATCH In review Michal Swiatkowski 3 participants 3 messages Feb 23, 2024 – Mar 1, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 4d38cb44bd32 ("ice: manage VFs MSI-X using resource tracking")
---
 drivers/net/ethernet/intel/ice/ice_sriov.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ice/ice_sriov.c +9 -2
index a94a1c48c3de..b0f78c2f2790 100644
@@ -1068,6 +1068,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
 	struct ice_pf *pf = pci_get_drvdata(pdev);
 	u16 prev_msix, prev_queues, queues;
 	bool needs_rebuild = false;
+	struct ice_vsi *vsi;
 	struct ice_vf *vf;
 	int id;
 
@@ -1102,6 +1103,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
 	if (!vf)
 		return -ENOENT;
 
+	vsi = ice_get_vf_vsi(vf);
+	if (!vsi)
+		return -ENOENT;
+
 	prev_msix = vf->num_msix;
 	prev_queues = vf->num_vf_qs;
 
@@ -1122,7 +1127,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
 	if (vf->first_vector_idx < 0)
 		goto unroll;
 
-	if (ice_vf_reconfig_vsi(vf)) {
+	if (ice_vf_reconfig_vsi(vf) || ice_vf_init_host_cfg(vf, vsi)) {
 		/* Try to rebuild with previous values */
 		needs_rebuild = true;
 		goto unroll;
@@ -1148,8 +1153,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
 	if (vf->first_vector_idx < 0)
 		return -EINVAL;
 
-	if (needs_rebuild)
+	if (needs_rebuild) {
 		ice_vf_reconfig_vsi(vf);
+		ice_vf_init_host_cfg(vf, vsi);
+	}
 
 	ice_ena_vf_mappings(vf);
 	ice_put_vf(vf);
Signature · 1 line
2.42.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Michal Swiatkowski

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 4d38cb44bd32 ("ice: manage VFs MSI-X using resource tracking")
#2 lore raw
Quoted 15 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Simon Horman
Sent: Monday, February 26, 2024 6:09 PM
To: Michal Swiatkowski <[email protected]>
Cc: Keller, Jacob E <[email protected]>; [email protected]; intel- [email protected]
Subject: Re: [Intel-wired-lan] [iwl-net v1] ice: reconfig host after changing MSI-X on VF

Quoted 4 lines · Michal Swiatkowski

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.

Quoted 8 lines
Quoted 6 lines

Without this config VF on which MSI-X amount was changed might had a connection problems.

Fixes 4d38cb44bd32 ("ice: manage VFs MSI-X using resource tracking")