* [PATCH 0/2] fix the problem of dma-perf infinite loop
@ 2025-03-21 4:03 Dengdui Huang
2025-03-21 4:03 ` [PATCH 1/2] eal: fix wake a incorrect lcore Dengdui Huang
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dengdui Huang @ 2025-03-21 4:03 UTC (permalink / raw)
To: dev
Cc: honest.jiang, fengchengwen, roretzla, lihuisong, haijie1,
liuyonglong, stephen
After CPU isolation is configured, an infinite loop occurs when
dma-perf is executed using the default config file.
This patchset fix it.
Dengdui Huang (2):
eal: fix wake a incorrect lcore
app/dma-perf: fix infinite loop
app/test-dma-perf/benchmark.c | 5 ++++-
lib/eal/unix/eal_unix_thread.c | 3 +++
lib/eal/windows/eal_thread.c | 3 +++
3 files changed, 10 insertions(+), 1 deletion(-)
--
2.33.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] eal: fix wake a incorrect lcore
2025-03-21 4:03 [PATCH 0/2] fix the problem of dma-perf infinite loop Dengdui Huang
@ 2025-03-21 4:03 ` Dengdui Huang
2025-03-21 4:03 ` [PATCH 2/2] app/dma-perf: fix infinite loop Dengdui Huang
2025-03-21 7:49 ` [PATCH 0/2] fix the problem of dma-perf " David Marchand
2 siblings, 0 replies; 5+ messages in thread
From: Dengdui Huang @ 2025-03-21 4:03 UTC (permalink / raw)
To: dev
Cc: honest.jiang, fengchengwen, roretzla, lihuisong, haijie1,
liuyonglong, stephen
If the core is not used in the rte, we can't wake it up to work.
The worker_id may come from user input. So it is necessary to
verify it.
Fixes: a95d70547c57 ("eal: factorize lcore main loop")
Cc: stable@dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
lib/eal/unix/eal_unix_thread.c | 3 +++
lib/eal/windows/eal_thread.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/lib/eal/unix/eal_unix_thread.c b/lib/eal/unix/eal_unix_thread.c
index ef6cbff0ee..103571cabf 100644
--- a/lib/eal/unix/eal_unix_thread.c
+++ b/lib/eal/unix/eal_unix_thread.c
@@ -17,6 +17,9 @@ eal_thread_wake_worker(unsigned int worker_id)
char c = 0;
int n;
+ if (m2w == 0 || w2m == 0)
+ return -EINVAL;
+
do {
n = write(m2w, &c, 1);
} while (n == 0 || (n < 0 && errno == EINTR));
diff --git a/lib/eal/windows/eal_thread.c b/lib/eal/windows/eal_thread.c
index 9e3df200b9..82bb974868 100644
--- a/lib/eal/windows/eal_thread.c
+++ b/lib/eal/windows/eal_thread.c
@@ -24,6 +24,9 @@ eal_thread_wake_worker(unsigned int worker_id)
char c = 0;
int n;
+ if (m2w == 0 || w2m == 0)
+ return -EINVAL;
+
do {
n = _write(m2w, &c, 1);
} while (n == 0 || (n < 0 && errno == EINTR));
--
2.33.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] app/dma-perf: fix infinite loop
2025-03-21 4:03 [PATCH 0/2] fix the problem of dma-perf infinite loop Dengdui Huang
2025-03-21 4:03 ` [PATCH 1/2] eal: fix wake a incorrect lcore Dengdui Huang
@ 2025-03-21 4:03 ` Dengdui Huang
2025-03-21 15:58 ` Stephen Hemminger
2025-03-21 7:49 ` [PATCH 0/2] fix the problem of dma-perf " David Marchand
2 siblings, 1 reply; 5+ messages in thread
From: Dengdui Huang @ 2025-03-21 4:03 UTC (permalink / raw)
To: dev
Cc: honest.jiang, fengchengwen, roretzla, lihuisong, haijie1,
liuyonglong, stephen
When a core that is not used by the rte is specified in the config
for testing, the problem of infinite loop occurs. The root cause
is that the program waits for the completion of the test task when
the test worker fails to be started on the lcore. This patch fix it.
Fixes: 533d7e7f66f3 ("app/dma-perf: support config per device")
Cc: stable@dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
app/test-dma-perf/benchmark.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
index 6d617ea200..351c1c966e 100644
--- a/app/test-dma-perf/benchmark.c
+++ b/app/test-dma-perf/benchmark.c
@@ -751,7 +751,10 @@ mem_copy_benchmark(struct test_configure *cfg)
goto out;
}
- rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id);
+ if (rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id)) {
+ printf("Error: Fail to start the test on lcore %d\n", lcore_id);
+ goto out;
+ }
}
while (1) {
--
2.33.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] fix the problem of dma-perf infinite loop
2025-03-21 4:03 [PATCH 0/2] fix the problem of dma-perf infinite loop 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 7:49 ` David Marchand
2 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2025-03-21 7:49 UTC (permalink / raw)
To: Dengdui Huang
Cc: dev, honest.jiang, fengchengwen, roretzla, lihuisong, haijie1,
liuyonglong, stephen
On Fri, Mar 21, 2025 at 5:03 AM Dengdui Huang <huangdengdui@huawei.com> wrote:
>
> After CPU isolation is configured, an infinite loop occurs when
> dma-perf is executed using the default config file.
>
> This patchset fix it.
>
> Dengdui Huang (2):
> eal: fix wake a incorrect lcore
> app/dma-perf: fix infinite loop
>
> app/test-dma-perf/benchmark.c | 5 ++++-
> lib/eal/unix/eal_unix_thread.c | 3 +++
> lib/eal/windows/eal_thread.c | 3 +++
> 3 files changed, 10 insertions(+), 1 deletion(-)
We can make EAL launch API more resilient, but the dma-perf
application should not post jobs on non sense lcore id, in the first
place.
parse_lcore() should be validating that the requested lcore_id is valid.
--
David Marchand
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] app/dma-perf: fix infinite loop
2025-03-21 4:03 ` [PATCH 2/2] app/dma-perf: fix infinite loop Dengdui Huang
@ 2025-03-21 15:58 ` Stephen Hemminger
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2025-03-21 15:58 UTC (permalink / raw)
To: Dengdui Huang
Cc: dev, honest.jiang, fengchengwen, roretzla, lihuisong, haijie1,
liuyonglong
On Fri, 21 Mar 2025 12:03:16 +0800
Dengdui Huang <huangdengdui@huawei.com> wrote:
> When a core that is not used by the rte is specified in the config
> for testing, the problem of infinite loop occurs. The root cause
> is that the program waits for the completion of the test task when
> the test worker fails to be started on the lcore. This patch fix it.
>
> Fixes: 533d7e7f66f3 ("app/dma-perf: support config per device")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> ---
> app/test-dma-perf/benchmark.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c
> index 6d617ea200..351c1c966e 100644
> --- a/app/test-dma-perf/benchmark.c
> +++ b/app/test-dma-perf/benchmark.c
> @@ -751,7 +751,10 @@ mem_copy_benchmark(struct test_configure *cfg)
> goto out;
> }
>
> - rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id);
> + if (rte_eal_remote_launch(get_work_function(cfg), (void *)(lcores[i]), lcore_id)) {
> + printf("Error: Fail to start the test on lcore %d\n", lcore_id);
Convention is to log errors on stderr and lcore_id is unsigned not signed value.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-21 15:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-21 4:03 [PATCH 0/2] fix the problem of dma-perf infinite loop 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-21 7:49 ` [PATCH 0/2] fix the problem of dma-perf " David Marchand
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).