patch 'common/cnxk: fix VFIO MSI-X interrupt setup' has been queued to stable release 25.11.3
Kevin Traynor
ktraynor at redhat.com
Thu Jul 23 19:15:56 CEST 2026
Hi,
FYI, your patch has been queued to stable release 25.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/27/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/4cf745b0f99cbc74859504142a72ea18413077b5
Thanks.
Kevin
---
>From 4cf745b0f99cbc74859504142a72ea18413077b5 Mon Sep 17 00:00:00 2001
From: Pavan Nikhilesh <pbhagavatula at marvell.com>
Date: Thu, 21 May 2026 13:56:46 +0530
Subject: [PATCH] common/cnxk: fix VFIO MSI-X interrupt setup
[ upstream commit ac49303df89df6313f788c8f2aa8baf5ea8aecd4 ]
Use heap allocation sized by the configured maximum interrupt count for the
VFIO irq_set buffer, correct handling when irq.count is zero, and use a
minimal stack buffer for per-vector configuration.
Fixes: 1fb9f4ab14b3 ("common/cnxk: remove VLA in interrupt configuration")
Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
---
drivers/common/cnxk/roc_platform.c | 39 +++++++++++++++++++-----------
1 file changed, 25 insertions(+), 14 deletions(-)
diff --git a/drivers/common/cnxk/roc_platform.c b/drivers/common/cnxk/roc_platform.c
index 1fdbf8f051..59d662fab4 100644
--- a/drivers/common/cnxk/roc_platform.c
+++ b/drivers/common/cnxk/roc_platform.c
@@ -14,11 +14,9 @@
#include <inttypes.h>
+#include <stdlib.h>
#include <sys/eventfd.h>
#include <sys/ioctl.h>
#include <unistd.h>
-#define MSIX_IRQ_SET_BUF_LEN \
- (sizeof(struct vfio_irq_set) + sizeof(int) * PLT_MAX_RXTX_INTR_VEC_ID)
-
static int
irq_get_info(struct plt_intr_handle *intr_handle)
@@ -40,9 +38,10 @@ irq_get_info(struct plt_intr_handle *intr_handle)
if (irq.count == 0) {
- plt_err("HW max=%d > PLT_MAX_RXTX_INTR_VEC_ID: %d", irq.count,
- PLT_MAX_RXTX_INTR_VEC_ID);
- plt_intr_max_intr_set(intr_handle, PLT_MAX_RXTX_INTR_VEC_ID);
+ plt_warn("VFIO MSI-X irq.count is 0; using PLT_MAX_RXTX_INTR_VEC_ID=%u",
+ PLT_MAX_RXTX_INTR_VEC_ID);
+ if (plt_intr_max_intr_set(intr_handle, PLT_MAX_RXTX_INTR_VEC_ID))
+ return -1;
} else {
- if (plt_intr_max_intr_set(intr_handle, irq.count))
+ if (plt_intr_max_intr_set(intr_handle, (int)irq.count))
return -1;
}
@@ -54,5 +53,5 @@ static int
irq_config(struct plt_intr_handle *intr_handle, unsigned int vec)
{
- char irq_set_buf[MSIX_IRQ_SET_BUF_LEN];
+ char irq_set_buf[sizeof(struct vfio_irq_set) + sizeof(int32_t)];
struct vfio_irq_set *irq_set;
int len, rc, vfio_dev_fd;
@@ -90,21 +89,32 @@ static int
irq_init(struct plt_intr_handle *intr_handle)
{
- char irq_set_buf[MSIX_IRQ_SET_BUF_LEN];
+ int max_intr, len, rc, vfio_dev_fd;
struct vfio_irq_set *irq_set;
- int len, rc, vfio_dev_fd;
+ char *irq_set_buf = NULL;
int32_t *fd_ptr;
- uint32_t i;
+ int i;
- len = sizeof(struct vfio_irq_set) + sizeof(int32_t) * plt_intr_max_intr_get(intr_handle);
+ max_intr = plt_intr_max_intr_get(intr_handle);
+ if (max_intr <= 0) {
+ plt_err("Invalid max_intr %d for irq init", max_intr);
+ return -EINVAL;
+ }
+
+ len = sizeof(struct vfio_irq_set) + sizeof(int32_t) * max_intr;
+ irq_set_buf = malloc((size_t)len);
+ if (irq_set_buf == NULL) {
+ plt_err("Failed to alloc irq_set_buf len=%d", len);
+ return -ENOMEM;
+ }
irq_set = (struct vfio_irq_set *)irq_set_buf;
irq_set->argsz = len;
irq_set->start = 0;
- irq_set->count = plt_intr_max_intr_get(intr_handle);
+ irq_set->count = (uint32_t)max_intr;
irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER;
irq_set->index = VFIO_PCI_MSIX_IRQ_INDEX;
fd_ptr = (int32_t *)&irq_set->data[0];
- for (i = 0; i < irq_set->count; i++)
+ for (i = 0; i < max_intr; i++)
fd_ptr[i] = -1;
@@ -114,4 +124,5 @@ irq_init(struct plt_intr_handle *intr_handle)
plt_err("Failed to set irqs vector rc=%d", rc);
+ free(irq_set_buf);
return rc;
}
--
2.55.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-23 17:58:01.314199609 +0100
+++ 0093-common-cnxk-fix-VFIO-MSI-X-interrupt-setup.patch 2026-07-23 17:57:58.715470656 +0100
@@ -1 +1 @@
-From ac49303df89df6313f788c8f2aa8baf5ea8aecd4 Mon Sep 17 00:00:00 2001
+From 4cf745b0f99cbc74859504142a72ea18413077b5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ac49303df89df6313f788c8f2aa8baf5ea8aecd4 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list