[dpdk-stable] patch 'examples/eventdev: fix crash on exit' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:05:03 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

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

Thanks.

Luca Boccassi

---
>From 2cb05361578d6ecb0b8517cb27e8d9974528b267 Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren at intel.com>
Date: Tue, 5 May 2020 10:39:04 +0100
Subject: [PATCH] examples/eventdev: fix crash on exit

[ upstream commit 2c434431f47c55e63b91cd32e7476cb8c15f3328 ]

This commit fixes a segfault on exit by using Ctrl^C if the master lcore
was also being used as a worker core. The root cause of the issue was
that the interrupt handler was cleaning up resources such as the ethdev
and eventdev ports, and once the interrupt handler would return, that
thread would continue working as an eventdev worker, and dereference the
memory which just had free() called on it.

Fixed by moving the cleanup code from the interrupt handler to the
cleanup stage of main(), which the master thread will execute once
it has returned from its worker() functionality.

Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter")

Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
Tested-by: Jun W Zhou <junx.w.zhou at intel.com>
---
 examples/eventdev_pipeline/main.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index d0da51b1c9..21958269f7 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -301,12 +301,6 @@ signal_handler(int signum)
 
 		rte_eal_mp_wait_lcore();
 
-		RTE_ETH_FOREACH_DEV(portid) {
-			rte_eth_dev_close(portid);
-		}
-
-		rte_event_dev_stop(0);
-		rte_event_dev_close(0);
 	}
 	if (signum == SIGTSTP)
 		rte_event_dev_dump(0, stdout);
@@ -469,5 +463,14 @@ main(int argc, char **argv)
 
 	}
 
+	RTE_ETH_FOREACH_DEV(portid) {
+		rte_eth_dev_close(portid);
+	}
+
+	rte_event_dev_stop(0);
+	rte_event_dev_close(0);
+
+	rte_eal_cleanup();
+
 	return 0;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:51.359060969 +0100
+++ 0168-examples-eventdev-fix-crash-on-exit.patch	2020-05-19 14:04:44.512653738 +0100
@@ -1,8 +1,10 @@
-From 2c434431f47c55e63b91cd32e7476cb8c15f3328 Mon Sep 17 00:00:00 2001
+From 2cb05361578d6ecb0b8517cb27e8d9974528b267 Mon Sep 17 00:00:00 2001
 From: Harry van Haaren <harry.van.haaren at intel.com>
 Date: Tue, 5 May 2020 10:39:04 +0100
 Subject: [PATCH] examples/eventdev: fix crash on exit
 
+[ upstream commit 2c434431f47c55e63b91cd32e7476cb8c15f3328 ]
+
 This commit fixes a segfault on exit by using Ctrl^C if the master lcore
 was also being used as a worker core. The root cause of the issue was
 that the interrupt handler was cleaning up resources such as the ethdev
@@ -15,7 +17,6 @@
 it has returned from its worker() functionality.
 
 Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter")
-Cc: stable at dpdk.org
 
 Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
 Tested-by: Jun W Zhou <junx.w.zhou at intel.com>


More information about the stable mailing list