DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API
@ 2020-06-30 16:21 Konstantin Ananyev
  2020-06-30 23:01 ` Honnappa Nagarahalli
  2020-07-02 14:10 ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API Konstantin Ananyev
  0 siblings, 2 replies; 13+ messages in thread
From: Konstantin Ananyev @ 2020-06-30 16:21 UTC (permalink / raw)
  To: dev; +Cc: honnappa.nagarahalli, feifei.wang2, Konstantin Ananyev

Introduce new test case to test ST peek API.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---

This patch depends on the following patch:
"ring: fix error vlaue of tail in the peek API for ST mode"
(http://patches.dpdk.org/patch/72374/)
to run successfully.

 app/test/Makefile                   |  1 +
 app/test/meson.build                |  1 +
 app/test/test_ring_st_peek_stress.c | 54 +++++++++++++++++++++++++++++
 app/test/test_ring_stress.c         |  3 ++
 app/test/test_ring_stress.h         |  1 +
 5 files changed, 60 insertions(+)
 create mode 100644 app/test/test_ring_st_peek_stress.c

diff --git a/app/test/Makefile b/app/test/Makefile
index 7b96a03a6..37bdaf891 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -83,6 +83,7 @@ SRCS-y += test_ring_hts_stress.c
 SRCS-y += test_ring_perf.c
 SRCS-y += test_ring_peek_stress.c
 SRCS-y += test_ring_rts_stress.c
+SRCS-y += test_ring_st_peek_stress.c
 SRCS-y += test_ring_stress.c
 SRCS-y += test_pmd_perf.c
 
diff --git a/app/test/meson.build b/app/test/meson.build
index 5233ead46..4ec7da6b2 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -108,6 +108,7 @@ test_sources = files('commands.c',
 	'test_ring_peek_stress.c',
 	'test_ring_perf.c',
 	'test_ring_rts_stress.c',
+	'test_ring_st_peek_stress.c',
 	'test_ring_stress.c',
 	'test_rwlock.c',
 	'test_sched.c',
diff --git a/app/test/test_ring_st_peek_stress.c b/app/test/test_ring_st_peek_stress.c
new file mode 100644
index 000000000..bc573de47
--- /dev/null
+++ b/app/test/test_ring_st_peek_stress.c
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2020 Intel Corporation
+ */
+
+#include "test_ring_stress_impl.h"
+#include <rte_ring_elem.h>
+
+static inline uint32_t
+_st_ring_dequeue_bulk(struct rte_ring *r, void **obj, uint32_t n,
+	uint32_t *avail)
+{
+	uint32_t m;
+
+	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
+
+	rte_spinlock_lock(&lck);
+
+	m = rte_ring_dequeue_bulk_start(r, obj, n, avail);
+	n = (m == n) ? n : 0;
+	rte_ring_dequeue_finish(r, n);
+
+	rte_spinlock_unlock(&lck);
+	return n;
+}
+
+static inline uint32_t
+_st_ring_enqueue_bulk(struct rte_ring *r, void * const *obj, uint32_t n,
+	uint32_t *free)
+{
+	uint32_t m;
+
+	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
+
+	rte_spinlock_lock(&lck);
+
+	m = rte_ring_enqueue_bulk_start(r, n, free);
+	n = (m == n) ? n : 0;
+	rte_ring_enqueue_finish(r, obj, n);
+
+	rte_spinlock_unlock(&lck);
+	return n;
+}
+
+static int
+_st_ring_init(struct rte_ring *r, const char *name, uint32_t num)
+{
+	return rte_ring_init(r, name, num, RING_F_SP_ENQ | RING_F_SC_DEQ);
+}
+
+const struct test test_ring_st_peek_stress = {
+	.name = "ST_PEEK",
+	.nb_case = RTE_DIM(tests),
+	.cases = tests,
+};
diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c
index 853fcc190..387cfa747 100644
--- a/app/test/test_ring_stress.c
+++ b/app/test/test_ring_stress.c
@@ -49,6 +49,9 @@ test_ring_stress(void)
 	n += test_ring_peek_stress.nb_case;
 	k += run_test(&test_ring_peek_stress);
 
+	n += test_ring_st_peek_stress.nb_case;
+	k += run_test(&test_ring_st_peek_stress);
+
 	printf("Number of tests:\t%u\nSuccess:\t%u\nFailed:\t%u\n",
 		n, k, n - k);
 	return (k != n);
diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h
index 60953ce47..a9a390341 100644
--- a/app/test/test_ring_stress.h
+++ b/app/test/test_ring_stress.h
@@ -36,3 +36,4 @@ extern const struct test test_ring_mpmc_stress;
 extern const struct test test_ring_rts_stress;
 extern const struct test test_ring_hts_stress;
 extern const struct test test_ring_peek_stress;
+extern const struct test test_ring_st_peek_stress;
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API
  2020-06-30 16:21 [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API Konstantin Ananyev
@ 2020-06-30 23:01 ` Honnappa Nagarahalli
  2020-07-01 10:34   ` Ananyev, Konstantin
  2020-07-02 14:10 ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API Konstantin Ananyev
  1 sibling, 1 reply; 13+ messages in thread
From: Honnappa Nagarahalli @ 2020-06-30 23:01 UTC (permalink / raw)
  To: Konstantin Ananyev, dev; +Cc: Feifei Wang, Honnappa Nagarahalli, nd, nd

Hi Konstantin,
	It looks fine overall, few comments inline.

<snip>

> Subject: [PATCH] test/ring: add stress test for ST peek API
> 
> Introduce new test case to test ST peek API.
> 
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---
> 
> This patch depends on the following patch:
> "ring: fix error vlaue of tail in the peek API for ST mode"
> (http://patches.dpdk.org/patch/72374/)
> to run successfully.
> 
>  app/test/Makefile                   |  1 +
>  app/test/meson.build                |  1 +
>  app/test/test_ring_st_peek_stress.c | 54 +++++++++++++++++++++++++++++
>  app/test/test_ring_stress.c         |  3 ++
>  app/test/test_ring_stress.h         |  1 +
>  5 files changed, 60 insertions(+)
>  create mode 100644 app/test/test_ring_st_peek_stress.c
> 
> diff --git a/app/test/Makefile b/app/test/Makefile index
> 7b96a03a6..37bdaf891 100644
> --- a/app/test/Makefile
> +++ b/app/test/Makefile
> @@ -83,6 +83,7 @@ SRCS-y += test_ring_hts_stress.c  SRCS-y +=
> test_ring_perf.c  SRCS-y += test_ring_peek_stress.c  SRCS-y +=
> test_ring_rts_stress.c
> +SRCS-y += test_ring_st_peek_stress.c
>  SRCS-y += test_ring_stress.c
>  SRCS-y += test_pmd_perf.c
> 
> diff --git a/app/test/meson.build b/app/test/meson.build index
> 5233ead46..4ec7da6b2 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -108,6 +108,7 @@ test_sources = files('commands.c',
>  	'test_ring_peek_stress.c',
>  	'test_ring_perf.c',
>  	'test_ring_rts_stress.c',
> +	'test_ring_st_peek_stress.c',
I think we should rename test_ring_peek_stress.c to test_ring_mpmc_hts_peek_stress.c to be consistent with this?

>  	'test_ring_stress.c',
>  	'test_rwlock.c',
>  	'test_sched.c',
> diff --git a/app/test/test_ring_st_peek_stress.c
> b/app/test/test_ring_st_peek_stress.c
> new file mode 100644
> index 000000000..bc573de47
> --- /dev/null
> +++ b/app/test/test_ring_st_peek_stress.c
> @@ -0,0 +1,54 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2020 Intel Corporation
> + */
> +
> +#include "test_ring_stress_impl.h"
> +#include <rte_ring_elem.h>
> +
> +static inline uint32_t
> +_st_ring_dequeue_bulk(struct rte_ring *r, void **obj, uint32_t n,
> +	uint32_t *avail)
> +{
> +	uint32_t m;
> +
> +	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
> +
> +	rte_spinlock_lock(&lck);
> +
> +	m = rte_ring_dequeue_bulk_start(r, obj, n, avail);
> +	n = (m == n) ? n : 0;
> +	rte_ring_dequeue_finish(r, n);
> +
> +	rte_spinlock_unlock(&lck);
> +	return n;
> +}
> +
> +static inline uint32_t
> +_st_ring_enqueue_bulk(struct rte_ring *r, void * const *obj, uint32_t n,
> +	uint32_t *free)
> +{
> +	uint32_t m;
> +
> +	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
> +
> +	rte_spinlock_lock(&lck);
> +
> +	m = rte_ring_enqueue_bulk_start(r, n, free);
> +	n = (m == n) ? n : 0;
> +	rte_ring_enqueue_finish(r, obj, n);
> +
> +	rte_spinlock_unlock(&lck);
> +	return n;
> +}
> +
> +static int
> +_st_ring_init(struct rte_ring *r, const char *name, uint32_t num) {
> +	return rte_ring_init(r, name, num, RING_F_SP_ENQ |
> RING_F_SC_DEQ); }
> +
> +const struct test test_ring_st_peek_stress = {
> +	.name = "ST_PEEK",
> +	.nb_case = RTE_DIM(tests),
> +	.cases = tests,
> +};
> diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c index
> 853fcc190..387cfa747 100644
> --- a/app/test/test_ring_stress.c
> +++ b/app/test/test_ring_stress.c
> @@ -49,6 +49,9 @@ test_ring_stress(void)
>  	n += test_ring_peek_stress.nb_case;
>  	k += run_test(&test_ring_peek_stress);
> 
> +	n += test_ring_st_peek_stress.nb_case;
> +	k += run_test(&test_ring_st_peek_stress);
> +
>  	printf("Number of tests:\t%u\nSuccess:\t%u\nFailed:\t%u\n",
>  		n, k, n - k);
>  	return (k != n);
> diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h index
> 60953ce47..a9a390341 100644
> --- a/app/test/test_ring_stress.h
> +++ b/app/test/test_ring_stress.h
> @@ -36,3 +36,4 @@ extern const struct test test_ring_mpmc_stress;  extern
> const struct test test_ring_rts_stress;  extern const struct test
> test_ring_hts_stress;  extern const struct test test_ring_peek_stress;
> +extern const struct test test_ring_st_peek_stress;
> --
> 2.17.1


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

* Re: [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API
  2020-06-30 23:01 ` Honnappa Nagarahalli
@ 2020-07-01 10:34   ` Ananyev, Konstantin
  2020-07-01 14:05     ` Honnappa Nagarahalli
  0 siblings, 1 reply; 13+ messages in thread
From: Ananyev, Konstantin @ 2020-07-01 10:34 UTC (permalink / raw)
  To: Honnappa Nagarahalli, dev; +Cc: Feifei Wang, nd, nd


Hi Honnappa,

> 
> Hi Konstantin,
> 	It looks fine overall, few comments inline.
> 
> <snip>
> 
> > Subject: [PATCH] test/ring: add stress test for ST peek API
> >
> > Introduce new test case to test ST peek API.
> >
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> > ---
> >
> > This patch depends on the following patch:
> > "ring: fix error vlaue of tail in the peek API for ST mode"
> > (http://patches.dpdk.org/patch/72374/)
> > to run successfully.
> >
> >  app/test/Makefile                   |  1 +
> >  app/test/meson.build                |  1 +
> >  app/test/test_ring_st_peek_stress.c | 54 +++++++++++++++++++++++++++++
> >  app/test/test_ring_stress.c         |  3 ++
> >  app/test/test_ring_stress.h         |  1 +
> >  5 files changed, 60 insertions(+)
> >  create mode 100644 app/test/test_ring_st_peek_stress.c
> >
> > diff --git a/app/test/Makefile b/app/test/Makefile index
> > 7b96a03a6..37bdaf891 100644
> > --- a/app/test/Makefile
> > +++ b/app/test/Makefile
> > @@ -83,6 +83,7 @@ SRCS-y += test_ring_hts_stress.c  SRCS-y +=
> > test_ring_perf.c  SRCS-y += test_ring_peek_stress.c  SRCS-y +=
> > test_ring_rts_stress.c
> > +SRCS-y += test_ring_st_peek_stress.c
> >  SRCS-y += test_ring_stress.c
> >  SRCS-y += test_pmd_perf.c
> >
> > diff --git a/app/test/meson.build b/app/test/meson.build index
> > 5233ead46..4ec7da6b2 100644
> > --- a/app/test/meson.build
> > +++ b/app/test/meson.build
> > @@ -108,6 +108,7 @@ test_sources = files('commands.c',
> >  	'test_ring_peek_stress.c',
> >  	'test_ring_perf.c',
> >  	'test_ring_rts_stress.c',
> > +	'test_ring_st_peek_stress.c',
> I think we should rename test_ring_peek_stress.c to test_ring_mpmc_hts_peek_stress.c to be consistent with this?

Ok, maybe then:
'test_ring_st_peek_stress.c' and 'test_ring_mt_peek_stress.c'
to keep naming convention the same?

> 
> >  	'test_ring_stress.c',
> >  	'test_rwlock.c',
> >  	'test_sched.c',


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

* Re: [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API
  2020-07-01 10:34   ` Ananyev, Konstantin
@ 2020-07-01 14:05     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 13+ messages in thread
From: Honnappa Nagarahalli @ 2020-07-01 14:05 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev; +Cc: Feifei Wang, nd, Honnappa Nagarahalli, nd

<snip>

> >
> > > Subject: [PATCH] test/ring: add stress test for ST peek API
> > >
> > > Introduce new test case to test ST peek API.
> > >
> > > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> > > ---
> > >
> > > This patch depends on the following patch:
> > > "ring: fix error vlaue of tail in the peek API for ST mode"
> > > (http://patches.dpdk.org/patch/72374/)
> > > to run successfully.
> > >
> > >  app/test/Makefile                   |  1 +
> > >  app/test/meson.build                |  1 +
> > >  app/test/test_ring_st_peek_stress.c | 54
> +++++++++++++++++++++++++++++
> > >  app/test/test_ring_stress.c         |  3 ++
> > >  app/test/test_ring_stress.h         |  1 +
> > >  5 files changed, 60 insertions(+)
> > >  create mode 100644 app/test/test_ring_st_peek_stress.c
> > >
> > > diff --git a/app/test/Makefile b/app/test/Makefile index
> > > 7b96a03a6..37bdaf891 100644
> > > --- a/app/test/Makefile
> > > +++ b/app/test/Makefile
> > > @@ -83,6 +83,7 @@ SRCS-y += test_ring_hts_stress.c  SRCS-y +=
> > > test_ring_perf.c  SRCS-y += test_ring_peek_stress.c  SRCS-y +=
> > > test_ring_rts_stress.c
> > > +SRCS-y += test_ring_st_peek_stress.c
> > >  SRCS-y += test_ring_stress.c
> > >  SRCS-y += test_pmd_perf.c
> > >
> > > diff --git a/app/test/meson.build b/app/test/meson.build index
> > > 5233ead46..4ec7da6b2 100644
> > > --- a/app/test/meson.build
> > > +++ b/app/test/meson.build
> > > @@ -108,6 +108,7 @@ test_sources = files('commands.c',
> > >  	'test_ring_peek_stress.c',
> > >  	'test_ring_perf.c',
> > >  	'test_ring_rts_stress.c',
> > > +	'test_ring_st_peek_stress.c',
> > I think we should rename test_ring_peek_stress.c to
> test_ring_mpmc_hts_peek_stress.c to be consistent with this?
> 
> Ok, maybe then:
> 'test_ring_st_peek_stress.c' and 'test_ring_mt_peek_stress.c'
> to keep naming convention the same?
Ok, I am fine.

> 
> >
> > >  	'test_ring_stress.c',
> > >  	'test_rwlock.c',
> > >  	'test_sched.c',


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

* [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API
  2020-06-30 16:21 [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API Konstantin Ananyev
  2020-06-30 23:01 ` Honnappa Nagarahalli
@ 2020-07-02 14:10 ` Konstantin Ananyev
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 1/2] test/ring: add stress test for ST peek API Konstantin Ananyev
                     ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Konstantin Ananyev @ 2020-07-02 14:10 UTC (permalink / raw)
  To: dev; +Cc: honnappa.nagarahalli, feifei.wang2, Konstantin Ananyev

Introduce new test case to test ST peek API.
Changes name for MT peek ring test to follow same naming convention.

Konstantin Ananyev (2):
  test/ring: add stress test for ST peek API
  test/ring: rearrange names for ring stress tests

 app/test/Makefile                             |  3 +-
 app/test/meson.build                          |  3 +-
 ...ek_stress.c => test_ring_mt_peek_stress.c} |  2 +-
 app/test/test_ring_st_peek_stress.c           | 54 +++++++++++++++++++
 app/test/test_ring_stress.c                   |  7 ++-
 app/test/test_ring_stress.h                   |  3 +-
 6 files changed, 66 insertions(+), 6 deletions(-)
 rename app/test/{test_ring_peek_stress.c => test_ring_mt_peek_stress.c} (94%)
 create mode 100644 app/test/test_ring_st_peek_stress.c

-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 1/2] test/ring: add stress test for ST peek API
  2020-07-02 14:10 ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API Konstantin Ananyev
@ 2020-07-02 14:10   ` Konstantin Ananyev
  2020-07-02 16:18     ` Honnappa Nagarahalli
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests Konstantin Ananyev
  2020-07-03 10:40   ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API David Marchand
  2 siblings, 1 reply; 13+ messages in thread
From: Konstantin Ananyev @ 2020-07-02 14:10 UTC (permalink / raw)
  To: dev; +Cc: honnappa.nagarahalli, feifei.wang2, Konstantin Ananyev

Introduce new test case to test ST peek API.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 app/test/Makefile                   |  1 +
 app/test/meson.build                |  1 +
 app/test/test_ring_st_peek_stress.c | 54 +++++++++++++++++++++++++++++
 app/test/test_ring_stress.c         |  3 ++
 app/test/test_ring_stress.h         |  1 +
 5 files changed, 60 insertions(+)
 create mode 100644 app/test/test_ring_st_peek_stress.c

diff --git a/app/test/Makefile b/app/test/Makefile
index 7b96a03a6..37bdaf891 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -83,6 +83,7 @@ SRCS-y += test_ring_hts_stress.c
 SRCS-y += test_ring_perf.c
 SRCS-y += test_ring_peek_stress.c
 SRCS-y += test_ring_rts_stress.c
+SRCS-y += test_ring_st_peek_stress.c
 SRCS-y += test_ring_stress.c
 SRCS-y += test_pmd_perf.c
 
diff --git a/app/test/meson.build b/app/test/meson.build
index b224d6f2b..5cb050958 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -108,6 +108,7 @@ test_sources = files('commands.c',
 	'test_ring_peek_stress.c',
 	'test_ring_perf.c',
 	'test_ring_rts_stress.c',
+	'test_ring_st_peek_stress.c',
 	'test_ring_stress.c',
 	'test_rwlock.c',
 	'test_sched.c',
diff --git a/app/test/test_ring_st_peek_stress.c b/app/test/test_ring_st_peek_stress.c
new file mode 100644
index 000000000..bc573de47
--- /dev/null
+++ b/app/test/test_ring_st_peek_stress.c
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2020 Intel Corporation
+ */
+
+#include "test_ring_stress_impl.h"
+#include <rte_ring_elem.h>
+
+static inline uint32_t
+_st_ring_dequeue_bulk(struct rte_ring *r, void **obj, uint32_t n,
+	uint32_t *avail)
+{
+	uint32_t m;
+
+	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
+
+	rte_spinlock_lock(&lck);
+
+	m = rte_ring_dequeue_bulk_start(r, obj, n, avail);
+	n = (m == n) ? n : 0;
+	rte_ring_dequeue_finish(r, n);
+
+	rte_spinlock_unlock(&lck);
+	return n;
+}
+
+static inline uint32_t
+_st_ring_enqueue_bulk(struct rte_ring *r, void * const *obj, uint32_t n,
+	uint32_t *free)
+{
+	uint32_t m;
+
+	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
+
+	rte_spinlock_lock(&lck);
+
+	m = rte_ring_enqueue_bulk_start(r, n, free);
+	n = (m == n) ? n : 0;
+	rte_ring_enqueue_finish(r, obj, n);
+
+	rte_spinlock_unlock(&lck);
+	return n;
+}
+
+static int
+_st_ring_init(struct rte_ring *r, const char *name, uint32_t num)
+{
+	return rte_ring_init(r, name, num, RING_F_SP_ENQ | RING_F_SC_DEQ);
+}
+
+const struct test test_ring_st_peek_stress = {
+	.name = "ST_PEEK",
+	.nb_case = RTE_DIM(tests),
+	.cases = tests,
+};
diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c
index 853fcc190..387cfa747 100644
--- a/app/test/test_ring_stress.c
+++ b/app/test/test_ring_stress.c
@@ -49,6 +49,9 @@ test_ring_stress(void)
 	n += test_ring_peek_stress.nb_case;
 	k += run_test(&test_ring_peek_stress);
 
+	n += test_ring_st_peek_stress.nb_case;
+	k += run_test(&test_ring_st_peek_stress);
+
 	printf("Number of tests:\t%u\nSuccess:\t%u\nFailed:\t%u\n",
 		n, k, n - k);
 	return (k != n);
diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h
index 60953ce47..a9a390341 100644
--- a/app/test/test_ring_stress.h
+++ b/app/test/test_ring_stress.h
@@ -36,3 +36,4 @@ extern const struct test test_ring_mpmc_stress;
 extern const struct test test_ring_rts_stress;
 extern const struct test test_ring_hts_stress;
 extern const struct test test_ring_peek_stress;
+extern const struct test test_ring_st_peek_stress;
-- 
2.17.1


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

* [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
  2020-07-02 14:10 ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API Konstantin Ananyev
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 1/2] test/ring: add stress test for ST peek API Konstantin Ananyev
@ 2020-07-02 14:10   ` Konstantin Ananyev
  2020-07-02 16:18     ` Honnappa Nagarahalli
  2020-07-03  1:46     ` [dpdk-dev] 回复: " Feifei Wang
  2020-07-03 10:40   ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API David Marchand
  2 siblings, 2 replies; 13+ messages in thread
From: Konstantin Ananyev @ 2020-07-02 14:10 UTC (permalink / raw)
  To: dev; +Cc: honnappa.nagarahalli, feifei.wang2, Konstantin Ananyev

Rename test_ring_peek_stress to test_ring_mt_peek_stress to
keep same naming conventions for ST and MT test cases.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 app/test/Makefile                                             | 2 +-
 app/test/meson.build                                          | 2 +-
 .../{test_ring_peek_stress.c => test_ring_mt_peek_stress.c}   | 2 +-
 app/test/test_ring_stress.c                                   | 4 ++--
 app/test/test_ring_stress.h                                   | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
 rename app/test/{test_ring_peek_stress.c => test_ring_mt_peek_stress.c} (94%)

diff --git a/app/test/Makefile b/app/test/Makefile
index 37bdaf891..e5440774b 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -81,7 +81,7 @@ SRCS-y += test_ring.c
 SRCS-y += test_ring_mpmc_stress.c
 SRCS-y += test_ring_hts_stress.c
 SRCS-y += test_ring_perf.c
-SRCS-y += test_ring_peek_stress.c
+SRCS-y += test_ring_mt_peek_stress.c
 SRCS-y += test_ring_rts_stress.c
 SRCS-y += test_ring_st_peek_stress.c
 SRCS-y += test_ring_stress.c
diff --git a/app/test/meson.build b/app/test/meson.build
index 5cb050958..d8c5b5295 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -105,7 +105,7 @@ test_sources = files('commands.c',
 	'test_ring.c',
 	'test_ring_mpmc_stress.c',
 	'test_ring_hts_stress.c',
-	'test_ring_peek_stress.c',
+	'test_ring_mt_peek_stress.c',
 	'test_ring_perf.c',
 	'test_ring_rts_stress.c',
 	'test_ring_st_peek_stress.c',
diff --git a/app/test/test_ring_peek_stress.c b/app/test/test_ring_mt_peek_stress.c
similarity index 94%
rename from app/test/test_ring_peek_stress.c
rename to app/test/test_ring_mt_peek_stress.c
index cfc82d728..4d521422f 100644
--- a/app/test/test_ring_peek_stress.c
+++ b/app/test/test_ring_mt_peek_stress.c
@@ -36,7 +36,7 @@ _st_ring_init(struct rte_ring *r, const char *name, uint32_t num)
 		RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ);
 }
 
-const struct test test_ring_peek_stress = {
+const struct test test_ring_mt_peek_stress = {
 	.name = "MT_PEEK",
 	.nb_case = RTE_DIM(tests),
 	.cases = tests,
diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c
index 387cfa747..c4f82ea56 100644
--- a/app/test/test_ring_stress.c
+++ b/app/test/test_ring_stress.c
@@ -46,8 +46,8 @@ test_ring_stress(void)
 	n += test_ring_hts_stress.nb_case;
 	k += run_test(&test_ring_hts_stress);
 
-	n += test_ring_peek_stress.nb_case;
-	k += run_test(&test_ring_peek_stress);
+	n += test_ring_mt_peek_stress.nb_case;
+	k += run_test(&test_ring_mt_peek_stress);
 
 	n += test_ring_st_peek_stress.nb_case;
 	k += run_test(&test_ring_st_peek_stress);
diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h
index a9a390341..c85d6fa92 100644
--- a/app/test/test_ring_stress.h
+++ b/app/test/test_ring_stress.h
@@ -35,5 +35,5 @@ struct test {
 extern const struct test test_ring_mpmc_stress;
 extern const struct test test_ring_rts_stress;
 extern const struct test test_ring_hts_stress;
-extern const struct test test_ring_peek_stress;
+extern const struct test test_ring_mt_peek_stress;
 extern const struct test test_ring_st_peek_stress;
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH v2 1/2] test/ring: add stress test for ST peek API
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 1/2] test/ring: add stress test for ST peek API Konstantin Ananyev
@ 2020-07-02 16:18     ` Honnappa Nagarahalli
  0 siblings, 0 replies; 13+ messages in thread
From: Honnappa Nagarahalli @ 2020-07-02 16:18 UTC (permalink / raw)
  To: Konstantin Ananyev, dev; +Cc: Feifei Wang, nd, Honnappa Nagarahalli, nd



> -----Original Message-----
> From: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Sent: Thursday, July 2, 2020 9:10 AM
> To: dev@dpdk.org
> Cc: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Feifei Wang
> <Feifei.Wang2@arm.com>; Konstantin Ananyev
> <konstantin.ananyev@intel.com>
> Subject: [PATCH v2 1/2] test/ring: add stress test for ST peek API
> 
> Introduce new test case to test ST peek API.
> 
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  app/test/Makefile                   |  1 +
>  app/test/meson.build                |  1 +
>  app/test/test_ring_st_peek_stress.c | 54 +++++++++++++++++++++++++++++
>  app/test/test_ring_stress.c         |  3 ++
>  app/test/test_ring_stress.h         |  1 +
>  5 files changed, 60 insertions(+)
>  create mode 100644 app/test/test_ring_st_peek_stress.c
> 
> diff --git a/app/test/Makefile b/app/test/Makefile index
> 7b96a03a6..37bdaf891 100644
> --- a/app/test/Makefile
> +++ b/app/test/Makefile
> @@ -83,6 +83,7 @@ SRCS-y += test_ring_hts_stress.c  SRCS-y +=
> test_ring_perf.c  SRCS-y += test_ring_peek_stress.c  SRCS-y +=
> test_ring_rts_stress.c
> +SRCS-y += test_ring_st_peek_stress.c
>  SRCS-y += test_ring_stress.c
>  SRCS-y += test_pmd_perf.c
> 
> diff --git a/app/test/meson.build b/app/test/meson.build index
> b224d6f2b..5cb050958 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -108,6 +108,7 @@ test_sources = files('commands.c',
>  	'test_ring_peek_stress.c',
>  	'test_ring_perf.c',
>  	'test_ring_rts_stress.c',
> +	'test_ring_st_peek_stress.c',
>  	'test_ring_stress.c',
>  	'test_rwlock.c',
>  	'test_sched.c',
> diff --git a/app/test/test_ring_st_peek_stress.c
> b/app/test/test_ring_st_peek_stress.c
> new file mode 100644
> index 000000000..bc573de47
> --- /dev/null
> +++ b/app/test/test_ring_st_peek_stress.c
> @@ -0,0 +1,54 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2020 Intel Corporation
> + */
> +
> +#include "test_ring_stress_impl.h"
> +#include <rte_ring_elem.h>
> +
> +static inline uint32_t
> +_st_ring_dequeue_bulk(struct rte_ring *r, void **obj, uint32_t n,
> +	uint32_t *avail)
> +{
> +	uint32_t m;
> +
> +	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
> +
> +	rte_spinlock_lock(&lck);
> +
> +	m = rte_ring_dequeue_bulk_start(r, obj, n, avail);
> +	n = (m == n) ? n : 0;
> +	rte_ring_dequeue_finish(r, n);
> +
> +	rte_spinlock_unlock(&lck);
> +	return n;
> +}
> +
> +static inline uint32_t
> +_st_ring_enqueue_bulk(struct rte_ring *r, void * const *obj, uint32_t n,
> +	uint32_t *free)
> +{
> +	uint32_t m;
> +
> +	static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
> +
> +	rte_spinlock_lock(&lck);
> +
> +	m = rte_ring_enqueue_bulk_start(r, n, free);
> +	n = (m == n) ? n : 0;
> +	rte_ring_enqueue_finish(r, obj, n);
> +
> +	rte_spinlock_unlock(&lck);
> +	return n;
> +}
> +
> +static int
> +_st_ring_init(struct rte_ring *r, const char *name, uint32_t num) {
> +	return rte_ring_init(r, name, num, RING_F_SP_ENQ |
> RING_F_SC_DEQ); }
> +
> +const struct test test_ring_st_peek_stress = {
> +	.name = "ST_PEEK",
> +	.nb_case = RTE_DIM(tests),
> +	.cases = tests,
> +};
> diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c index
> 853fcc190..387cfa747 100644
> --- a/app/test/test_ring_stress.c
> +++ b/app/test/test_ring_stress.c
> @@ -49,6 +49,9 @@ test_ring_stress(void)
>  	n += test_ring_peek_stress.nb_case;
>  	k += run_test(&test_ring_peek_stress);
> 
> +	n += test_ring_st_peek_stress.nb_case;
> +	k += run_test(&test_ring_st_peek_stress);
> +
>  	printf("Number of tests:\t%u\nSuccess:\t%u\nFailed:\t%u\n",
>  		n, k, n - k);
>  	return (k != n);
> diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h index
> 60953ce47..a9a390341 100644
> --- a/app/test/test_ring_stress.h
> +++ b/app/test/test_ring_stress.h
> @@ -36,3 +36,4 @@ extern const struct test test_ring_mpmc_stress;  extern
> const struct test test_ring_rts_stress;  extern const struct test
> test_ring_hts_stress;  extern const struct test test_ring_peek_stress;
> +extern const struct test test_ring_st_peek_stress;
> --
> 2.17.1


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

* Re: [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests Konstantin Ananyev
@ 2020-07-02 16:18     ` Honnappa Nagarahalli
  2020-07-03  1:46     ` [dpdk-dev] 回复: " Feifei Wang
  1 sibling, 0 replies; 13+ messages in thread
From: Honnappa Nagarahalli @ 2020-07-02 16:18 UTC (permalink / raw)
  To: Konstantin Ananyev, dev; +Cc: Feifei Wang, nd, Honnappa Nagarahalli, nd



> -----Original Message-----
> From: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Sent: Thursday, July 2, 2020 9:10 AM
> To: dev@dpdk.org
> Cc: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Feifei Wang
> <Feifei.Wang2@arm.com>; Konstantin Ananyev
> <konstantin.ananyev@intel.com>
> Subject: [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
> 
> Rename test_ring_peek_stress to test_ring_mt_peek_stress to keep same
> naming conventions for ST and MT test cases.
> 
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

> ---
>  app/test/Makefile                                             | 2 +-
>  app/test/meson.build                                          | 2 +-
>  .../{test_ring_peek_stress.c => test_ring_mt_peek_stress.c}   | 2 +-
>  app/test/test_ring_stress.c                                   | 4 ++--
>  app/test/test_ring_stress.h                                   | 2 +-
>  5 files changed, 6 insertions(+), 6 deletions(-)  rename
> app/test/{test_ring_peek_stress.c => test_ring_mt_peek_stress.c} (94%)
> 
> diff --git a/app/test/Makefile b/app/test/Makefile index
> 37bdaf891..e5440774b 100644
> --- a/app/test/Makefile
> +++ b/app/test/Makefile
> @@ -81,7 +81,7 @@ SRCS-y += test_ring.c
>  SRCS-y += test_ring_mpmc_stress.c
>  SRCS-y += test_ring_hts_stress.c
>  SRCS-y += test_ring_perf.c
> -SRCS-y += test_ring_peek_stress.c
> +SRCS-y += test_ring_mt_peek_stress.c
>  SRCS-y += test_ring_rts_stress.c
>  SRCS-y += test_ring_st_peek_stress.c
>  SRCS-y += test_ring_stress.c
> diff --git a/app/test/meson.build b/app/test/meson.build index
> 5cb050958..d8c5b5295 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -105,7 +105,7 @@ test_sources = files('commands.c',
>  	'test_ring.c',
>  	'test_ring_mpmc_stress.c',
>  	'test_ring_hts_stress.c',
> -	'test_ring_peek_stress.c',
> +	'test_ring_mt_peek_stress.c',
>  	'test_ring_perf.c',
>  	'test_ring_rts_stress.c',
>  	'test_ring_st_peek_stress.c',
> diff --git a/app/test/test_ring_peek_stress.c
> b/app/test/test_ring_mt_peek_stress.c
> similarity index 94%
> rename from app/test/test_ring_peek_stress.c rename to
> app/test/test_ring_mt_peek_stress.c
> index cfc82d728..4d521422f 100644
> --- a/app/test/test_ring_peek_stress.c
> +++ b/app/test/test_ring_mt_peek_stress.c
> @@ -36,7 +36,7 @@ _st_ring_init(struct rte_ring *r, const char *name,
> uint32_t num)
>  		RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ);  }
> 
> -const struct test test_ring_peek_stress = {
> +const struct test test_ring_mt_peek_stress = {
>  	.name = "MT_PEEK",
>  	.nb_case = RTE_DIM(tests),
>  	.cases = tests,
> diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c index
> 387cfa747..c4f82ea56 100644
> --- a/app/test/test_ring_stress.c
> +++ b/app/test/test_ring_stress.c
> @@ -46,8 +46,8 @@ test_ring_stress(void)
>  	n += test_ring_hts_stress.nb_case;
>  	k += run_test(&test_ring_hts_stress);
> 
> -	n += test_ring_peek_stress.nb_case;
> -	k += run_test(&test_ring_peek_stress);
> +	n += test_ring_mt_peek_stress.nb_case;
> +	k += run_test(&test_ring_mt_peek_stress);
> 
>  	n += test_ring_st_peek_stress.nb_case;
>  	k += run_test(&test_ring_st_peek_stress);
> diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h index
> a9a390341..c85d6fa92 100644
> --- a/app/test/test_ring_stress.h
> +++ b/app/test/test_ring_stress.h
> @@ -35,5 +35,5 @@ struct test {
>  extern const struct test test_ring_mpmc_stress;  extern const struct test
> test_ring_rts_stress;  extern const struct test test_ring_hts_stress; -extern
> const struct test test_ring_peek_stress;
> +extern const struct test test_ring_mt_peek_stress;
>  extern const struct test test_ring_st_peek_stress;
> --
> 2.17.1


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

* [dpdk-dev] 回复: [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests Konstantin Ananyev
  2020-07-02 16:18     ` Honnappa Nagarahalli
@ 2020-07-03  1:46     ` Feifei Wang
  2020-07-03  2:37       ` [dpdk-dev] " Honnappa Nagarahalli
  1 sibling, 1 reply; 13+ messages in thread
From: Feifei Wang @ 2020-07-03  1:46 UTC (permalink / raw)
  To: Konstantin Ananyev, dev; +Cc: Honnappa Nagarahalli



> -----邮件原件-----
> 发件人: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 发送时间: 2020年7月2日 22:10
> 收件人: dev@dpdk.org
> 抄送: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Feifei Wang
> <Feifei.Wang2@arm.com>; Konstantin Ananyev
> <konstantin.ananyev@intel.com>
> 主题: [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
>
> Rename test_ring_peek_stress to test_ring_mt_peek_stress to keep same
> naming conventions for ST and MT test cases.
>
> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> ---
>  app/test/Makefile                                             | 2 +-
>  app/test/meson.build                                          | 2 +-
>  .../{test_ring_peek_stress.c => test_ring_mt_peek_stress.c}   | 2 +-
>  app/test/test_ring_stress.c                                   | 4 ++--
>  app/test/test_ring_stress.h                                   | 2 +-
>  5 files changed, 6 insertions(+), 6 deletions(-)  rename
> app/test/{test_ring_peek_stress.c => test_ring_mt_peek_stress.c} (94%)
>
> diff --git a/app/test/Makefile b/app/test/Makefile index
> 37bdaf891..e5440774b 100644
> --- a/app/test/Makefile
> +++ b/app/test/Makefile
> @@ -81,7 +81,7 @@ SRCS-y += test_ring.c
>  SRCS-y += test_ring_mpmc_stress.c
>  SRCS-y += test_ring_hts_stress.c
>  SRCS-y += test_ring_perf.c
> -SRCS-y += test_ring_peek_stress.c
> +SRCS-y += test_ring_mt_peek_stress.c
>  SRCS-y += test_ring_rts_stress.c
>  SRCS-y += test_ring_st_peek_stress.c
>  SRCS-y += test_ring_stress.c
> diff --git a/app/test/meson.build b/app/test/meson.build index
> 5cb050958..d8c5b5295 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -105,7 +105,7 @@ test_sources = files('commands.c',
>  'test_ring.c',
>  'test_ring_mpmc_stress.c',
>  'test_ring_hts_stress.c',
> -'test_ring_peek_stress.c',
> +'test_ring_mt_peek_stress.c',
So it seems there will be peek API for MT mode, I agree with that.
However, due to the characteristic of peek API that the thread can change its number of planned enqueue elements, after it moves prod_head.
This may causing confusion for other threads.
Furthermore, for the implement of peek API for MT or RTS mode, we may need to add some restrictions to make it work correctly.
Thanks.
>  'test_ring_perf.c',
>  'test_ring_rts_stress.c',
>  'test_ring_st_peek_stress.c',
> diff --git a/app/test/test_ring_peek_stress.c
> b/app/test/test_ring_mt_peek_stress.c
> similarity index 94%
> rename from app/test/test_ring_peek_stress.c rename to
> app/test/test_ring_mt_peek_stress.c
> index cfc82d728..4d521422f 100644
> --- a/app/test/test_ring_peek_stress.c
> +++ b/app/test/test_ring_mt_peek_stress.c
> @@ -36,7 +36,7 @@ _st_ring_init(struct rte_ring *r, const char *name,
> uint32_t num)
>  RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ);  }
>
> -const struct test test_ring_peek_stress = {
> +const struct test test_ring_mt_peek_stress = {
>  .name = "MT_PEEK",
>  .nb_case = RTE_DIM(tests),
>  .cases = tests,
> diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c index
> 387cfa747..c4f82ea56 100644
> --- a/app/test/test_ring_stress.c
> +++ b/app/test/test_ring_stress.c
> @@ -46,8 +46,8 @@ test_ring_stress(void)
>  n += test_ring_hts_stress.nb_case;
>  k += run_test(&test_ring_hts_stress);
>
> -n += test_ring_peek_stress.nb_case;
> -k += run_test(&test_ring_peek_stress);
> +n += test_ring_mt_peek_stress.nb_case;
> +k += run_test(&test_ring_mt_peek_stress);
>
>  n += test_ring_st_peek_stress.nb_case;
>  k += run_test(&test_ring_st_peek_stress);
> diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h index
> a9a390341..c85d6fa92 100644
> --- a/app/test/test_ring_stress.h
> +++ b/app/test/test_ring_stress.h
> @@ -35,5 +35,5 @@ struct test {
>  extern const struct test test_ring_mpmc_stress;  extern const struct test
> test_ring_rts_stress;  extern const struct test test_ring_hts_stress; -extern
> const struct test test_ring_peek_stress;
> +extern const struct test test_ring_mt_peek_stress;
>  extern const struct test test_ring_st_peek_stress;
> --
> 2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
  2020-07-03  1:46     ` [dpdk-dev] 回复: " Feifei Wang
@ 2020-07-03  2:37       ` Honnappa Nagarahalli
  2020-07-03  3:01         ` [dpdk-dev] 回复: " Feifei Wang
  0 siblings, 1 reply; 13+ messages in thread
From: Honnappa Nagarahalli @ 2020-07-03  2:37 UTC (permalink / raw)
  To: Feifei Wang, Konstantin Ananyev, dev; +Cc: nd, Honnappa Nagarahalli, nd

<snip>

> > 主题: [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
> >
> > Rename test_ring_peek_stress to test_ring_mt_peek_stress to keep same
> > naming conventions for ST and MT test cases.
> >
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> > ---
> >  app/test/Makefile                                             | 2 +-
> >  app/test/meson.build                                          | 2 +-
> >  .../{test_ring_peek_stress.c => test_ring_mt_peek_stress.c}   | 2 +-
> >  app/test/test_ring_stress.c                                   | 4 ++--
> >  app/test/test_ring_stress.h                                   | 2 +-
> >  5 files changed, 6 insertions(+), 6 deletions(-)  rename
> > app/test/{test_ring_peek_stress.c => test_ring_mt_peek_stress.c} (94%)
> >
> > diff --git a/app/test/Makefile b/app/test/Makefile index
> > 37bdaf891..e5440774b 100644
> > --- a/app/test/Makefile
> > +++ b/app/test/Makefile
> > @@ -81,7 +81,7 @@ SRCS-y += test_ring.c  SRCS-y +=
> > test_ring_mpmc_stress.c  SRCS-y += test_ring_hts_stress.c  SRCS-y +=
> > test_ring_perf.c -SRCS-y += test_ring_peek_stress.c
> > +SRCS-y += test_ring_mt_peek_stress.c
> >  SRCS-y += test_ring_rts_stress.c
> >  SRCS-y += test_ring_st_peek_stress.c
> >  SRCS-y += test_ring_stress.c
> > diff --git a/app/test/meson.build b/app/test/meson.build index
> > 5cb050958..d8c5b5295 100644
> > --- a/app/test/meson.build
> > +++ b/app/test/meson.build
> > @@ -105,7 +105,7 @@ test_sources = files('commands.c',  'test_ring.c',
> > 'test_ring_mpmc_stress.c',  'test_ring_hts_stress.c',
> > -'test_ring_peek_stress.c',
> > +'test_ring_mt_peek_stress.c',
> So it seems there will be peek API for MT mode, I agree with that.
> However, due to the characteristic of peek API that the thread can change its
> number of planned enqueue elements, after it moves prod_head.
> This may causing confusion for other threads.
> Furthermore, for the implement of peek API for MT or RTS mode, we may
> need to add some restrictions to make it work correctly.
I think this renaming is good enough for the APIs we have currently.
If renaming is required in the future due to new APIs, we could do them when needed.

> Thanks.
> >  'test_ring_perf.c',
> >  'test_ring_rts_stress.c',
> >  'test_ring_st_peek_stress.c',
> > diff --git a/app/test/test_ring_peek_stress.c
> > b/app/test/test_ring_mt_peek_stress.c
> > similarity index 94%
> > rename from app/test/test_ring_peek_stress.c rename to
> > app/test/test_ring_mt_peek_stress.c
> > index cfc82d728..4d521422f 100644
> > --- a/app/test/test_ring_peek_stress.c
> > +++ b/app/test/test_ring_mt_peek_stress.c
> > @@ -36,7 +36,7 @@ _st_ring_init(struct rte_ring *r, const char *name,
> > uint32_t num)  RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ);  }
> >
> > -const struct test test_ring_peek_stress = {
> > +const struct test test_ring_mt_peek_stress = {
> >  .name = "MT_PEEK",
> >  .nb_case = RTE_DIM(tests),
> >  .cases = tests,
> > diff --git a/app/test/test_ring_stress.c b/app/test/test_ring_stress.c
> > index
> > 387cfa747..c4f82ea56 100644
> > --- a/app/test/test_ring_stress.c
> > +++ b/app/test/test_ring_stress.c
> > @@ -46,8 +46,8 @@ test_ring_stress(void)  n +=
> > test_ring_hts_stress.nb_case;  k += run_test(&test_ring_hts_stress);
> >
> > -n += test_ring_peek_stress.nb_case;
> > -k += run_test(&test_ring_peek_stress);
> > +n += test_ring_mt_peek_stress.nb_case; k +=
> > +run_test(&test_ring_mt_peek_stress);
> >
> >  n += test_ring_st_peek_stress.nb_case;  k +=
> > run_test(&test_ring_st_peek_stress);
> > diff --git a/app/test/test_ring_stress.h b/app/test/test_ring_stress.h
> > index
> > a9a390341..c85d6fa92 100644
> > --- a/app/test/test_ring_stress.h
> > +++ b/app/test/test_ring_stress.h
> > @@ -35,5 +35,5 @@ struct test {
> >  extern const struct test test_ring_mpmc_stress;  extern const struct
> > test test_ring_rts_stress;  extern const struct test
> > test_ring_hts_stress; -extern const struct test test_ring_peek_stress;
> > +extern const struct test test_ring_mt_peek_stress;
> >  extern const struct test test_ring_st_peek_stress;
> > --
> > 2.17.1
> 


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

* [dpdk-dev] 回复: [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
  2020-07-03  2:37       ` [dpdk-dev] " Honnappa Nagarahalli
@ 2020-07-03  3:01         ` Feifei Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Feifei Wang @ 2020-07-03  3:01 UTC (permalink / raw)
  To: Honnappa Nagarahalli, Konstantin Ananyev, dev; +Cc: nd, nd



> -----邮件原件-----
> 发件人: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> 发送时间: 2020年7月3日 10:38
> 收件人: Feifei Wang <Feifei.Wang2@arm.com>; Konstantin Ananyev
> <konstantin.ananyev@intel.com>; dev@dpdk.org
> 抄送: nd <nd@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; nd <nd@arm.com>
> 主题: RE: [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
>
> <snip>
>
> > > 主题: [PATCH v2 2/2] test/ring: rearrange names for ring stress tests
> > >
> > > Rename test_ring_peek_stress to test_ring_mt_peek_stress to keep
> > > same naming conventions for ST and MT test cases.
> > >
> > > Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> > > ---
> > >  app/test/Makefile                                             | 2 +-
> > >  app/test/meson.build                                          | 2 +-
> > >  .../{test_ring_peek_stress.c => test_ring_mt_peek_stress.c}   | 2 +-
> > >  app/test/test_ring_stress.c                                   | 4 ++--
> > >  app/test/test_ring_stress.h                                   | 2 +-
> > >  5 files changed, 6 insertions(+), 6 deletions(-)  rename
> > > app/test/{test_ring_peek_stress.c => test_ring_mt_peek_stress.c}
> > > (94%)
> > >
> > > diff --git a/app/test/Makefile b/app/test/Makefile index
> > > 37bdaf891..e5440774b 100644
> > > --- a/app/test/Makefile
> > > +++ b/app/test/Makefile
> > > @@ -81,7 +81,7 @@ SRCS-y += test_ring.c  SRCS-y +=
> > > test_ring_mpmc_stress.c  SRCS-y += test_ring_hts_stress.c  SRCS-y +=
> > > test_ring_perf.c -SRCS-y += test_ring_peek_stress.c
> > > +SRCS-y += test_ring_mt_peek_stress.c
> > >  SRCS-y += test_ring_rts_stress.c
> > >  SRCS-y += test_ring_st_peek_stress.c  SRCS-y += test_ring_stress.c
> > > diff --git a/app/test/meson.build b/app/test/meson.build index
> > > 5cb050958..d8c5b5295 100644
> > > --- a/app/test/meson.build
> > > +++ b/app/test/meson.build
> > > @@ -105,7 +105,7 @@ test_sources = files('commands.c',
> > > 'test_ring.c', 'test_ring_mpmc_stress.c',  'test_ring_hts_stress.c',
> > > -'test_ring_peek_stress.c',
> > > +'test_ring_mt_peek_stress.c',
> > So it seems there will be peek API for MT mode, I agree with that.
> > However, due to the characteristic of peek API that the thread can
> > change its number of planned enqueue elements, after it moves
> prod_head.
> > This may causing confusion for other threads.
> > Furthermore, for the implement of peek API for MT or RTS mode, we may
> > need to add some restrictions to make it work correctly.
> I think this renaming is good enough for the APIs we have currently.
> If renaming is required in the future due to new APIs, we could do them
> when needed.
>
Ok, That's great.
> > Thanks.
> > >  'test_ring_perf.c',
> > >  'test_ring_rts_stress.c',
> > >  'test_ring_st_peek_stress.c',
> > > diff --git a/app/test/test_ring_peek_stress.c
> > > b/app/test/test_ring_mt_peek_stress.c
> > > similarity index 94%
> > > rename from app/test/test_ring_peek_stress.c rename to
> > > app/test/test_ring_mt_peek_stress.c
> > > index cfc82d728..4d521422f 100644
> > > --- a/app/test/test_ring_peek_stress.c
> > > +++ b/app/test/test_ring_mt_peek_stress.c
> > > @@ -36,7 +36,7 @@ _st_ring_init(struct rte_ring *r, const char
> > > *name, uint32_t num)  RING_F_MP_HTS_ENQ |
> RING_F_MC_HTS_DEQ);  }
> > >
> > > -const struct test test_ring_peek_stress = {
> > > +const struct test test_ring_mt_peek_stress = {
> > >  .name = "MT_PEEK",
> > >  .nb_case = RTE_DIM(tests),
> > >  .cases = tests,
> > > diff --git a/app/test/test_ring_stress.c
> > > b/app/test/test_ring_stress.c index
> > > 387cfa747..c4f82ea56 100644
> > > --- a/app/test/test_ring_stress.c
> > > +++ b/app/test/test_ring_stress.c
> > > @@ -46,8 +46,8 @@ test_ring_stress(void)  n +=
> > > test_ring_hts_stress.nb_case;  k += run_test(&test_ring_hts_stress);
> > >
> > > -n += test_ring_peek_stress.nb_case; -k +=
> > > run_test(&test_ring_peek_stress);
> > > +n += test_ring_mt_peek_stress.nb_case; k +=
> > > +run_test(&test_ring_mt_peek_stress);
> > >
> > >  n += test_ring_st_peek_stress.nb_case;  k +=
> > > run_test(&test_ring_st_peek_stress);
> > > diff --git a/app/test/test_ring_stress.h
> > > b/app/test/test_ring_stress.h index
> > > a9a390341..c85d6fa92 100644
> > > --- a/app/test/test_ring_stress.h
> > > +++ b/app/test/test_ring_stress.h
> > > @@ -35,5 +35,5 @@ struct test {
> > >  extern const struct test test_ring_mpmc_stress;  extern const
> > > struct test test_ring_rts_stress;  extern const struct test
> > > test_ring_hts_stress; -extern const struct test
> > > test_ring_peek_stress;
> > > +extern const struct test test_ring_mt_peek_stress;
> > >  extern const struct test test_ring_st_peek_stress;
> > > --
> > > 2.17.1
> >

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API
  2020-07-02 14:10 ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API Konstantin Ananyev
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 1/2] test/ring: add stress test for ST peek API Konstantin Ananyev
  2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests Konstantin Ananyev
@ 2020-07-03 10:40   ` David Marchand
  2 siblings, 0 replies; 13+ messages in thread
From: David Marchand @ 2020-07-03 10:40 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Honnappa Nagarahalli, Feifei Wang

On Thu, Jul 2, 2020 at 4:11 PM Konstantin Ananyev
<konstantin.ananyev@intel.com> wrote:
>
> Introduce new test case to test ST peek API.
> Changes name for MT peek ring test to follow same naming convention.
>
> Konstantin Ananyev (2):
>   test/ring: add stress test for ST peek API
>   test/ring: rearrange names for ring stress tests
>
>  app/test/Makefile                             |  3 +-
>  app/test/meson.build                          |  3 +-
>  ...ek_stress.c => test_ring_mt_peek_stress.c} |  2 +-
>  app/test/test_ring_st_peek_stress.c           | 54 +++++++++++++++++++
>  app/test/test_ring_stress.c                   |  7 ++-
>  app/test/test_ring_stress.h                   |  3 +-
>  6 files changed, 66 insertions(+), 6 deletions(-)
>  rename app/test/{test_ring_peek_stress.c => test_ring_mt_peek_stress.c} (94%)
>  create mode 100644 app/test/test_ring_st_peek_stress.c

Series applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2020-07-03 10:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-30 16:21 [dpdk-dev] [PATCH] test/ring: add stress test for ST peek API Konstantin Ananyev
2020-06-30 23:01 ` Honnappa Nagarahalli
2020-07-01 10:34   ` Ananyev, Konstantin
2020-07-01 14:05     ` Honnappa Nagarahalli
2020-07-02 14:10 ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API Konstantin Ananyev
2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 1/2] test/ring: add stress test for ST peek API Konstantin Ananyev
2020-07-02 16:18     ` Honnappa Nagarahalli
2020-07-02 14:10   ` [dpdk-dev] [PATCH v2 2/2] test/ring: rearrange names for ring stress tests Konstantin Ananyev
2020-07-02 16:18     ` Honnappa Nagarahalli
2020-07-03  1:46     ` [dpdk-dev] 回复: " Feifei Wang
2020-07-03  2:37       ` [dpdk-dev] " Honnappa Nagarahalli
2020-07-03  3:01         ` [dpdk-dev] 回复: " Feifei Wang
2020-07-03 10:40   ` [dpdk-dev] [PATCH v2 0/2] extend test coverage for ring PEEK API 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).