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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Feb 23 10:37:08 CET 2023


Hi,

FYI, your patch has been queued to stable release 20.11.8

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/25/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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1

Thanks.

Luca Boccassi

---
>From 7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1 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

[ 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 508f2c4268..f22c05920f 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3898,6 +3898,9 @@ main(int argc, char** argv)
 		rte_exit(EXIT_FAILURE,
 			 "Secondary process type not supported.\n");
 
+	/* 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");
@@ -3916,9 +3919,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.39.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-02-23 09:36:30.831910081 +0000
+++ 0064-app-testpmd-fix-crash-on-cleanup.patch	2023-02-23 09:36:28.350172224 +0000
@@ -1 +1 @@
-From 563fbd084b6b8de866d4fad9582f9eb071e6da0a Mon Sep 17 00:00:00 2001
+From 7dbf8ba3c72dca7b52e60796b5fb7a95258fb1a1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 563fbd084b6b8de866d4fad9582f9eb071e6da0a ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index a6c5dec4c0..0c14325b8d 100644
+index 508f2c4268..f22c05920f 100644
@@ -23,3 +24,3 @@
-@@ -4429,6 +4429,9 @@ main(int argc, char** argv)
- 		rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
- 			 rte_strerror(rte_errno));
+@@ -3898,6 +3898,9 @@ main(int argc, char** argv)
+ 		rte_exit(EXIT_FAILURE,
+ 			 "Secondary process type not supported.\n");
@@ -33 +34 @@
-@@ -4447,9 +4450,6 @@ main(int argc, char** argv)
+@@ -3916,9 +3919,6 @@ main(int argc, char** argv)


More information about the stable mailing list