Re: [PATCH v3 2/4] PCI: hv: Allow dynamic MSI-X vector allocation

Manivannan Sadhasivam
2025-05-12T07:00:07Z

On Fri, May 09, 2025 at 03:13:22AM -0700, Shradha Gupta wrote:
> Allow dynamic MSI-X vector allocation for pci_hyperv PCI controller
> by adding support for the flag MSI_FLAG_PCI_MSIX_ALLOC_DYN and using
> pci_msix_prepare_desc() to prepare the MSI-X descriptors.
>
> Feature support added for both x86 and ARM64
>
> Signed-off-by: Shradha Gupta <shradhagupta@linux.microsoft.com>
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
> Changes in v3:
> * Add arm64 support
> ---
> Changes in v2:
> * split the patch to keep changes in PCI and pci_hyperv controller
> seperate
> * replace strings "pci vectors" by "MSI-X vectors"
> ---
> drivers/pci/controller/pci-hyperv.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> index ac27bda5ba26..8c8882cb0ad2 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -598,7 +598,8 @@ static unsigned int hv_msi_get_int_vector(struct irq_data *data)
> return cfg->vector;
> }
>
> -#define hv_msi_prepare pci_msi_prepare
> +#define hv_msi_prepare pci_msi_prepare
> +#define hv_msix_prepare_desc pci_msix_prepare_desc

Please do not use custom macro unless its defintion changes based on some
conditional. In this case, you should use pci_msix_prepare_desc directly for
prepare_desc() callback.

- Mani

--
மணிவண்ணன் சதாசிவம்