From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 65C9CA0A02 for ; Thu, 14 Jan 2021 11:31:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55B0C1410E2; Thu, 14 Jan 2021 11:31:18 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 40E481410E2; Thu, 14 Jan 2021 11:31:16 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC1351FB; Thu, 14 Jan 2021 02:31:15 -0800 (PST) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.127]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B99D23F70D; Thu, 14 Jan 2021 02:31:12 -0800 (PST) From: Feifei Wang To: Harry van Haaren , David Hunt , Jerin Jacob , John McNamara Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , stable@dpdk.org, Ruifeng Wang Date: Thu, 14 Jan 2021 18:30:59 +0800 Message-Id: <20210114103101.738262-2-feifei.wang2@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210114103101.738262-1-feifei.wang2@arm.com> References: <20201221053454.47307-1-feifei.wang2@arm.com> <20210114103101.738262-1-feifei.wang2@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH v4 1/3] doc: fix core enabled bug for eventdev pipeline example X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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") Cc: harry.van.haaren@intel.com Cc: stable@dpdk.org Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang --- doc/guides/sample_app_ug/eventdev_pipeline.rst | 5 +++-- examples/eventdev_pipeline/main.c | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/guides/sample_app_ug/eventdev_pipeline.rst b/doc/guides/sample_app_ug/eventdev_pipeline.rst index 4508c3dcc..19ff53803 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,8 +47,8 @@ these settings is shown below: .. code-block:: console - .//examples/dpdk-eventdev_pipeline --vdev event_sw0 -- -r1 -t1 \ - -e4 -w FF00 -s4 -n0 -c32 -W1000 -D + .//examples/dpdk-eventdev_pipeline -l 0,2,8-15 --vdev event_sw0 \ + -- -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 823f8b51c..e9a591134 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -239,8 +239,13 @@ 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("error: lcore %d is not enabled in lcore list\n", i); + rte_exit(EXIT_FAILURE, "check lcore params failed\n"); + } cdata.active_cores++; + } } } -- 2.25.1