public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Reinette Chatre <reinette.chatre@intel.com>
Cc: jgg@nvidia.com, yishaih@nvidia.com,
	shameerali.kolothum.thodi@huawei.com, kevin.tian@intel.com,
	tglx@linutronix.de, darwi@linutronix.de, kvm@vger.kernel.org,
	dave.jiang@intel.com, jing2.liu@intel.com, ashok.raj@intel.com,
	fenghua.yu@intel.com, tom.zanussi@linux.intel.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 10/10] vfio/pci: Clear VFIO_IRQ_INFO_NORESIZE for MSI-X
Date: Tue, 18 Apr 2023 16:38:43 -0600	[thread overview]
Message-ID: <20230418163843.7b4c0366.alex.williamson@redhat.com> (raw)
In-Reply-To: <6c057618833a180da2147bffadb98e07cb73e045.1681837892.git.reinette.chatre@intel.com>

On Tue, 18 Apr 2023 10:29:21 -0700
Reinette Chatre <reinette.chatre@intel.com> wrote:

> Dynamic MSI-X is supported. Clear VFIO_IRQ_INFO_NORESIZE
> to provide guidance to user space.
> 
> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
> Changes since V2:
> - Use new vdev->has_dyn_msix property instead of calling
>   pci_msix_can_alloc_dyn() directly. (Alex)
> 
> Changes since RFC V1:
> - Only advertise VFIO_IRQ_INFO_NORESIZE for MSI-X devices that
>   can actually support dynamic allocation. (Alex)
> 
>  drivers/vfio/pci/vfio_pci_core.c | 4 +++-
>  include/uapi/linux/vfio.h        | 3 +++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
> index a3635a8e54c8..4050ad3388c2 100644
> --- a/drivers/vfio/pci/vfio_pci_core.c
> +++ b/drivers/vfio/pci/vfio_pci_core.c
> @@ -1114,7 +1114,9 @@ static int vfio_pci_ioctl_get_irq_info(struct vfio_pci_core_device *vdev,
>  	if (info.index == VFIO_PCI_INTX_IRQ_INDEX)
>  		info.flags |=
>  			(VFIO_IRQ_INFO_MASKABLE | VFIO_IRQ_INFO_AUTOMASKED);
> -	else
> +	else if ((info.index != VFIO_PCI_MSIX_IRQ_INDEX) ||
> +		 (info.index == VFIO_PCI_MSIX_IRQ_INDEX &&
> +		  !vdev->has_dyn_msix))

Isn't this the same as:

	(info.index != VFIO_PCI_MSIX_IRQ_INDEX || !vdev->has_dyn_msix)

Thanks,
Alex

>  		info.flags |= VFIO_IRQ_INFO_NORESIZE;
>  
>  	return copy_to_user(arg, &info, minsz) ? -EFAULT : 0;
> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> index 0552e8dcf0cb..1a36134cae5c 100644
> --- a/include/uapi/linux/vfio.h
> +++ b/include/uapi/linux/vfio.h
> @@ -511,6 +511,9 @@ struct vfio_region_info_cap_nvlink2_lnkspd {
>   * then add and unmask vectors, it's up to userspace to make the decision
>   * whether to allocate the maximum supported number of vectors or tear
>   * down setup and incrementally increase the vectors as each is enabled.
> + * Absence of the NORESIZE flag indicates that vectors can be enabled
> + * and disabled dynamically without impacting other vectors within the
> + * index.
>   */
>  struct vfio_irq_info {
>  	__u32	argsz;


  reply	other threads:[~2023-04-18 22:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 17:29 [PATCH V3 00/10] vfio/pci: Support dynamic allocation of MSI-X interrupts Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 01/10] vfio/pci: Consolidate irq cleanup on MSI/MSI-X disable Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 02/10] vfio/pci: Remove negative check on unsigned vector Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 03/10] vfio/pci: Prepare for dynamic interrupt context storage Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 04/10] vfio/pci: Move to single error path Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 05/10] vfio/pci: Use xarray for interrupt context storage Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 06/10] vfio/pci: Remove interrupt context counter Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 07/10] vfio/pci: Update stale comment Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 08/10] vfio/pci: Probe and store ability to support dynamic MSI-X Reinette Chatre
2023-04-18 22:38   ` Alex Williamson
2023-04-19 18:11     ` Reinette Chatre
2023-04-24 17:43       ` Jason Gunthorpe
2023-04-24 23:52         ` Reinette Chatre
2023-04-25 14:51           ` Jason Gunthorpe
2023-04-25 16:52             ` Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 09/10] vfio/pci: Support " Reinette Chatre
2023-04-18 22:38   ` Alex Williamson
2023-04-19 18:13     ` Reinette Chatre
2023-04-19 21:38       ` Alex Williamson
2023-04-19 22:03         ` Reinette Chatre
2023-04-18 17:29 ` [PATCH V3 10/10] vfio/pci: Clear VFIO_IRQ_INFO_NORESIZE for MSI-X Reinette Chatre
2023-04-18 22:38   ` Alex Williamson [this message]
2023-04-19 18:13     ` Reinette Chatre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230418163843.7b4c0366.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=ashok.raj@intel.com \
    --cc=darwi@linutronix.de \
    --cc=dave.jiang@intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=jgg@nvidia.com \
    --cc=jing2.liu@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox