patch 'raw/ntb: fix doorbell interrupts with VFIO MSI-X' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Nov 16 23:52:23 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/18/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/bfd3e8abd45756143b181b3a0d5704fc6fe693a5
Thanks.
Luca Boccassi
---
>From bfd3e8abd45756143b181b3a0d5704fc6fe693a5 Mon Sep 17 00:00:00 2001
From: Raghavendra Ningoji <raghavendra.ningoji at amd.com>
Date: Wed, 11 Nov 2026 12:36:39 +0530
Subject: [PATCH] raw/ntb: fix doorbell interrupts with VFIO MSI-X
[ upstream commit c9afad09be35db25aa109b144a0d34d8d6896b5c ]
With VFIO MSI-X, each doorbell raises its own vector. Vector 0 is
signalled on the PCI device interrupt handle while the others are
signalled on the eventfds created by rte_intr_efd_enable(), but the
interrupt handler was only registered on the device interrupt handle.
As a result, doorbells other than DB0 were only noticed when DB0 fired
at the same time. In particular, the DB1 rung by the peer in its
dev_stop was never handled, the peer never got the DB2 answer and had
to wait for the 1s timeout.
Register the interrupt handler on each doorbell eventfd as well.
Fixes: 62012a76811e ("raw/ntb: add handshake process")
Signed-off-by: Raghavendra Ningoji <raghavendra.ningoji at amd.com>
---
drivers/raw/ntb/ntb.c | 73 ++++++++++++++++++++++++++++++++++++++++++-
drivers/raw/ntb/ntb.h | 4 +++
2 files changed, 76 insertions(+), 1 deletion(-)
diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c
index 86a4cdfc81..4cf330024c 100644
--- a/drivers/raw/ntb/ntb.c
+++ b/drivers/raw/ntb/ntb.c
@@ -3,6 +3,7 @@
*/
#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -10,6 +11,7 @@
#include <rte_lcore.h>
#include <rte_cycles.h>
#include <rte_eal.h>
+#include <rte_errno.h>
#include <rte_log.h>
#include <rte_pci.h>
#include <rte_mbuf.h>
@@ -250,6 +252,69 @@ ntb_dev_intr_handler(void *param)
(*hw->ntb_ops->db_clear)(dev, db_bits);
}
+static void
+ntb_db_intr_unregister(struct rte_rawdev *dev)
+{
+ struct ntb_hw *hw = dev->dev_private;
+ struct rte_intr_handle *handle;
+ uint16_t i;
+
+ for (i = 0; i < hw->nb_db_intr_handles; i++) {
+ handle = hw->db_intr_handles[i];
+ rte_intr_callback_unregister_sync(handle, ntb_dev_intr_handler, dev);
+ /* The eventfd is owned by the PCI device interrupt handle. */
+ rte_intr_fd_set(handle, -1);
+ rte_intr_instance_free(handle);
+ }
+ free(hw->db_intr_handles);
+ hw->db_intr_handles = NULL;
+ hw->nb_db_intr_handles = 0;
+}
+
+/*
+ * With MSI-X, only vector 0 is serviced through the PCI device interrupt handle.
+ * Each other doorbell raises its own vector, signalled on the eventfds created
+ * by rte_intr_efd_enable(): register the handler on them.
+ */
+static int
+ntb_db_intr_register(struct rte_rawdev *dev, struct rte_intr_handle *intr_handle)
+{
+ struct ntb_hw *hw = dev->dev_private;
+ int nb_efd = rte_intr_nb_efd_get(intr_handle);
+ struct rte_intr_handle *handle;
+ int i, ret;
+
+ hw->db_intr_handles = calloc(nb_efd, sizeof(*hw->db_intr_handles));
+ if (hw->db_intr_handles == NULL)
+ return -ENOMEM;
+
+ for (i = 0; i < nb_efd; i++) {
+ handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE);
+ if (handle == NULL) {
+ ret = -ENOMEM;
+ goto err;
+ }
+ hw->db_intr_handles[hw->nb_db_intr_handles++] = handle;
+
+ if (rte_intr_type_set(handle, RTE_INTR_HANDLE_VFIO_MSIX) ||
+ rte_intr_fd_set(handle, rte_intr_efds_index_get(intr_handle, i))) {
+ ret = -rte_errno;
+ goto err;
+ }
+
+ ret = rte_intr_callback_register(handle, ntb_dev_intr_handler, dev);
+ if (ret)
+ goto err;
+ }
+
+ return 0;
+
+err:
+ NTB_LOG(ERR, "Failed to register doorbell interrupt %d.", i + 1);
+ ntb_db_intr_unregister(dev);
+ return ret;
+}
+
static int
ntb_queue_conf_get(struct rte_rawdev *dev,
uint16_t queue_id,
@@ -1062,6 +1127,8 @@ ntb_dev_close(struct rte_rawdev *dev)
!rte_intr_max_intr_get(intr_handle))
return 0;
+ ntb_db_intr_unregister(dev);
+
/* Clean datapath event and vec mapping */
rte_intr_efd_disable(intr_handle);
rte_intr_vec_list_free(intr_handle);
@@ -1433,7 +1500,11 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)
* by default for intel gen3. They are mapped to msix vec 1-32,
* and hardware intr is mapped to 0. Map all to 0 for uio.
*/
- if (!rte_intr_cap_multiple(intr_handle)) {
+ if (rte_intr_cap_multiple(intr_handle)) {
+ ret = ntb_db_intr_register(dev, intr_handle);
+ if (ret)
+ return ret;
+ } else {
for (i = 0; i < hw->db_cnt; i++) {
if (hw->ntb_ops->vector_bind == NULL)
return -ENOTSUP;
diff --git a/drivers/raw/ntb/ntb.h b/drivers/raw/ntb/ntb.h
index 4eb881d0b8..41f5b773de 100644
--- a/drivers/raw/ntb/ntb.h
+++ b/drivers/raw/ntb/ntb.h
@@ -214,6 +214,10 @@ struct ntb_hw {
struct rte_pci_device *pci_dev;
char *hw_addr;
+ /* Interrupt handles for the MSI-X doorbell vectors besides vector 0. */
+ struct rte_intr_handle **db_intr_handles;
+ uint16_t nb_db_intr_handles;
+
uint8_t peer_dev_up;
uint64_t mw_size[NTB_MAX_MW];
/* remote mem base addr */
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-16 22:52:19.236954599 +0000
+++ 0069-raw-ntb-fix-doorbell-interrupts-with-VFIO-MSI-X.patch 2026-11-16 22:52:16.532234650 +0000
@@ -1 +1 @@
-From c9afad09be35db25aa109b144a0d34d8d6896b5c Mon Sep 17 00:00:00 2001
+From bfd3e8abd45756143b181b3a0d5704fc6fe693a5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c9afad09be35db25aa109b144a0d34d8d6896b5c ]
+
@@ -19 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +29 @@
-index 5985604cce..ac312592dd 100644
+index 86a4cdfc81..4cf330024c 100644
@@ -39 +40 @@
-@@ -11,6 +12,7 @@
+@@ -10,6 +11,7 @@
@@ -47,2 +48,2 @@
-@@ -124,6 +126,69 @@ ntb_dev_intr_handler(void *param)
- (*hw->ntb_ops->handle_hw_event)(dev);
+@@ -250,6 +252,69 @@ ntb_dev_intr_handler(void *param)
+ (*hw->ntb_ops->db_clear)(dev, db_bits);
@@ -117 +118 @@
-@@ -902,6 +967,8 @@ ntb_dev_close(struct rte_rawdev *dev)
+@@ -1062,6 +1127,8 @@ ntb_dev_close(struct rte_rawdev *dev)
@@ -126 +127 @@
-@@ -1305,7 +1372,11 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)
+@@ -1433,7 +1500,11 @@ ntb_init_hw(struct rte_rawdev *dev, struct rte_pci_device *pci_dev)
@@ -137,2 +138,2 @@
- ret = (*hw->ntb_ops->vector_bind)(dev, i, 0);
- if (ret)
+ if (hw->ntb_ops->vector_bind == NULL)
+ return -ENOTSUP;
@@ -140 +141 @@
-index 31bf0f3260..f867f0323d 100644
+index 4eb881d0b8..41f5b773de 100644
@@ -143 +144 @@
-@@ -222,6 +222,10 @@ struct ntb_hw {
+@@ -214,6 +214,10 @@ struct ntb_hw {
More information about the stable
mailing list