DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test/atomic: fix false failures for 128-bit atomic compare exchange test
@ 2021-09-02 17:41 David Christensen
  2021-09-03  6:59 ` Ruifeng Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Christensen @ 2021-09-02 17:41 UTC (permalink / raw)
  To: dev; +Cc: phil.yang, stable, David Christensen

When checking the results of the rte_atomic128_cmp_exchange() function,
current code compares the values of a uint32_t and a uint64_t variable.
If the number of lcores used by the test is large, or the value of the
iteration count N is increased, the variable size mimatch can cause a
false test failure.  Modify the comparison to compare uint64_t values.

Fixes: fa3253c534b1 ("test/atomic: add 128-bit atomic compare exchange test")
Cc: phil.yang@arm.com

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
---
 app/test/test_atomic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index f10f555af8..ce0c259bd7 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -591,7 +591,7 @@ test_atomic(void)
 	rte_atomic32_clear(&synchro);
 
 	iterations = count128.val[0] - count128.val[1];
-	if (iterations != 4*N*(rte_lcore_count()-1)) {
+	if (iterations != (uint64_t)4*N*(rte_lcore_count()-1)) {
 		printf("128-bit compare and swap failed\n");
 		return -1;
 	}
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH] test/atomic: fix false failures for 128-bit atomic compare exchange test
  2021-09-02 17:41 [dpdk-dev] [PATCH] test/atomic: fix false failures for 128-bit atomic compare exchange test David Christensen
@ 2021-09-03  6:59 ` Ruifeng Wang
  2021-09-08 17:25 ` [dpdk-dev] [PATCH v2] " David Christensen
  2021-09-08 17:48 ` David Christensen
  2 siblings, 0 replies; 5+ messages in thread
From: Ruifeng Wang @ 2021-09-03  6:59 UTC (permalink / raw)
  To: David Christensen, dev; +Cc: Phil Yang, stable, nd

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of David Christensen
> Sent: Friday, September 3, 2021 1:41 AM
> To: dev@dpdk.org
> Cc: Phil Yang <Phil.Yang@arm.com>; stable@dpdk.org; David Christensen
> <drc@linux.vnet.ibm.com>
> Subject: [dpdk-dev] [PATCH] test/atomic: fix false failures for 128-bit atomic
> compare exchange test
> 
> When checking the results of the rte_atomic128_cmp_exchange() function,
> current code compares the values of a uint32_t and a uint64_t variable.
> If the number of lcores used by the test is large, or the value of the iteration
> count N is increased, the variable size mimatch can cause a false test failure.
> Modify the comparison to compare uint64_t values.
> 
> Fixes: fa3253c534b1 ("test/atomic: add 128-bit atomic compare exchange
> test")
> Cc: phil.yang@arm.com

This mail address is unreachable. 

I reproduced the issue on a 160-core aarch64 machine with increased N.

Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> 
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> ---
>  app/test/test_atomic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c index
> f10f555af8..ce0c259bd7 100644
> --- a/app/test/test_atomic.c
> +++ b/app/test/test_atomic.c
> @@ -591,7 +591,7 @@ test_atomic(void)
>  	rte_atomic32_clear(&synchro);
> 
>  	iterations = count128.val[0] - count128.val[1];
> -	if (iterations != 4*N*(rte_lcore_count()-1)) {
> +	if (iterations != (uint64_t)4*N*(rte_lcore_count()-1)) {
>  		printf("128-bit compare and swap failed\n");
>  		return -1;
>  	}
> --
> 2.27.0


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

* [dpdk-dev] [PATCH v2] test/atomic: fix false failures for 128-bit atomic compare exchange test
  2021-09-02 17:41 [dpdk-dev] [PATCH] test/atomic: fix false failures for 128-bit atomic compare exchange test David Christensen
  2021-09-03  6:59 ` Ruifeng Wang
@ 2021-09-08 17:25 ` David Christensen
  2021-09-08 17:48 ` David Christensen
  2 siblings, 0 replies; 5+ messages in thread
From: David Christensen @ 2021-09-08 17:25 UTC (permalink / raw)
  To: dev; +Cc: Ruifeng.Wang, David Christensen, phil.yang, Ruifeng Wang

When checking the results of the rte_atomic128_cmp_exchange() function,
current code compares the values of a uint32_t and a uint64_t variable.
If the number of lcores used by the test is large, or the value of the
iteration count N is increased, the variable size mismatch can cause a
false test failure.  Modify the comparison to compare uint64_t values.

Fixes: fa3253c534b1 ("test/atomic: add 128-bit atomic compare exchange test")
Cc: phil.yang@arm.com

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
v2:
- Fixed commit message spelling error
---
 app/test/test_atomic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index f10f555af8..ce0c259bd7 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -591,7 +591,7 @@ test_atomic(void)
 	rte_atomic32_clear(&synchro);

 	iterations = count128.val[0] - count128.val[1];
-	if (iterations != 4*N*(rte_lcore_count()-1)) {
+	if (iterations != (uint64_t)4*N*(rte_lcore_count()-1)) {
 		printf("128-bit compare and swap failed\n");
 		return -1;
 	}
--
2.27.0


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

* [dpdk-dev] [PATCH v2] test/atomic: fix false failures for 128-bit atomic compare exchange test
  2021-09-02 17:41 [dpdk-dev] [PATCH] test/atomic: fix false failures for 128-bit atomic compare exchange test David Christensen
  2021-09-03  6:59 ` Ruifeng Wang
  2021-09-08 17:25 ` [dpdk-dev] [PATCH v2] " David Christensen
@ 2021-09-08 17:48 ` David Christensen
  2021-10-14 15:28   ` David Marchand
  2 siblings, 1 reply; 5+ messages in thread
From: David Christensen @ 2021-09-08 17:48 UTC (permalink / raw)
  To: dev, thomas; +Cc: Ruifeng.Wang, David Christensen, phil.yang, Ruifeng Wang

When checking the results of the rte_atomic128_cmp_exchange() function,
current code compares the values of a uint32_t and a uint64_t variable.
If the number of lcores used by the test is large, or the value of the
iteration count N is increased, the variable size mismatch can cause a
false test failure.  Modify the comparison to compare uint64_t values.

Fixes: fa3253c534b1 ("test/atomic: add 128-bit atomic compare exchange test")
Cc: phil.yang@arm.com

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
v2:
- Fixed commit message spelling error
---
 app/test/test_atomic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index f10f555af8..ce0c259bd7 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -591,7 +591,7 @@ test_atomic(void)
 	rte_atomic32_clear(&synchro);

 	iterations = count128.val[0] - count128.val[1];
-	if (iterations != 4*N*(rte_lcore_count()-1)) {
+	if (iterations != (uint64_t)4*N*(rte_lcore_count()-1)) {
 		printf("128-bit compare and swap failed\n");
 		return -1;
 	}
--
2.27.0


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

* Re: [dpdk-dev] [PATCH v2] test/atomic: fix false failures for 128-bit atomic compare exchange test
  2021-09-08 17:48 ` David Christensen
@ 2021-10-14 15:28   ` David Marchand
  0 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2021-10-14 15:28 UTC (permalink / raw)
  To: David Christensen
  Cc: dev, Thomas Monjalon, Ruifeng Wang (Arm Technology China), Phil Yang

On Wed, Sep 8, 2021 at 7:48 PM David Christensen <drc@linux.vnet.ibm.com> wrote:
>
> When checking the results of the rte_atomic128_cmp_exchange() function,
> current code compares the values of a uint32_t and a uint64_t variable.
> If the number of lcores used by the test is large, or the value of the
> iteration count N is increased, the variable size mismatch can cause a
> false test failure.  Modify the comparison to compare uint64_t values.
>
> Fixes: fa3253c534b1 ("test/atomic: add 128-bit atomic compare exchange test")
>
> Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
> Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2021-10-14 15:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 17:41 [dpdk-dev] [PATCH] test/atomic: fix false failures for 128-bit atomic compare exchange test David Christensen
2021-09-03  6:59 ` Ruifeng Wang
2021-09-08 17:25 ` [dpdk-dev] [PATCH v2] " David Christensen
2021-09-08 17:48 ` David Christensen
2021-10-14 15:28   ` 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).