]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ice: avoid rebuilding if MSI-X vector count is unchanged
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 18 Jun 2025 22:24:42 +0000 (15:24 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 10 Jul 2025 21:36:58 +0000 (14:36 -0700)
Commit 05c16687e0cc ("ice: set MSI-X vector count on VF") added support to
change the vector count for VFs as part of ice_sriov_set_msix_vec_count().
This function modifies and rebuilds the target VF with the requested number
of MSI-X vectors.

Future support for live migration will add a call to
ice_sriov_set_msix_vec_count() to ensure that a migrated VF has the proper
MSI-X vector count. In most cases, this request will be to set the MSI-X
vector count to its current value. In that case, no work is necessary.
Rather than requiring the caller to check this, update the function to
check and exit early if the vector count is already at the requested value.
This avoids an unnecessary VF rebuild.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_sriov.c

index f88bfd2f3f003082e4263bb278adc10171b23cf2..f78d5d8d516ce65f56faf4e2128b83bad5eb90c5 100644 (file)
@@ -966,6 +966,12 @@ int ice_sriov_set_msix_vec_count(struct pci_dev *vf_dev, int msix_vec_count)
                return -ENOENT;
        }
 
+       /* No need to rebuild if we're setting to the same value */
+       if (msix_vec_count == vf->num_msix) {
+               ice_put_vf(vf);
+               return 0;
+       }
+
        prev_msix = vf->num_msix;
        prev_queues = vf->num_vf_qs;