DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: stable@dpdk.org, Song Jiale <songx.jiale@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Maayan Kashani <mkashani@nvidia.com>
Subject: [PATCH] examples/multi_process: revert ports cleanup on exit
Date: Tue, 15 Jul 2025 14:11:10 +0200	[thread overview]
Message-ID: <20250715121111.156639-1-thomas@monjalon.net> (raw)

When closing the primary process, an error occurs when closing ports:

Error closing ports
EAL: failed to send to (/var/run/dpdk/dpdk_X/mp_socket_Y) due to Bad file descriptor
EAL: Fail to send request /var/run/dpdk/dpdk_X/mp_socket_Y:mp_malloc_sync
EAL: Could not send sync request to secondary process

And the secondary process crashes.

It may show several problems to fix in the next release.
Revert the fix causing these issues for 25.07 release.

Bugzilla ID: 1751
Fixes: 4382d58097b4 ("examples/multi_process: fix ports cleanup on exit")
Cc: stable@dpdk.org

Reported-by: Song Jiale <songx.jiale@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 examples/multi_process/symmetric_mp/main.c | 27 ++++------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index de16608a0f..f7d8439cd4 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -92,25 +92,6 @@ smp_usage(const char *prgname, const char *errmsg)
 	exit(1);
 }
 
-static void
-exit_cleanup(void)
-{
-	unsigned int i;
-
-	RTE_LOG(INFO, APP, "Close ports.\n");
-	for (i = 0; i < num_ports; i++) {
-		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-			if (rte_eth_dev_stop(ports[i]))
-				rte_exit(EXIT_FAILURE, "Error stopping ports\n");
-			if (rte_eth_dev_close(ports[i]))
-				rte_exit(EXIT_FAILURE, "Error closing ports\n");
-		}
-	}
-
-	/* clean up the EAL */
-	rte_eal_cleanup();
-	exit(0);
-}
 
 /* signal handler configured for SIGTERM and SIGINT to print stats on exit */
 static void
@@ -123,10 +104,9 @@ print_stats(int signum)
 		printf("Port %u: RX - %u, TX - %u, Drop - %u\n", (unsigned)p_num,
 				pstats[p_num].rx, pstats[p_num].tx, pstats[p_num].drop);
 	}
-	exit_cleanup();
+	exit(0);
 }
 
-
 /* Parse the argument given in the command line of the application */
 static int
 smp_parse_args(int argc, char **argv)
@@ -506,5 +486,8 @@ main(int argc, char **argv)
 
 	rte_eal_mp_remote_launch(lcore_main, NULL, CALL_MAIN);
 
-	exit_cleanup();
+	/* clean up the EAL */
+	rte_eal_cleanup();
+
+	return 0;
 }
-- 
2.47.1


                 reply	other threads:[~2025-07-15 12:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250715121111.156639-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=mkashani@nvidia.com \
    --cc=songx.jiale@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).