From: Stephen Hemminger <stephen@networkplumber.org>
To: Pekka Riikonen <priikone@iki.fi>
Cc: anatoly.burakov@intel.com, Dev <dev@dpdk.org>
Subject: Re: [PATCH v2] bus/pci: fix automatic interrupt type selection
Date: Tue, 17 Feb 2026 18:34:29 -0800 [thread overview]
Message-ID: <20260217183429.738020e8@phoenix.local> (raw)
In-Reply-To: <d612fb276b9c8b173a5e476ca75b0460@iki.fi>
On Fri, 20 Jun 2025 15:50:27 +0300
Pekka Riikonen <priikone@iki.fi> 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>
Patch looks good, automated review had some feedback.
1. Should add a Fixes: and Cc: stable@dpdk.org
2. There is a pre-existing bugs in the file as well
Error 1: Missing handling when interrupt type was explicitly requested and count is 0
Confidence: ~85%
The existing VFIO_IRQ_INFO_EVENTFD check (lines 223–228) has two branches: if the user explicitly requested this interrupt type (intr_mode != RTE_INTR_MODE_NONE), it returns an error; otherwise it continues to the next type. The new irq.count == 0 check does not mirror this pattern — it unconditionally does continue.
This means if a user explicitly requested e.g. MSI-X via command line (--vfio-intr=msix) but the device reports 0 vectors for MSI-X, the code will silently fall through and try MSI or INTx instead of reporting an error. This is inconsistent with the existing behavior for the eventfd flag check, and arguably a bug: the user asked for a specific interrupt type that doesn't work, and should be told.
Suggested fix:
c
/* If no vectors, try another type (or fail if explicitly requested) */
if (irq.count == 0) {
if (intr_mode != RTE_INTR_MODE_NONE) {
PCI_LOG(ERR, "Interrupt vector has no entries!");
return -1;
}
continue;
}
Error 2: Resource leak — eventfd fd leaked on later error paths (pre-existing)
Confidence: ~90%
This is a pre-existing issue, not introduced by this patch, but worth noting since the patch touches this function. At line 240, eventfd() creates a file descriptor. If rte_intr_fd_set() at line 247 fails, the function returns -1 without closing fd. This is a file descriptor leak on that error path.
Similarly, the rte_intr_event_list_update failure path at line 236–237 is fine (no fd allocated yet), but the rte_intr_fd_set failure is a real leak.
This is pre-existing and not caused by this patch, so it's informational rather than something blocking this patch.
next prev parent reply other threads:[~2026-02-18 2:34 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 [this message]
2026-02-24 12:43 ` Kevin Traynor
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=20260217183429.738020e8@phoenix.local \
--to=stephen@networkplumber.org \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=priikone@iki.fi \
/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