[dpdk-stable] patch 'examples/eventdev: move ethdev stop to the end' has been queued to stable release 19.11.7

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Feb 4 12:29:52 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.7

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/06/21. 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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/035f49dfbe9e01643084bf5b38fc1c89f8650d26

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 035f49dfbe9e01643084bf5b38fc1c89f8650d26 Mon Sep 17 00:00:00 2001
From: Feifei Wang <feifei.wang2 at arm.com>
Date: Thu, 14 Jan 2021 18:31:01 +0800
Subject: [PATCH] examples/eventdev: move ethdev stop to the end

[ upstream commit f3527e0b97ae4adf2e1871e6f67b17968b4a9486 ]

Move eth stop code from "signal_handler" function to the end of "main"
function. There are two reasons for this:

First, this improves code maintenance and makes code look simple and
clear. Based on this change, after receiving the interrupt signal,
"fdata->done" is set as 1. Then the main thread will wait all worker
lcores to jump out of the loop. Finally, the main thread will stop and
then close eth dev port.

Second, for older version, the main thread first stops eth dev port and
then waits the end of worker lcore. This may cause errors because it may
stop the eth dev port which worker lcores are using. This moving change
can fix this by waiting all worker threads to exit and then stop the
eth dev port.

In the meanwhile, remove wmb in signal_handler.

This is because when the main lcore receive the stop signal, it stores 1
into fdata->done. And then the worker lcores load "fdata->done" and jump
out of the loop to stop running. Nothing should be stored after updating
fdata->done, so the wmb is unnecessary.

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

Suggested-by: Ruifeng Wang <ruifeng.wang at arm.com>
Signed-off-by: Feifei Wang <feifei.wang2 at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
Acked-by: Harry van Haaren <harry.van.haaren at intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
---
 examples/eventdev_pipeline/main.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 71ee586c9a..a3eeb50a75 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -313,7 +313,6 @@ static void
 signal_handler(int signum)
 {
 	static uint8_t once;
-	uint16_t portid;
 
 	if (fdata->done)
 		rte_exit(1, "Exiting on signal %d\n", signum);
@@ -324,16 +323,6 @@ signal_handler(int signum)
 			rte_event_dev_dump(0, stdout);
 		once = 1;
 		fdata->done = 1;
-		rte_smp_wmb();
-
-		RTE_ETH_FOREACH_DEV(portid) {
-			rte_event_eth_rx_adapter_stop(portid);
-			rte_event_eth_tx_adapter_stop(portid);
-			rte_eth_dev_stop(portid);
-		}
-
-		rte_eal_mp_wait_lcore();
-
 	}
 	if (signum == SIGTSTP)
 		rte_event_dev_dump(0, stdout);
@@ -484,6 +473,9 @@ main(int argc, char **argv)
 	}
 
 	RTE_ETH_FOREACH_DEV(portid) {
+		rte_event_eth_rx_adapter_stop(portid);
+		rte_event_eth_tx_adapter_stop(portid);
+		rte_eth_dev_stop(portid);
 		rte_eth_dev_close(portid);
 	}
 
-- 
2.30.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-04 12:04:33.554167262 +0100
+++ 0137-examples-eventdev-move-ethdev-stop-to-the-end.patch	2021-02-04 12:04:28.206789899 +0100
@@ -1 +1 @@
-From f3527e0b97ae4adf2e1871e6f67b17968b4a9486 Mon Sep 17 00:00:00 2001
+From 035f49dfbe9e01643084bf5b38fc1c89f8650d26 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f3527e0b97ae4adf2e1871e6f67b17968b4a9486 ]
+
@@ -29 +30,0 @@
-Cc: stable at dpdk.org
@@ -38,2 +39,2 @@
- examples/eventdev_pipeline/main.c | 16 ++++------------
- 1 file changed, 4 insertions(+), 12 deletions(-)
+ examples/eventdev_pipeline/main.c | 14 +++-----------
+ 1 file changed, 3 insertions(+), 11 deletions(-)
@@ -42 +43 @@
-index 9982d5bfb0..3dbef6ed45 100644
+index 71ee586c9a..a3eeb50a75 100644
@@ -53 +54 @@
-@@ -324,17 +323,6 @@ signal_handler(int signum)
+@@ -324,16 +323,6 @@ signal_handler(int signum)
@@ -62,2 +63 @@
--			if (rte_eth_dev_stop(portid) < 0)
--				printf("Failed to stop port %u", portid);
+-			rte_eth_dev_stop(portid);
@@ -71 +71 @@
-@@ -485,6 +473,10 @@ main(int argc, char **argv)
+@@ -484,6 +473,9 @@ main(int argc, char **argv)
@@ -77,2 +77 @@
-+		if (rte_eth_dev_stop(portid) < 0)
-+			printf("Failed to stop port %u", portid);
++		rte_eth_dev_stop(portid);


More information about the stable mailing list