patch 'ipc: notify secondary on primary process exit' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:01:05 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/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/1e6dc649af0fc8a01d60b809d9637905bb38d0d1

Thanks.

Kevin

---
>From 1e6dc649af0fc8a01d60b809d9637905bb38d0d1 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 7 May 2026 13:58:37 -0700
Subject: [PATCH] ipc: notify secondary on primary process exit

[ upstream commit 3c09706d51ad64d1011244991a86cc7982612159 ]

When primary process exits, it should notify the secondary
processes. This allows for clean shutdown and eliminates need
for MP handling in applications (such as test-pmd).

Bugzilla ID: 1942
Fixes: 85d6815fa6d0 ("eal: close multi-process socket during cleanup")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/eal/common/eal_common_proc.c | 51 ++++++++++++++++++++++++++++++--
 1 file changed, 49 insertions(+), 2 deletions(-)

diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index 14f818da78..d2aeafca5b 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -61,4 +61,13 @@ enum mp_type {
 };
 
+/* Message sent from primary EAL to secondary EAL */
+#define EAL_MP "mp_eal"
+struct eal_mp_req {
+	enum {
+		MP_REQ_NOP = 0,
+		MP_REQ_QUIT,
+	} type;
+};
+
 struct mp_msg_internal {
 	int type;
@@ -616,4 +625,23 @@ close_socket_fd(int fd)
 }
 
+/* callback in secondary when primary has exited */
+static int
+mp_primary_exited(const struct rte_mp_msg *msg, const void *peer __rte_unused)
+{
+	const struct eal_mp_req *req;
+
+	if (msg->len_param != sizeof(*req)) {
+		EAL_LOG(ERR, "invalid request from primary");
+		return -EINVAL;
+	}
+
+	req = (const struct eal_mp_req *)msg->param;
+	if (req->type == MP_REQ_QUIT)
+		rte_mp_channel_cleanup();
+
+	/* no reply needed */
+	return 0;
+}
+
 int
 rte_mp_channel_init(void)
@@ -658,4 +686,8 @@ rte_mp_channel_init(void)
 	}
 
+	/* listen for quit message from primary */
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		rte_mp_action_register(EAL_MP, mp_primary_exited);
+
 	if (rte_thread_create_internal_control(&mp_handle_tid, "mp-msg",
 			mp_handle, NULL) < 0) {
@@ -679,10 +711,25 @@ rte_mp_channel_cleanup(void)
 	int fd;
 
+	/* Primary exiting, tell all secondary processes */
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		struct rte_mp_msg msg = { .name = EAL_MP };
+		struct eal_mp_req req = { .type = MP_REQ_QUIT };
+
+		memcpy(&msg.param, &req, sizeof(req));
+		msg.len_param = sizeof(req);
+
+		rte_mp_sendmsg(&msg);
+	} else {
+		rte_mp_action_unregister(EAL_MP);
+	}
+
 	fd = rte_atomic_exchange_explicit(&mp_fd, -1, rte_memory_order_relaxed);
 	if (fd < 0)
 		return;
 
-	pthread_cancel((pthread_t)mp_handle_tid.opaque_id);
-	rte_thread_join(mp_handle_tid, NULL);
+	if (pthread_self() != (pthread_t)mp_handle_tid.opaque_id) {
+		pthread_cancel((pthread_t)mp_handle_tid.opaque_id);
+		rte_thread_join(mp_handle_tid, NULL);
+	}
 	close_socket_fd(fd);
 }
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:43.237220513 +0000
+++ 0139-ipc-notify-secondary-on-primary-process-exit.patch	2026-12-03 12:52:39.133093732 +0000
@@ -1 +1 @@
-From 3c09706d51ad64d1011244991a86cc7982612159 Mon Sep 17 00:00:00 2001
+From 1e6dc649af0fc8a01d60b809d9637905bb38d0d1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3c09706d51ad64d1011244991a86cc7982612159 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 5133eaaa47..73c6a53013 100644
+index 14f818da78..d2aeafca5b 100644
@@ -38 +39 @@
-@@ -624,4 +633,23 @@ close_socket_fd(int fd)
+@@ -616,4 +625,23 @@ close_socket_fd(int fd)
@@ -62 +63 @@
-@@ -671,4 +699,8 @@ rte_mp_channel_init(void)
+@@ -658,4 +686,8 @@ rte_mp_channel_init(void)
@@ -71 +72 @@
-@@ -692,10 +724,25 @@ rte_mp_channel_cleanup(void)
+@@ -679,10 +711,25 @@ rte_mp_channel_cleanup(void)



More information about the stable mailing list