patch 'eal/linux: handle interrupt epoll events' has been queued to stable release 23.11.7
Shani Peretz
shperetz at nvidia.com
Wed Apr 15 11:59:06 CEST 2026
Hi,
FYI, your patch has been queued to stable release 23.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 04/19/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/shanipr/dpdk-stable
This queued commit can be viewed at:
https://github.com/shanipr/dpdk-stable/commit/6d5dd6b14fddaab6270d8520c0121138ba28f6e8
Thanks.
Shani
---
>From 6d5dd6b14fddaab6270d8520c0121138ba28f6e8 Mon Sep 17 00:00:00 2001
From: Kevin Traynor <ktraynor at redhat.com>
Date: Tue, 3 Mar 2026 18:58:16 +0000
Subject: [PATCH] eal/linux: handle interrupt epoll events
[ upstream commit 1c0a74161a2c96a24e986e454bb58f4e11b0d6e6 ]
Add handling for epoll error and disconnect conditions EPOLLERR,
EPOLLHUP and EPOLLRDHUP.
These events indicate that the interrupt file descriptor is in
an error state or there has been a hangup.
Only do this for interrupts that are read in eal. Interrupts that
are read outside eal should deal with disconnect/error events
appropriate to their functionality. e.g. virtio interrupt handling
has reconnect mechanisms for some cases.
Also, treat no bytes read as an error condition.
Bugzilla ID: 1873
Fixes: af75078fece3 ("first public release")
Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
Acked-by: David Marchand <david.marchand at redhat.com>
Acked-by: Stephen Hemminger <stephen at networkplumber.org>
---
lib/eal/linux/eal_interrupts.c | 72 ++++++++++++++++++++++------------
1 file changed, 46 insertions(+), 26 deletions(-)
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index eabac24992..4d0563fe2f 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -894,6 +894,28 @@ out:
return rc;
}
+static void
+eal_intr_source_remove_and_free(struct rte_intr_source *src)
+{
+ struct rte_intr_callback *cb, *next;
+
+ /* Remove the interrupt source */
+ rte_spinlock_lock(&intr_lock);
+ TAILQ_REMOVE(&intr_sources, src, next);
+ rte_spinlock_unlock(&intr_lock);
+
+ /* Free callbacks */
+ for (cb = TAILQ_FIRST(&src->callbacks); cb; cb = next) {
+ next = TAILQ_NEXT(cb, next);
+ TAILQ_REMOVE(&src->callbacks, cb, next);
+ free(cb);
+ }
+
+ /* Free the interrupt source */
+ rte_intr_instance_free(src->intr_handle);
+ free(src);
+}
+
static int
eal_intr_process_interrupts(struct epoll_event *events, int nfds)
{
@@ -963,42 +985,40 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
}
if (bytes_read > 0) {
- /**
+ /*
+ * Check for epoll error or disconnect events for
+ * interrupts that are read directly in eal.
+ */
+ if (events[n].events & (EPOLLERR | EPOLLHUP | EPOLLRDHUP)) {
+ RTE_LOG(ERR, EAL, "Disconnect condition on fd %d "
+ "(events=0x%x), removing from epoll",
+ events[n].data.fd, events[n].events);
+ eal_intr_source_remove_and_free(src);
+ return -1;
+ }
+
+ /*
* read out to clear the ready-to-be-read flag
* for epoll_wait.
*/
bytes_read = read(events[n].data.fd, &buf, bytes_read);
- if (bytes_read < 0) {
+ if (bytes_read > 0) {
+ call = true;
+ } else if (bytes_read < 0) {
if (errno == EINTR || errno == EWOULDBLOCK)
continue;
- RTE_LOG(ERR, EAL, "Error reading from file "
- "descriptor %d: %s\n",
+ RTE_LOG(ERR, EAL, "Error reading from file descriptor %d: %s\n",
events[n].data.fd,
strerror(errno));
- /*
- * The device is unplugged or buggy, remove
- * it as an interrupt source and return to
- * force the wait list to be rebuilt.
- */
- rte_spinlock_lock(&intr_lock);
- TAILQ_REMOVE(&intr_sources, src, next);
- rte_spinlock_unlock(&intr_lock);
-
- for (cb = TAILQ_FIRST(&src->callbacks); cb;
- cb = next) {
- next = TAILQ_NEXT(cb, next);
- TAILQ_REMOVE(&src->callbacks, cb, next);
- free(cb);
- }
- rte_intr_instance_free(src->intr_handle);
- free(src);
+ } else {
+ RTE_LOG(ERR, EAL, "Read nothing from file descriptor %d",
+ events[n].data.fd);
+ }
+ if (bytes_read <= 0) {
+ eal_intr_source_remove_and_free(src);
return -1;
- } else if (bytes_read == 0)
- RTE_LOG(ERR, EAL, "Read nothing from file "
- "descriptor %d\n", events[n].data.fd);
- else
- call = true;
+ }
}
/* grab a lock, again to call callbacks and update status. */
--
2.43.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-04-14 14:44:29.386528876 +0300
+++ 0005-eal-linux-handle-interrupt-epoll-events.patch 2026-04-14 14:44:28.380404000 +0300
@@ -1 +1 @@
-From 1c0a74161a2c96a24e986e454bb58f4e11b0d6e6 Mon Sep 17 00:00:00 2001
+From 6d5dd6b14fddaab6270d8520c0121138ba28f6e8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1c0a74161a2c96a24e986e454bb58f4e11b0d6e6 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index 9db978923a..f3f6bdd01d 100644
+index eabac24992..4d0563fe2f 100644
@@ -34 +35 @@
-@@ -886,6 +886,28 @@ out:
+@@ -894,6 +894,28 @@ out:
@@ -63 +64 @@
-@@ -951,42 +973,40 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
+@@ -963,42 +985,40 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
@@ -73 +74 @@
-+ EAL_LOG(ERR, "Disconnect condition on fd %d "
++ RTE_LOG(ERR, EAL, "Disconnect condition on fd %d "
@@ -92,3 +93,3 @@
-- EAL_LOG(ERR, "Error reading from file "
-- "descriptor %d: %s",
-+ EAL_LOG(ERR, "Error reading from file descriptor %d: %s",
+- RTE_LOG(ERR, EAL, "Error reading from file "
+- "descriptor %d: %s\n",
++ RTE_LOG(ERR, EAL, "Error reading from file descriptor %d: %s\n",
@@ -115 +116 @@
-+ EAL_LOG(ERR, "Read nothing from file descriptor %d",
++ RTE_LOG(ERR, EAL, "Read nothing from file descriptor %d",
@@ -122,2 +123,2 @@
-- EAL_LOG(ERR, "Read nothing from file "
-- "descriptor %d", events[n].data.fd);
+- RTE_LOG(ERR, EAL, "Read nothing from file "
+- "descriptor %d\n", events[n].data.fd);
More information about the stable
mailing list