]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ice: reconfig host after changing MSI-X on VF
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Fri, 23 Feb 2024 06:40:24 +0000 (07:40 +0100)
committerSasha Levin <sashal@kernel.org>
Fri, 15 Mar 2024 14:48:15 +0000 (10:48 -0400)
[ Upstream commit 4035c72dc1ba81a96f94de84dfd5409056c1d9c9 ]

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")
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_sriov.c

index c4caa9df473b5d393e5e5e812b4affc8f1b2ebab..cd61928700211cd0542174efab4ad6e713362cb3 100644 (file)
@@ -1074,6 +1074,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;
 
@@ -1108,6 +1109,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;
 
@@ -1128,7 +1133,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;
@@ -1154,8 +1159,10 @@ unroll:
        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);