patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Christensen <drc@linux.vnet.ibm.com>
To: dev@dpdk.org
Cc: phil.yang@arm.com, stable@dpdk.org,
	David Christensen <drc@linux.vnet.ibm.com>
Subject: [dpdk-stable] [PATCH] test/atomic: fix false failures for 128-bit atomic compare exchange test
Date: Thu,  2 Sep 2021 10:41:04 -0700	[thread overview]
Message-ID: <20210902174104.3181444-1-drc@linux.vnet.ibm.com> (raw)

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


             reply	other threads:[~2021-09-02 17:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02 17:41 David Christensen [this message]
2021-09-03  6:59 ` [dpdk-stable] [dpdk-dev] " Ruifeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210902174104.3181444-1-drc@linux.vnet.ibm.com \
    --to=drc@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    --cc=phil.yang@arm.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).