patch 'interrupts: propagate epoll error' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Jul 6 12:19:55 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
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/05/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/cb9a57a63f793642434e9098c2eed3bbe36d07e4
Thanks.
Luca Boccassi
---
>From cb9a57a63f793642434e9098c2eed3bbe36d07e4 Mon Sep 17 00:00:00 2001
From: Maxime Leroy <maxime at leroys.fr>
Date: Thu, 11 Jun 2026 17:49:17 +0200
Subject: [PATCH] interrupts: propagate epoll error
[ upstream commit 25c7aba07e929da56c105eebb7ec3efaddac4828 ]
Some interrupt users have several vectors backed by the same eventfd
(e.g. several Rx queues behind one DPAA2 portal eventfd). Adding the
second vector to the same epoll instance then fails with EEXIST.
Upper layers such as ethdev and bbdev already treat -EEXIST as a
non-fatal duplicate registration (if (ret && ret != -EEXIST)), but
rte_intr_rx_ctl() lost that information: rte_epoll_ctl() returned -1 and
rte_intr_rx_ctl() flattened every failure to -EPERM.
Return the negative errno from rte_epoll_ctl() (its documented contract
is already "a negative value") and stop rte_intr_rx_ctl() from
flattening errors to -EPERM, so EEXIST reaches the upper layers that
already handle it; other failures carry their real errno.
Fixes: 9efe9c6cdcac ("eal/linux: add epoll wrappers")
Fixes: c9f3ec1a0f3f ("eal/linux: add Rx interrupt control function")
Signed-off-by: Maxime Leroy <maxime at leroys.fr>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
lib/eal/include/rte_epoll.h | 3 ++-
lib/eal/linux/eal_interrupts.c | 18 +++++++++++-------
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/lib/eal/include/rte_epoll.h b/lib/eal/include/rte_epoll.h
index ae0cf20853..0c7b510563 100644
--- a/lib/eal/include/rte_epoll.h
+++ b/lib/eal/include/rte_epoll.h
@@ -104,7 +104,8 @@ rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,
* Note: The caller must take care the object deletion after CTL_DEL.
* @return
* - On success, zero.
- * - On failure, a negative value.
+ * - On failure, a negative errno value, e.g. -EEXIST if the fd is already
+ * registered on the epoll instance (a fd shared between vectors).
*/
int
rte_epoll_ctl(int epfd, int op, int fd,
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 14472ee929..1f3f357227 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -1433,7 +1433,7 @@ rte_epoll_ctl(int epfd, int op, int fd,
if (!event) {
EAL_LOG(ERR, "rte_epoll_event can't be NULL");
- return -1;
+ return -EINVAL;
}
/* using per thread epoll fd */
@@ -1450,13 +1450,21 @@ rte_epoll_ctl(int epfd, int op, int fd,
ev.events = event->epdata.event;
if (epoll_ctl(epfd, op, fd, &ev) < 0) {
+ int err = errno;
+
+ /* the fd is already in the set (e.g. shared across vectors):
+ * keep the event valid and report -EEXIST, not a hard error.
+ */
+ if (op == EPOLL_CTL_ADD && err == EEXIST)
+ return -EEXIST;
+
EAL_LOG(ERR, "Error op %d fd %d epoll_ctl, %s",
- op, fd, strerror(errno));
+ op, fd, strerror(err));
if (op == EPOLL_CTL_ADD)
/* rollback status when CTL_ADD fail */
rte_atomic_store_explicit(&event->status, RTE_EPOLL_INVALID,
rte_memory_order_relaxed);
- return -1;
+ return -err;
}
if (op == EPOLL_CTL_DEL && rte_atomic_load_explicit(&event->status,
@@ -1507,8 +1515,6 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
EAL_LOG(DEBUG,
"efd %d associated with vec %d added on epfd %d",
rev->fd, vec, epfd);
- else
- rc = -EPERM;
break;
case RTE_INTR_EVENT_DEL:
epfd_op = EPOLL_CTL_DEL;
@@ -1520,8 +1526,6 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
}
rc = rte_epoll_ctl(rev->epfd, epfd_op, rev->fd, rev);
- if (rc)
- rc = -EPERM;
break;
default:
EAL_LOG(ERR, "event op type mismatch");
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-03 12:55:46.839473800 +0100
+++ 0003-interrupts-propagate-epoll-error.patch 2026-07-03 12:55:46.578571570 +0100
@@ -1 +1 @@
-From 25c7aba07e929da56c105eebb7ec3efaddac4828 Mon Sep 17 00:00:00 2001
+From cb9a57a63f793642434e9098c2eed3bbe36d07e4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 25c7aba07e929da56c105eebb7ec3efaddac4828 ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org
@@ -46 +47 @@
-index 5d0607effe..4cfaeba7fe 100644
+index 14472ee929..1f3f357227 100644
@@ -49 +50 @@
-@@ -1443,7 +1443,7 @@ rte_epoll_ctl(int epfd, int op, int fd,
+@@ -1433,7 +1433,7 @@ rte_epoll_ctl(int epfd, int op, int fd,
@@ -58 +59 @@
-@@ -1460,13 +1460,21 @@ rte_epoll_ctl(int epfd, int op, int fd,
+@@ -1450,13 +1450,21 @@ rte_epoll_ctl(int epfd, int op, int fd,
@@ -82 +83 @@
-@@ -1518,8 +1526,6 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
+@@ -1507,8 +1515,6 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
@@ -91 +92 @@
-@@ -1531,8 +1537,6 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
+@@ -1520,8 +1526,6 @@ rte_intr_rx_ctl(struct rte_intr_handle *intr_handle, int epfd,
More information about the stable
mailing list