DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2 0/1] remove smp barriers in app/test
@ 2021-02-25  9:32 Feifei Wang
  2021-02-25  9:32 ` [dpdk-dev] [PATCH v2 1/1] app/test: collect perf data after worker threads exit Feifei Wang
  0 siblings, 1 reply; 5+ messages in thread
From: Feifei Wang @ 2021-02-25  9:32 UTC (permalink / raw)
  Cc: dev, nd, Feifei Wang

For smp barriers in app/test, remove the unnecessary barriers and fix
some bugs.

v2:
1. remove ring stress test patch for that Honnappa will
do some changes for rte_remote_launch APIs

Feifei Wang (1):
  app/test: collect perf data after worker threads exit

 app/test/test_trace_perf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2 1/1] app/test: collect perf data after worker threads exit
  2021-02-25  9:32 [dpdk-dev] [PATCH v2 0/1] remove smp barriers in app/test Feifei Wang
@ 2021-02-25  9:32 ` Feifei Wang
  2021-03-09  9:06   ` [dpdk-dev] 回复: " Feifei Wang
  2021-03-09 10:27   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  0 siblings, 2 replies; 5+ messages in thread
From: Feifei Wang @ 2021-02-25  9:32 UTC (permalink / raw)
  To: Jerin Jacob, Sunil Kumar Kori, David Marchand
  Cc: dev, nd, Feifei Wang, stable, Honnappa Nagarahalli,
	Honnappa Nagarahalli, Ruifeng Wang

The measure_perf function should be executed after worker threads exit
to collect correct perf data. Otherwise, while workers are running, the
main thread may get incomplete data from workers.

In the meanwhile, remove unnecessary barrier in the test.
For signal variables "ldata.done" and "ldata.start", no operations
should keep the order that being executed after them. So the wmb after
them can be moved.

Fixes: 16a277a24c9f ("test/trace: add performance test cases")
Cc: jerinj@marvell.com
Cc: stable@dpdk.org

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 app/test/test_trace_perf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c
index e1ad8e6f5..46ae7d807 100644
--- a/app/test/test_trace_perf.c
+++ b/app/test/test_trace_perf.c
@@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data)
 
 	for (workers = 0; workers < data->nb_workers; workers++) {
 		data->ldata[workers].done = 1;
-		rte_smp_wmb();
 	}
 }
 
@@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \
 { \
 	struct lcore_data *ldata = arg; \
 	ldata->started = 1; \
-	rte_smp_wmb(); \
 	__worker_##func(ldata); \
 	return 0; \
 }
@@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
 
 	wait_till_workers_are_ready(data);
 	rte_delay_ms(100); /* Wait for some time to accumulate the stats */
-	measure_perf(str, data);
 	signal_workers_to_finish(data);
 
 	RTE_LCORE_FOREACH_WORKER(id)
 		rte_eal_wait_lcore(id);
+
+	measure_perf(str, data);
 }
 
 static int
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] 回复: [PATCH v2 1/1] app/test: collect perf data after worker threads exit
  2021-02-25  9:32 ` [dpdk-dev] [PATCH v2 1/1] app/test: collect perf data after worker threads exit Feifei Wang
@ 2021-03-09  9:06   ` Feifei Wang
  2021-03-09 12:54     ` Jerin Jacob
  2021-03-09 10:27   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
  1 sibling, 1 reply; 5+ messages in thread
From: Feifei Wang @ 2021-03-09  9:06 UTC (permalink / raw)
  To: Feifei Wang, jerinj, Sunil Kumar Kori, David Marchand
  Cc: dev, nd, stable, Honnappa Nagarahalli, Ruifeng Wang, nd

Hi, Jerin

Sorry to disturb you. Would you please help review this patch when you are free?
Thanks very much.

Best Regards
Feifei

> -----邮件原件-----
> 发件人: Feifei Wang <feifei.wang2@arm.com>
> 发送时间: 2021年2月25日 17:32
> 收件人: jerinj@marvell.com; Sunil Kumar Kori <skori@marvell.com>; David
> Marchand <david.marchand@redhat.com>
> 抄送: dev@dpdk.org; nd <nd@arm.com>; Feifei Wang
> <Feifei.Wang2@arm.com>; stable@dpdk.org; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>
> 主题: [PATCH v2 1/1] app/test: collect perf data after worker threads exit
> 
> The measure_perf function should be executed after worker threads exit to
> collect correct perf data. Otherwise, while workers are running, the main
> thread may get incomplete data from workers.
> 
> In the meanwhile, remove unnecessary barrier in the test.
> For signal variables "ldata.done" and "ldata.start", no operations should keep
> the order that being executed after them. So the wmb after them can be
> moved.
> 
> Fixes: 16a277a24c9f ("test/trace: add performance test cases")
> Cc: jerinj@marvell.com
> Cc: stable@dpdk.org
> 
> Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
>  app/test/test_trace_perf.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c index
> e1ad8e6f5..46ae7d807 100644
> --- a/app/test/test_trace_perf.c
> +++ b/app/test/test_trace_perf.c
> @@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data)
> 
>  	for (workers = 0; workers < data->nb_workers; workers++) {
>  		data->ldata[workers].done = 1;
> -		rte_smp_wmb();
>  	}
>  }
> 
> @@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \  { \
>  	struct lcore_data *ldata = arg; \
>  	ldata->started = 1; \
> -	rte_smp_wmb(); \
>  	__worker_##func(ldata); \
>  	return 0; \
>  }
> @@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct
> test_data *data, size_t sz)
> 
>  	wait_till_workers_are_ready(data);
>  	rte_delay_ms(100); /* Wait for some time to accumulate the stats */
> -	measure_perf(str, data);
>  	signal_workers_to_finish(data);
> 
>  	RTE_LCORE_FOREACH_WORKER(id)
>  		rte_eal_wait_lcore(id);
> +
> +	measure_perf(str, data);
>  }
> 
>  static int
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [EXT] [PATCH v2 1/1] app/test: collect perf data after worker threads exit
  2021-02-25  9:32 ` [dpdk-dev] [PATCH v2 1/1] app/test: collect perf data after worker threads exit Feifei Wang
  2021-03-09  9:06   ` [dpdk-dev] 回复: " Feifei Wang
@ 2021-03-09 10:27   ` Pavan Nikhilesh Bhagavatula
  1 sibling, 0 replies; 5+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2021-03-09 10:27 UTC (permalink / raw)
  To: Feifei Wang, Jerin Jacob Kollanukkaran, Sunil Kumar Kori, David Marchand
  Cc: dev, nd, stable, Honnappa Nagarahalli, Honnappa Nagarahalli,
	Ruifeng Wang

>The measure_perf function should be executed after worker threads
>exit
>to collect correct perf data. Otherwise, while workers are running, the
>main thread may get incomplete data from workers.
>
>In the meanwhile, remove unnecessary barrier in the test.
>For signal variables "ldata.done" and "ldata.start", no operations
>should keep the order that being executed after them. So the wmb after
>them can be moved.
>
>Fixes: 16a277a24c9f ("test/trace: add performance test cases")
>Cc: jerinj@marvell.com
>Cc: stable@dpdk.org
>
>Suggested-by: Honnappa Nagarahalli
><honnappa.nagarahalli@arm.com>
>Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
>Reviewed-by: Honnappa Nagarahalli
><Honnappa.Nagarahalli@arm.com>
>Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

>---
> app/test/test_trace_perf.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
>diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c
>index e1ad8e6f5..46ae7d807 100644
>--- a/app/test/test_trace_perf.c
>+++ b/app/test/test_trace_perf.c
>@@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data)
>
> 	for (workers = 0; workers < data->nb_workers; workers++) {
> 		data->ldata[workers].done = 1;
>-		rte_smp_wmb();
> 	}
> }
>
>@@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \
> { \
> 	struct lcore_data *ldata = arg; \
> 	ldata->started = 1; \
>-	rte_smp_wmb(); \
> 	__worker_##func(ldata); \
> 	return 0; \
> }
>@@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f,
>struct test_data *data, size_t sz)
>
> 	wait_till_workers_are_ready(data);
> 	rte_delay_ms(100); /* Wait for some time to accumulate the
>stats */
>-	measure_perf(str, data);
> 	signal_workers_to_finish(data);
>
> 	RTE_LCORE_FOREACH_WORKER(id)
> 		rte_eal_wait_lcore(id);
>+
>+	measure_perf(str, data);
> }
>
> static int
>--
>2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] 回复: [PATCH v2 1/1] app/test: collect perf data after worker threads exit
  2021-03-09  9:06   ` [dpdk-dev] 回复: " Feifei Wang
@ 2021-03-09 12:54     ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2021-03-09 12:54 UTC (permalink / raw)
  To: Feifei Wang
  Cc: jerinj, Sunil Kumar Kori, David Marchand, dev, nd, stable,
	Honnappa Nagarahalli, Ruifeng Wang

On Tue, Mar 9, 2021 at 2:36 PM Feifei Wang <Feifei.Wang2@arm.com> wrote:
>
> Hi, Jerin
>
> Sorry to disturb you. Would you please help review this patch when you are free?

Sure. See below.

> Thanks very much.
>
> Best Regards
> Feifei
>
> > -----邮件原件-----
> > 发件人: Feifei Wang <feifei.wang2@arm.com>
> > 发送时间: 2021年2月25日 17:32
> > 收件人: jerinj@marvell.com; Sunil Kumar Kori <skori@marvell.com>; David
> > Marchand <david.marchand@redhat.com>
> > 抄送: dev@dpdk.org; nd <nd@arm.com>; Feifei Wang
> > <Feifei.Wang2@arm.com>; stable@dpdk.org; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; Honnappa Nagarahalli
> > <Honnappa.Nagarahalli@arm.com>; Ruifeng Wang
> > <Ruifeng.Wang@arm.com>
> > 主题: [PATCH v2 1/1] app/test: collect perf data after worker threads exit
> >
> > The measure_perf function should be executed after worker threads exit to
> > collect correct perf data. Otherwise, while workers are running, the main
> > thread may get incomplete data from workers.
> >
> > In the meanwhile, remove unnecessary barrier in the test.
> > For signal variables "ldata.done" and "ldata.start", no operations should keep
> > the order that being executed after them. So the wmb after them can be
> > moved.
> >
> > Fixes: 16a277a24c9f ("test/trace: add performance test cases")
> > Cc: jerinj@marvell.com
> > Cc: stable@dpdk.org
> >
> > Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> > Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
> > Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>


Please change to test/trace: ....
The rest looks good to me.

Acked-by: Jerin Jacob <jerinj@marvell.com>



> > ---
> >  app/test/test_trace_perf.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c index
> > e1ad8e6f5..46ae7d807 100644
> > --- a/app/test/test_trace_perf.c
> > +++ b/app/test/test_trace_perf.c
> > @@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data)
> >
> >       for (workers = 0; workers < data->nb_workers; workers++) {
> >               data->ldata[workers].done = 1;
> > -             rte_smp_wmb();
> >       }
> >  }
> >
> > @@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \  { \
> >       struct lcore_data *ldata = arg; \
> >       ldata->started = 1; \
> > -     rte_smp_wmb(); \
> >       __worker_##func(ldata); \
> >       return 0; \
> >  }
> > @@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct
> > test_data *data, size_t sz)
> >
> >       wait_till_workers_are_ready(data);
> >       rte_delay_ms(100); /* Wait for some time to accumulate the stats */
> > -     measure_perf(str, data);
> >       signal_workers_to_finish(data);
> >
> >       RTE_LCORE_FOREACH_WORKER(id)
> >               rte_eal_wait_lcore(id);
> > +
> > +     measure_perf(str, data);
> >  }
> >
> >  static int
> > --
> > 2.25.1
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-09 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25  9:32 [dpdk-dev] [PATCH v2 0/1] remove smp barriers in app/test Feifei Wang
2021-02-25  9:32 ` [dpdk-dev] [PATCH v2 1/1] app/test: collect perf data after worker threads exit Feifei Wang
2021-03-09  9:06   ` [dpdk-dev] 回复: " Feifei Wang
2021-03-09 12:54     ` Jerin Jacob
2021-03-09 10:27   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git