DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t
@ 2019-05-08 21:02 David Christensen
  2019-05-08 21:02 ` David Christensen
  2019-05-09 18:10 ` Ananyev, Konstantin
  0 siblings, 2 replies; 4+ messages in thread
From: David Christensen @ 2019-05-08 21:02 UTC (permalink / raw)
  To: dev; +Cc: David Christensen

Memory barrier failures can be intermittent. Increase the size of the
sum/val/iteration variables to allow tests that can run for days so that
sporadic errors can be identified.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
v2:
* Removed change to ITER_MAX
v3:
* None
---
 app/test/test_barrier.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c
index ae37b1e..a0b4704 100644
--- a/app/test/test_barrier.c
+++ b/app/test/test_barrier.c
@@ -55,8 +55,8 @@ struct plock {
  */
 struct plock_test {
 	struct plock lock;
-	uint32_t val;
-	uint32_t iter;
+	uint64_t val;
+	uint64_t iter;
 };
 
 /*
@@ -65,8 +65,8 @@ struct plock_test {
  */
 struct lcore_plock_test {
 	struct plock_test *pt[2]; /* shared, lock-protected data */
-	uint32_t sum[2];          /* local copy of the shared data */
-	uint32_t iter;            /* number of iterations to perfom */
+	uint64_t sum[2];          /* local copy of the shared data */
+	uint64_t iter;            /* number of iterations to perfom */
 	uint32_t lc;              /* given lcore id */
 };
 
@@ -130,7 +130,8 @@ struct lcore_plock_test {
 plock_test1_lcore(void *data)
 {
 	uint64_t tm;
-	uint32_t i, lc, ln, n;
+	uint32_t lc, ln;
+	uint64_t i, n;
 	struct lcore_plock_test *lpt;
 
 	lpt = data;
@@ -166,9 +167,9 @@ struct lcore_plock_test {
 
 	tm = rte_get_timer_cycles() - tm;
 
-	printf("%s(%u): %u iterations finished, in %" PRIu64
+	printf("%s(%u): %" PRIu64 " iterations finished, in %" PRIu64
 		" cycles, %#Lf cycles/iteration, "
-		"local sum={%u, %u}\n",
+		"local sum={%" PRIu64 ", %" PRIu64 "}\n",
 		__func__, lc, i, tm, (long double)tm / i,
 		lpt->sum[0], lpt->sum[1]);
 	return 0;
@@ -184,11 +185,11 @@ struct lcore_plock_test {
  * and local data are the same.
  */
 static int
-plock_test(uint32_t iter, enum plock_use_type utype)
+plock_test(uint64_t iter, enum plock_use_type utype)
 {
 	int32_t rc;
 	uint32_t i, lc, n;
-	uint32_t *sum;
+	uint64_t *sum;
 	struct plock_test *pt;
 	struct lcore_plock_test *lpt;
 
@@ -199,7 +200,7 @@ struct lcore_plock_test {
 	lpt = calloc(n, sizeof(*lpt));
 	sum = calloc(n + 1, sizeof(*sum));
 
-	printf("%s(iter=%u, utype=%u) started on %u lcores\n",
+	printf("%s(iter=%" PRIu64 ", utype=%u) started on %u lcores\n",
 		__func__, iter, utype, n);
 
 	if (pt == NULL || lpt == NULL || sum == NULL) {
@@ -247,7 +248,7 @@ struct lcore_plock_test {
 
 	rc = 0;
 	for (i = 0; i != n; i++) {
-		printf("%s: sum[%u]=%u, pt[%u].val=%u, pt[%u].iter=%u;\n",
+		printf("%s: sum[%u]=%" PRIu64 ", pt[%u].val=%" PRIu64 ", pt[%u].iter=%" PRIu64 ";\n",
 			__func__, i, sum[i], i, pt[i].val, i, pt[i].iter);
 
 		/* race condition occurred, lock doesn't work properly */
-- 
1.8.3.1

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

* [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t
  2019-05-08 21:02 [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t David Christensen
@ 2019-05-08 21:02 ` David Christensen
  2019-05-09 18:10 ` Ananyev, Konstantin
  1 sibling, 0 replies; 4+ messages in thread
From: David Christensen @ 2019-05-08 21:02 UTC (permalink / raw)
  To: dev; +Cc: David Christensen

Memory barrier failures can be intermittent. Increase the size of the
sum/val/iteration variables to allow tests that can run for days so that
sporadic errors can be identified.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
v2:
* Removed change to ITER_MAX
v3:
* None
---
 app/test/test_barrier.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c
index ae37b1e..a0b4704 100644
--- a/app/test/test_barrier.c
+++ b/app/test/test_barrier.c
@@ -55,8 +55,8 @@ struct plock {
  */
 struct plock_test {
 	struct plock lock;
-	uint32_t val;
-	uint32_t iter;
+	uint64_t val;
+	uint64_t iter;
 };
 
 /*
@@ -65,8 +65,8 @@ struct plock_test {
  */
 struct lcore_plock_test {
 	struct plock_test *pt[2]; /* shared, lock-protected data */
-	uint32_t sum[2];          /* local copy of the shared data */
-	uint32_t iter;            /* number of iterations to perfom */
+	uint64_t sum[2];          /* local copy of the shared data */
+	uint64_t iter;            /* number of iterations to perfom */
 	uint32_t lc;              /* given lcore id */
 };
 
@@ -130,7 +130,8 @@ struct lcore_plock_test {
 plock_test1_lcore(void *data)
 {
 	uint64_t tm;
-	uint32_t i, lc, ln, n;
+	uint32_t lc, ln;
+	uint64_t i, n;
 	struct lcore_plock_test *lpt;
 
 	lpt = data;
@@ -166,9 +167,9 @@ struct lcore_plock_test {
 
 	tm = rte_get_timer_cycles() - tm;
 
-	printf("%s(%u): %u iterations finished, in %" PRIu64
+	printf("%s(%u): %" PRIu64 " iterations finished, in %" PRIu64
 		" cycles, %#Lf cycles/iteration, "
-		"local sum={%u, %u}\n",
+		"local sum={%" PRIu64 ", %" PRIu64 "}\n",
 		__func__, lc, i, tm, (long double)tm / i,
 		lpt->sum[0], lpt->sum[1]);
 	return 0;
@@ -184,11 +185,11 @@ struct lcore_plock_test {
  * and local data are the same.
  */
 static int
-plock_test(uint32_t iter, enum plock_use_type utype)
+plock_test(uint64_t iter, enum plock_use_type utype)
 {
 	int32_t rc;
 	uint32_t i, lc, n;
-	uint32_t *sum;
+	uint64_t *sum;
 	struct plock_test *pt;
 	struct lcore_plock_test *lpt;
 
@@ -199,7 +200,7 @@ struct lcore_plock_test {
 	lpt = calloc(n, sizeof(*lpt));
 	sum = calloc(n + 1, sizeof(*sum));
 
-	printf("%s(iter=%u, utype=%u) started on %u lcores\n",
+	printf("%s(iter=%" PRIu64 ", utype=%u) started on %u lcores\n",
 		__func__, iter, utype, n);
 
 	if (pt == NULL || lpt == NULL || sum == NULL) {
@@ -247,7 +248,7 @@ struct lcore_plock_test {
 
 	rc = 0;
 	for (i = 0; i != n; i++) {
-		printf("%s: sum[%u]=%u, pt[%u].val=%u, pt[%u].iter=%u;\n",
+		printf("%s: sum[%u]=%" PRIu64 ", pt[%u].val=%" PRIu64 ", pt[%u].iter=%" PRIu64 ";\n",
 			__func__, i, sum[i], i, pt[i].val, i, pt[i].iter);
 
 		/* race condition occurred, lock doesn't work properly */
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t
  2019-05-08 21:02 [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t David Christensen
  2019-05-08 21:02 ` David Christensen
@ 2019-05-09 18:10 ` Ananyev, Konstantin
  2019-05-09 18:10   ` Ananyev, Konstantin
  1 sibling, 1 reply; 4+ messages in thread
From: Ananyev, Konstantin @ 2019-05-09 18:10 UTC (permalink / raw)
  To: David Christensen, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Christensen
> Sent: Wednesday, May 8, 2019 10:03 PM
> To: dev@dpdk.org
> Cc: David Christensen <drc@linux.vnet.ibm.com>
> Subject: [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t
> 
> Memory barrier failures can be intermittent. Increase the size of the
> sum/val/iteration variables to allow tests that can run for days so that
> sporadic errors can be identified.
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
> v2:
> * Removed change to ITER_MAX
> v3:
> * None
> ---
>  app/test/test_barrier.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c
> index ae37b1e..a0b4704 100644
> --- a/app/test/test_barrier.c
> +++ b/app/test/test_barrier.c
> @@ -55,8 +55,8 @@ struct plock {
>   */
>  struct plock_test {
>  	struct plock lock;
> -	uint32_t val;
> -	uint32_t iter;
> +	uint64_t val;
> +	uint64_t iter;
>  };
> 
>  /*
> @@ -65,8 +65,8 @@ struct plock_test {
>   */
>  struct lcore_plock_test {
>  	struct plock_test *pt[2]; /* shared, lock-protected data */
> -	uint32_t sum[2];          /* local copy of the shared data */
> -	uint32_t iter;            /* number of iterations to perfom */
> +	uint64_t sum[2];          /* local copy of the shared data */
> +	uint64_t iter;            /* number of iterations to perfom */
>  	uint32_t lc;              /* given lcore id */
>  };
> 
> @@ -130,7 +130,8 @@ struct lcore_plock_test {
>  plock_test1_lcore(void *data)
>  {
>  	uint64_t tm;
> -	uint32_t i, lc, ln, n;
> +	uint32_t lc, ln;
> +	uint64_t i, n;
>  	struct lcore_plock_test *lpt;
> 
>  	lpt = data;
> @@ -166,9 +167,9 @@ struct lcore_plock_test {
> 
>  	tm = rte_get_timer_cycles() - tm;
> 
> -	printf("%s(%u): %u iterations finished, in %" PRIu64
> +	printf("%s(%u): %" PRIu64 " iterations finished, in %" PRIu64
>  		" cycles, %#Lf cycles/iteration, "
> -		"local sum={%u, %u}\n",
> +		"local sum={%" PRIu64 ", %" PRIu64 "}\n",
>  		__func__, lc, i, tm, (long double)tm / i,
>  		lpt->sum[0], lpt->sum[1]);
>  	return 0;
> @@ -184,11 +185,11 @@ struct lcore_plock_test {
>   * and local data are the same.
>   */
>  static int
> -plock_test(uint32_t iter, enum plock_use_type utype)
> +plock_test(uint64_t iter, enum plock_use_type utype)
>  {
>  	int32_t rc;
>  	uint32_t i, lc, n;
> -	uint32_t *sum;
> +	uint64_t *sum;
>  	struct plock_test *pt;
>  	struct lcore_plock_test *lpt;
> 
> @@ -199,7 +200,7 @@ struct lcore_plock_test {
>  	lpt = calloc(n, sizeof(*lpt));
>  	sum = calloc(n + 1, sizeof(*sum));
> 
> -	printf("%s(iter=%u, utype=%u) started on %u lcores\n",
> +	printf("%s(iter=%" PRIu64 ", utype=%u) started on %u lcores\n",
>  		__func__, iter, utype, n);
> 
>  	if (pt == NULL || lpt == NULL || sum == NULL) {
> @@ -247,7 +248,7 @@ struct lcore_plock_test {
> 
>  	rc = 0;
>  	for (i = 0; i != n; i++) {
> -		printf("%s: sum[%u]=%u, pt[%u].val=%u, pt[%u].iter=%u;\n",
> +		printf("%s: sum[%u]=%" PRIu64 ", pt[%u].val=%" PRIu64 ", pt[%u].iter=%" PRIu64 ";\n",
>  			__func__, i, sum[i], i, pt[i].val, i, pt[i].iter);
> 
>  		/* race condition occurred, lock doesn't work properly */
> --

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

> 1.8.3.1

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

* Re: [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t
  2019-05-09 18:10 ` Ananyev, Konstantin
@ 2019-05-09 18:10   ` Ananyev, Konstantin
  0 siblings, 0 replies; 4+ messages in thread
From: Ananyev, Konstantin @ 2019-05-09 18:10 UTC (permalink / raw)
  To: David Christensen, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Christensen
> Sent: Wednesday, May 8, 2019 10:03 PM
> To: dev@dpdk.org
> Cc: David Christensen <drc@linux.vnet.ibm.com>
> Subject: [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t
> 
> Memory barrier failures can be intermittent. Increase the size of the
> sum/val/iteration variables to allow tests that can run for days so that
> sporadic errors can be identified.
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
> v2:
> * Removed change to ITER_MAX
> v3:
> * None
> ---
>  app/test/test_barrier.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/app/test/test_barrier.c b/app/test/test_barrier.c
> index ae37b1e..a0b4704 100644
> --- a/app/test/test_barrier.c
> +++ b/app/test/test_barrier.c
> @@ -55,8 +55,8 @@ struct plock {
>   */
>  struct plock_test {
>  	struct plock lock;
> -	uint32_t val;
> -	uint32_t iter;
> +	uint64_t val;
> +	uint64_t iter;
>  };
> 
>  /*
> @@ -65,8 +65,8 @@ struct plock_test {
>   */
>  struct lcore_plock_test {
>  	struct plock_test *pt[2]; /* shared, lock-protected data */
> -	uint32_t sum[2];          /* local copy of the shared data */
> -	uint32_t iter;            /* number of iterations to perfom */
> +	uint64_t sum[2];          /* local copy of the shared data */
> +	uint64_t iter;            /* number of iterations to perfom */
>  	uint32_t lc;              /* given lcore id */
>  };
> 
> @@ -130,7 +130,8 @@ struct lcore_plock_test {
>  plock_test1_lcore(void *data)
>  {
>  	uint64_t tm;
> -	uint32_t i, lc, ln, n;
> +	uint32_t lc, ln;
> +	uint64_t i, n;
>  	struct lcore_plock_test *lpt;
> 
>  	lpt = data;
> @@ -166,9 +167,9 @@ struct lcore_plock_test {
> 
>  	tm = rte_get_timer_cycles() - tm;
> 
> -	printf("%s(%u): %u iterations finished, in %" PRIu64
> +	printf("%s(%u): %" PRIu64 " iterations finished, in %" PRIu64
>  		" cycles, %#Lf cycles/iteration, "
> -		"local sum={%u, %u}\n",
> +		"local sum={%" PRIu64 ", %" PRIu64 "}\n",
>  		__func__, lc, i, tm, (long double)tm / i,
>  		lpt->sum[0], lpt->sum[1]);
>  	return 0;
> @@ -184,11 +185,11 @@ struct lcore_plock_test {
>   * and local data are the same.
>   */
>  static int
> -plock_test(uint32_t iter, enum plock_use_type utype)
> +plock_test(uint64_t iter, enum plock_use_type utype)
>  {
>  	int32_t rc;
>  	uint32_t i, lc, n;
> -	uint32_t *sum;
> +	uint64_t *sum;
>  	struct plock_test *pt;
>  	struct lcore_plock_test *lpt;
> 
> @@ -199,7 +200,7 @@ struct lcore_plock_test {
>  	lpt = calloc(n, sizeof(*lpt));
>  	sum = calloc(n + 1, sizeof(*sum));
> 
> -	printf("%s(iter=%u, utype=%u) started on %u lcores\n",
> +	printf("%s(iter=%" PRIu64 ", utype=%u) started on %u lcores\n",
>  		__func__, iter, utype, n);
> 
>  	if (pt == NULL || lpt == NULL || sum == NULL) {
> @@ -247,7 +248,7 @@ struct lcore_plock_test {
> 
>  	rc = 0;
>  	for (i = 0; i != n; i++) {
> -		printf("%s: sum[%u]=%u, pt[%u].val=%u, pt[%u].iter=%u;\n",
> +		printf("%s: sum[%u]=%" PRIu64 ", pt[%u].val=%" PRIu64 ", pt[%u].iter=%" PRIu64 ";\n",
>  			__func__, i, sum[i], i, pt[i].val, i, pt[i].iter);
> 
>  		/* race condition occurred, lock doesn't work properly */
> --

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

> 1.8.3.1


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

end of thread, other threads:[~2019-05-09 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08 21:02 [dpdk-dev] [PATCH v3 3/4] test: change memory barrier variables to uint64_t David Christensen
2019-05-08 21:02 ` David Christensen
2019-05-09 18:10 ` Ananyev, Konstantin
2019-05-09 18:10   ` Ananyev, Konstantin

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).