From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2C495A0C5C; Wed, 8 Sep 2021 19:48:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A95ED40E01; Wed, 8 Sep 2021 19:48:32 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by mails.dpdk.org (Postfix) with ESMTP id B23324003E for ; Wed, 8 Sep 2021 19:48:31 +0200 (CEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 188HY0t1083953; Wed, 8 Sep 2021 13:48:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=ABaAtuvNlEDWxl7dEHgA07NhmEV70xFQBDn3MsRKGqw=; b=aVGbLxm5boiLOHgwd5nGtCFQ6Ehrkpa3Vdpnp7YfVsCuWz8zsk1yQiOuJq9fy6NKqUug OYMLVlm+u5c75Vx13zxCShMniajTBqsntg9Cpjvf+IeZIpg+Gp/HHngCWewvb5LWzs+q 369n98/RHAhNIOs7vkPUgs8NbSw1dJwPrWQDljCDElv3IWYqrhf9jrO/gG/rI3Hizghw mlHXuCVv3n0nbVUPE/CUYEG24ZD5MK3typCGZ7DkRA2V2qMZokg/tptEE1K1U3J8re2g /6xQnFpLBNVxFcA8BeDEHaUbBkVAWrOuMy7UEBHmWMuudA2kexUEt1ELhAOdQq9fDKVs gA== Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ay0a9ayhs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 13:48:27 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 188HlNNJ023245; Wed, 8 Sep 2021 17:48:26 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma04wdc.us.ibm.com with ESMTP id 3axcnqhqd2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 17:48:26 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 188HmPU828443118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 17:48:25 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A578C6E064; Wed, 8 Sep 2021 17:48:25 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3B1296E050; Wed, 8 Sep 2021 17:48:25 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 8 Sep 2021 17:48:25 +0000 (GMT) From: David Christensen To: dev@dpdk.org, thomas@monjalon.net Cc: Ruifeng.Wang@arm.com, David Christensen , phil.yang@arm.com, Ruifeng Wang Date: Wed, 8 Sep 2021 10:48:20 -0700 Message-Id: <20210908174820.3485359-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210902174104.3181444-1-drc@linux.vnet.ibm.com> References: <20210902174104.3181444-1-drc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: eVDsdQElVYOdQIIfY-4gHDru3laBLvDT X-Proofpoint-ORIG-GUID: eVDsdQElVYOdQIIfY-4gHDru3laBLvDT X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-09-08_06:2021-09-07, 2021-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 priorityscore=1501 adultscore=0 spamscore=0 lowpriorityscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080110 Subject: [dpdk-dev] [PATCH v2] test/atomic: fix false failures for 128-bit atomic compare exchange test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Tested-by: Ruifeng Wang Reviewed-by: Ruifeng Wang --- 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