[dpdk-stable] patch 'examples/eventdev: check CPU core enabling' has been queued to stable release 19.11.7

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Feb 4 12:29:51 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/02a5ce6b4b7d1eefb8bd1378e09b4c22f4099106

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 02a5ce6b4b7d1eefb8bd1378e09b4c22f4099106 Mon Sep 17 00:00:00 2001
From: Feifei Wang <feifei.wang2 at arm.com>
Date: Thu, 14 Jan 2021 18:30:59 +0800
Subject: [PATCH] examples/eventdev: check CPU core enabling

[ upstream commit 3d15913432f12a2abcaa00122502eb944feeeb29 ]

In the case that the cores are isolated, if "-l" or "-c" parameter is not
added, the cores will not be enabled and can not launch worker function
correctly. In the meanwhile, no error information is reported.

For example:
totally CPUs:16
isolated CPUs:1-8
command: sudo gdb -args ./dpdk-eventdev_pipeline --vdev event_sw0 \
        -- -r1 -t1 -e4 -w F00 -s4 -n0 -c32 -W1000 -D

cores information:
rte_config->lcore_role = {ROLE_RTE, ROLE_OFF, ROLE_OFF, ROLE_OFF,
                          ROLE_OFF, ROLE_OFF, ROLE_OFF, ROLE_OFF,
                          ROLE_OFF, ROLE_RTE, ROLE_RTE, ROLE_RTE,
                          ROLE_RTE, ROLE_RTE, ROLE_RTE, ROLE_RTE}

output information:
...
[main()] lcore 9 executing worker, using eventdev port 0
[main()] lcore 10 executing worker, using eventdev port 1
[main()] lcore 11 executing worker, using eventdev port 2

This is because "RTE_LCORE_FOREACH_WORKER" chooses the enabled core. In
the case that the cores are isolated, "the lcore_role" flag of isolated
cores are set as "ROLE_OFF" by default(not enabled). So if we choose
these isolated cores as workers, "RTE_LCORE_FOREACH_WORKER" will ignore
these cores and not launch worker functions on them.

To fix this, add "-l" parameters to doc and add lcore enabled check.

Fixes: 1094ca96689c ("doc: add SW eventdev pipeline to sample app guide")

Signed-off-by: Feifei Wang <feifei.wang2 at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
---
 doc/guides/sample_app_ug/eventdev_pipeline.rst | 4 +++-
 examples/eventdev_pipeline/main.c              | 9 ++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/doc/guides/sample_app_ug/eventdev_pipeline.rst b/doc/guides/sample_app_ug/eventdev_pipeline.rst
index dc7972aa9a..24fb23b898 100644
--- a/doc/guides/sample_app_ug/eventdev_pipeline.rst
+++ b/doc/guides/sample_app_ug/eventdev_pipeline.rst
@@ -34,6 +34,7 @@ options.
 An example eventdev pipeline running with the software eventdev PMD using
 these settings is shown below:
 
+ * ``-l 0,2,8-15``: lcore to use
  * ``-r1``: core mask 0x1 for RX
  * ``-t1``: core mask 0x1 for TX
  * ``-e4``: core mask 0x4 for the software scheduler
@@ -46,7 +47,8 @@ these settings is shown below:
 
 .. code-block:: console
 
-    ./build/eventdev_pipeline --vdev event_sw0 -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
+    ./build/eventdev_pipeline --vdev event_sw0 -l 0,2,8-15 -- -r1 -t1 \
+    -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
 
 The application has some sanity checking built-in, so if there is a function
 (e.g.; the RX core) which doesn't have a cpu core mask assigned, the application
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 6fc7c86dc9..71ee586c9a 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -265,8 +265,15 @@ parse_app_args(int argc, char **argv)
 
 		if (fdata->worker_core[i])
 			cdata.num_workers++;
-		if (core_in_use(i))
+		if (core_in_use(i)) {
+			if (!rte_lcore_is_enabled(i)) {
+				printf("lcore %d is not enabled in lcore list\n",
+					i);
+				rte_exit(EXIT_FAILURE,
+					"check lcore params failed\n");
+			}
 			cdata.active_cores++;
+		}
 	}
 }
 
-- 
2.30.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-04 12:04:33.513789100 +0100
+++ 0136-examples-eventdev-check-CPU-core-enabling.patch	2021-02-04 12:04:28.206789899 +0100
@@ -1 +1 @@
-From 3d15913432f12a2abcaa00122502eb944feeeb29 Mon Sep 17 00:00:00 2001
+From 02a5ce6b4b7d1eefb8bd1378e09b4c22f4099106 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3d15913432f12a2abcaa00122502eb944feeeb29 ]
+
@@ -37 +38,0 @@
-Cc: stable at dpdk.org
@@ -42 +43 @@
- doc/guides/sample_app_ug/eventdev_pipeline.rst | 5 +++--
+ doc/guides/sample_app_ug/eventdev_pipeline.rst | 4 +++-
@@ -44 +45 @@
- 2 files changed, 11 insertions(+), 3 deletions(-)
+ 2 files changed, 11 insertions(+), 2 deletions(-)
@@ -47 +48 @@
-index 4508c3dcc8..19ff53803e 100644
+index dc7972aa9a..24fb23b898 100644
@@ -58 +59 @@
-@@ -46,8 +47,8 @@ these settings is shown below:
+@@ -46,7 +47,8 @@ these settings is shown below:
@@ -62,4 +63,3 @@
--    ./<build_dir>/examples/dpdk-eventdev_pipeline --vdev event_sw0 -- -r1 -t1 \
--    -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
-+    ./<build_dir>/examples/dpdk-eventdev_pipeline -l 0,2,8-15 --vdev event_sw0 \
-+    -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
+-    ./build/eventdev_pipeline --vdev event_sw0 -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
++    ./build/eventdev_pipeline --vdev event_sw0 -l 0,2,8-15 -- -r1 -t1 \
++    -e4 -w FF00 -s4 -n0 -c32 -W1000 -D
@@ -70 +70 @@
-index 823f8b51c2..ae50591b88 100644
+index 6fc7c86dc9..71ee586c9a 100644
@@ -73 +73 @@
-@@ -239,8 +239,15 @@ parse_app_args(int argc, char **argv)
+@@ -265,8 +265,15 @@ parse_app_args(int argc, char **argv)


More information about the stable mailing list