Commit 4035c72d authored by Michal Swiatkowski's avatar Michal Swiatkowski Committed by Tony Nguyen

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: 4d38cb44 ("ice: manage VFs MSI-X using resource tracking")
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 99099c6b
...@@ -1068,6 +1068,7 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count) ...@@ -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); struct ice_pf *pf = pci_get_drvdata(pdev);
u16 prev_msix, prev_queues, queues; u16 prev_msix, prev_queues, queues;
bool needs_rebuild = false; bool needs_rebuild = false;
struct ice_vsi *vsi;
struct ice_vf *vf; struct ice_vf *vf;
int id; int id;
...@@ -1102,6 +1103,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count) ...@@ -1102,6 +1103,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
if (!vf) if (!vf)
return -ENOENT; return -ENOENT;
vsi = ice_get_vf_vsi(vf);
if (!vsi)
return -ENOENT;
prev_msix = vf->num_msix; prev_msix = vf->num_msix;
prev_queues = vf->num_vf_qs; 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) ...@@ -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) if (vf->first_vector_idx < 0)
goto unroll; 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 */ /* Try to rebuild with previous values */
needs_rebuild = true; needs_rebuild = true;
goto unroll; goto unroll;
...@@ -1148,8 +1153,10 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count) ...@@ -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) if (vf->first_vector_idx < 0)
return -EINVAL; return -EINVAL;
if (needs_rebuild) if (needs_rebuild) {
ice_vf_reconfig_vsi(vf); ice_vf_reconfig_vsi(vf);
ice_vf_init_host_cfg(vf, vsi);
}
ice_ena_vf_mappings(vf); ice_ena_vf_mappings(vf);
ice_put_vf(vf); ice_put_vf(vf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment