From patchwork Wed Sep 8 17:25:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Christensen X-Patchwork-Id: 98384 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CFFCAA0C5C; Wed, 8 Sep 2021 19:25:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFC8040E01; Wed, 8 Sep 2021 19:25:21 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mails.dpdk.org (Postfix) with ESMTP id CD1954003E for ; Wed, 8 Sep 2021 19:25:19 +0200 (CEST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 188H3RWl178669; Wed, 8 Sep 2021 13:25:16 -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=HrwWNTy+ieXkcaTMAI/2TH0o6NhC4xoOikk+dKbR2RqdESXH4rmSKsGMy6X638pXqfhL OMDwXt9eD3pG6W2zTRm9OKCF01YxxEkOnlS9gUaSYQuYhfDoMhLtD5rcKwSEVGs0r46q PzttmBgYREwVhN/lL0l62HzQu5y/yYwCYgiSuNH54a9aMiIUY8F5o5K6PZID25Eu2l0Y GK1gGUsG+OEgnafWnkOxsy8ju5P8IXOpksyh6bXlyWfmMT/mRsVlwKv0+iQxrWPaxdkf eBhonH1/tLNyUGBBVD1lN+DSg52JlqNDj8V9DFHiqDrD/KgWJFfS5KsggbWP52U0LQaC 6g== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 3axxm35wtg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 13:25:16 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 188H86pQ019930; Wed, 8 Sep 2021 17:25:15 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01dal.us.ibm.com with ESMTP id 3axcnqfd2q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Sep 2021 17:25:14 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 188HPCQf51314962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Sep 2021 17:25:12 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8E0DBAE071; Wed, 8 Sep 2021 17:25:12 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 73E91AE062; Wed, 8 Sep 2021 17:25:12 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 8 Sep 2021 17:25:12 +0000 (GMT) From: David Christensen To: dev@dpdk.org Cc: Ruifeng.Wang@arm.com, David Christensen , phil.yang@arm.com, Ruifeng Wang Date: Wed, 8 Sep 2021 10:25:09 -0700 Message-Id: <20210908172509.3484302-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 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 9btTziukS6CmDT_k-8zOCxEtAsNZwW6F X-Proofpoint-ORIG-GUID: 9btTziukS6CmDT_k-8zOCxEtAsNZwW6F 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 mlxscore=0 priorityscore=1501 adultscore=0 malwarescore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=952 clxscore=1011 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109080107 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(-) -- 2.27.0 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; }