> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of
> Jacob Keller
> Sent: Thursday, June 19, 2025 12:25 AM
> To: Intel Wired LAN <[email protected]>
> Cc: Keller, Jacob E <[email protected]>; [email protected];
> Chittim, Madhu <[email protected]>; Cao, Yahui
> <[email protected]>; Nguyen, Anthony L <[email protected]>;
> Kitszel, Przemyslaw <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next 7/8] ice: avoid rebuilding if MSI-X
> vector count is unchanged
> 
> 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 <[email protected]>
> ---
>  drivers/net/ethernet/intel/ice/ice_sriov.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c
> b/drivers/net/ethernet/intel/ice/ice_sriov.c
> index
> 4c0955be2ad20c3902cf891a66f857585fcab98b..964c474322196fa887576
> 7ac2667be5d550a6765 100644
> --- a/drivers/net/ethernet/intel/ice/ice_sriov.c
> +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
> @@ -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;
> 
> 
> --
> 2.48.1.397.gec9d649cc640


Tested-by: Rafal Romanowski <[email protected]>


Reply via email to