public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Pekka Riikonen <priikone@iki.fi>, anatoly.burakov@intel.com
Cc: Dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH v2] bus/pci: fix automatic interrupt type selection
Date: Tue, 24 Feb 2026 12:43:33 +0000	[thread overview]
Message-ID: <314e5333-10a8-434e-955a-e37b690ab72d@redhat.com> (raw)
In-Reply-To: <d612fb276b9c8b173a5e476ca75b0460@iki.fi>

On 20/06/2025 13:50, Pekka Riikonen wrote:
> Check if kernel returns 0 interrupt vectors and try another interrupt
> type in that case.  Failing to check the vector count can select an
> interrupt type that's unusable.
> 
> Signed-off-by: Pekka Riikonen <priikone@iki.fi>
> ---
>   drivers/bus/pci/linux/pci_vfio.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 

Hi Pekka,

just one comment below about logging.

> diff --git a/drivers/bus/pci/linux/pci_vfio.c 
> b/drivers/bus/pci/linux/pci_vfio.c
> index 5317170231..02e7d7e40b 100644
> --- a/drivers/bus/pci/linux/pci_vfio.c
> +++ b/drivers/bus/pci/linux/pci_vfio.c
> @@ -237,6 +237,10 @@ pci_vfio_setup_interrupts(struct rte_pci_device 
> *dev, int vfio_dev_fd)
>   				continue;
>   		}
> 
> +		/* If no vectors, try another one */
> +		if (irq.count == 0)
> +			continue;
> +

This looks functionally correct. It will try the next interrupt type and
in the case where a user has selected a specific interrupt type with the
command line --vfio-intr, then it will return -1 at the end.

It would be nice to be consistent with the eventfd check just above and
add an error log in the case where the user specified the interrupt type.

something like below. what do you think ?

+               /* If no vectors, fail if there is an explicit
+                * interrupt type, otherwise continue */
+               if (irq.count == 0) {
+                       if (intr_mode != RTE_INTR_MODE_NONE) {
+                               PCI_LOG(ERR, "Interrupt has no vectors!");
+                               return -1;
+                       } else
+                               continue;
+               }


>   		/* Reallocate the efds and elist fields of intr_handle based
>   		 * on PCI device MSIX size.
>   		 */


      parent reply	other threads:[~2026-02-24 12:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 12:50 [PATCH v2] bus/pci: fix automatic interrupt type selection Pekka Riikonen
2026-02-18  2:34 ` Stephen Hemminger
2026-02-24 12:43 ` Kevin Traynor [this message]

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=314e5333-10a8-434e-955a-e37b690ab72d@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=priikone@iki.fi \
    --cc=thomas@monjalon.net \
    /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