patch 'app/testpmd: fix crash on cleanup' has been queued to stable release 22.11.2

Xueming Li xuemingl at nvidia.com
Mon Feb 27 08:00:56 CET 2023


Hi,

FYI, your patch has been queued to stable release 22.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/01/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=38465cec0aaeb7a171a8520b7a6c71b7e3f71f8e

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 38465cec0aaeb7a171a8520b7a6c71b7e3f71f8e Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Mon, 6 Feb 2023 16:49:46 +0100
Subject: [PATCH] app/testpmd: fix crash on cleanup
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ]

If allocating the ports[] array fails, a crash will occur when shutting
down testpmd since ethdev emits RTE_ETH_EVENT_DESTROY events.
Move init_port() before registering ethdev event handler.

Fixes: 85c6571c9103 ("app/testpmd: reset port status on close notification")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Aman Singh <aman.deep.singh at intel.com>
---
 app/test-pmd/testpmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 538609d890..adf19cfb9e 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -4392,6 +4392,9 @@ main(int argc, char** argv)
 		rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
 			 rte_strerror(rte_errno));

+	/* allocate port structures, and init them */
+	init_port();
+
 	ret = register_eth_event_callback();
 	if (ret != 0)
 		rte_exit(EXIT_FAILURE, "Cannot register for ethdev events");
@@ -4410,9 +4413,6 @@ main(int argc, char** argv)
 	if (nb_ports == 0)
 		TESTPMD_LOG(WARNING, "No probed ethernet devices\n");

-	/* allocate port structures, and init them */
-	init_port();
-
 	set_def_fwd_config();
 	if (nb_lcores == 0)
 		rte_exit(EXIT_FAILURE, "No cores defined for forwarding\n"
--
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-27 14:08:45.611425100 +0800
+++ 0149-app-testpmd-fix-crash-on-cleanup.patch	2023-02-27 14:08:40.959237000 +0800
@@ -1 +1 @@
-From 563fbd084b6b8de866d4fad9582f9eb071e6da0a Mon Sep 17 00:00:00 2001
+From 38465cec0aaeb7a171a8520b7a6c71b7e3f71f8e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index a6c5dec4c0..0c14325b8d 100644
+index 538609d890..adf19cfb9e 100644
@@ -23 +25 @@
-@@ -4429,6 +4429,9 @@ main(int argc, char** argv)
+@@ -4392,6 +4392,9 @@ main(int argc, char** argv)
@@ -33 +35 @@
-@@ -4447,9 +4450,6 @@ main(int argc, char** argv)
+@@ -4410,9 +4413,6 @@ main(int argc, char** argv)


More information about the stable mailing list