patch 'app/testpmd: revert stop forwarding in secondary process' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Tue Oct 27 12:50:08 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 10/29/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/a84edd169396ff61f78e1c5740de68471a0ea642
Thanks.
Luca Boccassi
---
>From a84edd169396ff61f78e1c5740de68471a0ea642 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 7 May 2026 13:58:36 -0700
Subject: [PATCH] app/testpmd: revert stop forwarding in secondary process
[ upstream commit 1cdbcabebb266d503711547954ab312242dd44dc ]
Testpmd must not assume that the secondary process is testpmd.
The notification needs to be done by EAL.
This reverts commit f96273c8e9d39e472bb07acc05e493b1e712e51b.
Bugzilla ID: 1942
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
app/test-pmd/testpmd.c | 103 ++---------------------------------------
1 file changed, 4 insertions(+), 99 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index c292358a904..6a880ecd6a7 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3577,83 +3577,6 @@ detach_devargs(char *identifier)
rte_devargs_reset(&da);
}
-#ifndef RTE_EXEC_ENV_WINDOWS
-
-enum testpmd_req_type {
- TESTPMD_REQ_TYPE_EXIT,
-};
-
-struct testpmd_mp_req {
- enum testpmd_req_type t;
-};
-
-struct testpmd_mp_resp {
- int result;
-};
-
-#define TESTPMD_MP "mp_testpmd"
-
-/* Send reply to this peer when testpmd exits */
-static RTE_ATOMIC(const char *) primary_name;
-
-static void
-reply_to_primary(const char *peer, int result)
-{
- struct rte_mp_msg reply = { };
- struct testpmd_mp_resp *resp = (struct testpmd_mp_resp *) &reply.param;
-
- strlcpy(reply.name, TESTPMD_MP, RTE_MP_MAX_NAME_LEN);
- reply.len_param = sizeof(*resp);
- resp->result = result;
-
- printf("Replying %d to primary\n", result);
- fflush(stdout);
-
- if (rte_mp_reply(&reply, peer) < 0)
- printf("Failed to send response to primary:%s", strerror(rte_errno));
-}
-
-/* Primary process is exiting, stop secondary process */
-static void
-pmd_notify_secondary(void)
-{
- struct testpmd_mp_req request = {
- .t = TESTPMD_REQ_TYPE_EXIT,
- };
- struct rte_mp_msg mp_req = {
- .name = TESTPMD_MP,
- .len_param = sizeof(request),
- };
- struct rte_mp_reply reply;
- struct timespec ts = {.tv_sec = 5, .tv_nsec = 0};
-
- printf("\nPrimary: Sending 'stop_req' request to secondary...\n");
- fflush(stdout);
-
- memcpy(mp_req.param, &request, sizeof(request));
- rte_mp_request_sync(&mp_req, &reply, &ts);
-}
-
-static int
-handle_testpmd_request(const struct rte_mp_msg *request, const void *peer)
-{
- const struct testpmd_mp_req *req = (const struct testpmd_mp_req *)request->param;
-
- if (req->t == TESTPMD_REQ_TYPE_EXIT) {
- printf("\nReceived notification of primary exiting\n");
- fflush(stdout);
-
- /* Response is sent after forwarding loop exits */
- rte_atomic_store_explicit(&primary_name, peer, rte_memory_order_relaxed);
-
- kill(getpid(), SIGINT);
- } else {
- reply_to_primary(peer, -EINVAL);
- }
- return 0;
-}
-#endif
-
void
pmd_test_exit(void)
{
@@ -3665,10 +3588,6 @@ pmd_test_exit(void)
stop_packet_forwarding();
#ifndef RTE_EXEC_ENV_WINDOWS
- /* Tell secondary to exit */
- if (rte_eal_process_type() == RTE_PROC_PRIMARY)
- pmd_notify_secondary();
-
for (i = 0 ; i < RTE_DIM(mempools) ; i++) {
if (mempools[i]) {
if (mp_alloc_type == MP_ALLOC_ANON)
@@ -4451,12 +4370,9 @@ main(int argc, char** argv)
rte_strerror(rte_errno));
#ifndef RTE_EXEC_ENV_WINDOWS
- if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
- if (enable_primary_monitor() < 0)
- rte_exit(EXIT_FAILURE, "Cannot setup primary monitor");
- if (rte_mp_action_register(TESTPMD_MP, handle_testpmd_request) < 0)
- rte_exit(EXIT_FAILURE, "Failed to register message action\n");
- }
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+ enable_primary_monitor() < 0)
+ rte_exit(EXIT_FAILURE, "Cannot setup primary monitor");
#endif
/* allocate port structures, and init them */
@@ -4653,23 +4569,12 @@ main(int argc, char** argv)
}
#ifndef RTE_EXEC_ENV_WINDOWS
- if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY)
disable_primary_monitor();
- rte_mp_action_unregister(TESTPMD_MP);
- }
#endif
pmd_test_exit();
-#ifndef RTE_EXEC_ENV_WINDOWS
- if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
- const char *peer = rte_atomic_exchange_explicit(&primary_name, NULL,
- rte_memory_order_relaxed);
- if (peer)
- reply_to_primary(peer, 0);
- }
-#endif
-
#ifdef RTE_LIB_PDUMP
/* uninitialize packet capture framework */
rte_pdump_uninit();
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-10-27 11:43:58.140933207 +0000
+++ 0114-app-testpmd-revert-stop-forwarding-in-secondary-proc.patch 2026-10-27 11:43:53.646063535 +0000
@@ -1 +1 @@
-From 1cdbcabebb266d503711547954ab312242dd44dc Mon Sep 17 00:00:00 2001
+From a84edd169396ff61f78e1c5740de68471a0ea642 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1cdbcabebb266d503711547954ab312242dd44dc ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index cab2fa1556..d6211a9a8a 100644
+index c292358a904..6a880ecd6a7 100644
@@ -24 +25 @@
-@@ -3729,83 +3729,6 @@ detach_devargs(char *identifier)
+@@ -3577,83 +3577,6 @@ detach_devargs(char *identifier)
@@ -108 +109 @@
-@@ -3817,10 +3740,6 @@ pmd_test_exit(void)
+@@ -3665,10 +3588,6 @@ pmd_test_exit(void)
@@ -119 +120 @@
-@@ -4641,12 +4560,9 @@ main(int argc, char** argv)
+@@ -4451,12 +4370,9 @@ main(int argc, char** argv)
@@ -135 +136 @@
-@@ -4848,23 +4764,12 @@ main(int argc, char** argv)
+@@ -4653,23 +4569,12 @@ main(int argc, char** argv)
More information about the stable
mailing list