From: Dengdui Huang <huangdengdui@huawei.com>
To: <dev@dpdk.org>
Cc: <honest.jiang@foxmail.com>, <fengchengwen@huawei.com>,
<roretzla@linux.microsoft.com>, <lihuisong@huawei.com>,
<haijie1@huawei.com>, <liuyonglong@huawei.com>,
<stephen@networkplumber.org>
Subject: [PATCH v2 2/2] app/dma-perf: fix infinite loop
Date: Thu, 27 Mar 2025 17:01:16 +0800 [thread overview]
Message-ID: <20250327090116.3357137-3-huangdengdui@huawei.com> (raw)
In-Reply-To: <20250327090116.3357137-1-huangdengdui@huawei.com>
When a core that is not used by the rte is specified in the config
for testing, the problem of infinite loop occurs. This patch fix it
by adding a check for lcore_id.
Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test")
Cc: stable@dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
app/test-dma-perf/main.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c
index 0586b3e1d0..1365456dd1 100644
--- a/app/test-dma-perf/main.c
+++ b/app/test-dma-perf/main.c
@@ -523,7 +523,7 @@ main(int argc, char *argv[])
{
int ret;
uint16_t case_nb;
- uint32_t i, nb_lcores;
+ uint32_t i, j, nb_lcores, lcore;
pid_t cpid, wpid;
int wstatus;
char args[MAX_EAL_PARAM_NB][MAX_EAL_PARAM_LEN];
@@ -603,6 +603,12 @@ main(int argc, char *argv[])
if (nb_lcores < 2)
rte_exit(EXIT_FAILURE,
"There should be at least 2 worker lcores.\n");
+ for (j = 0; j < test_cases[i].num_worker; j++) {
+ lcore = test_cases[i].dma_config[j].lcore_dma_map.lcore;
+ if (!rte_lcore_has_role(lcore, ROLE_RTE))
+ rte_exit(EXIT_FAILURE,
+ "Worker lcore %u not enabled in EAL\n", lcore);
+ }
fd = fopen(rst_path_ptr, "a");
if (!fd) {
--
2.33.0
prev parent reply other threads:[~2025-03-27 9:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 4:03 [PATCH 0/2] fix the problem of dma-perf " Dengdui Huang
2025-03-21 4:03 ` [PATCH 1/2] eal: fix wake a incorrect lcore Dengdui Huang
2025-03-21 4:03 ` [PATCH 2/2] app/dma-perf: fix infinite loop Dengdui Huang
2025-03-21 15:58 ` Stephen Hemminger
2025-03-24 3:42 ` huangdengdui
2025-03-21 7:49 ` [PATCH 0/2] fix the problem of dma-perf " David Marchand
2025-03-24 3:42 ` huangdengdui
2025-03-27 8:58 ` [PATCH] app/dma-perf: fix " Dengdui Huang
2025-03-27 8:58 ` [PATCH 1/2] eal: fix uncheck worker ID Dengdui Huang
2025-03-27 8:58 ` [PATCH 2/2] app/dma-perf: fix infinite loop Dengdui Huang
2025-03-27 9:01 ` [PATCH v2 0/2] fix the problem of dma-perf " Dengdui Huang
2025-03-27 9:01 ` [PATCH v2 1/2] eal: fix uncheck worker ID Dengdui Huang
2025-03-27 9:32 ` Morten Brørup
2025-03-27 9:01 ` Dengdui Huang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250327090116.3357137-3-huangdengdui@huawei.com \
--to=huangdengdui@huawei.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=haijie1@huawei.com \
--cc=honest.jiang@foxmail.com \
--cc=lihuisong@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=roretzla@linux.microsoft.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).