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 297B141E6D; Fri, 10 Mar 2023 23:15:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0DEBA410D0; Fri, 10 Mar 2023 23:15:39 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4874640A8B for ; Fri, 10 Mar 2023 23:15:36 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 880E52044724; Fri, 10 Mar 2023 14:15:35 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 880E52044724 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1678486535; bh=/5fy6oguua1WWLt4XN1PV1IHB4hKoXJ1bnogRG4odm8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qfrjaPpXsBj7XmZXBTaeM0hD2jIP6jObUtV4dv+WDZb3JiCVaXSaMLafIy3p7/ZM/ 5agU6ewqB8ZswZqHe/DslYnCoBJ9jcpDi3srEHOeLlyBHrqeQTE1wGdgbQnxFDhRm1 dp4Eg/yK1UNcYH7gI3EhPzYIDKsMPuP5Fgjx3lFo= From: Tyler Retzlaff To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH 01/16] app/test: use previous value atomic fetch operations Date: Fri, 10 Mar 2023 14:15:15 -0800 Message-Id: <1678486530-20688-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1678486530-20688-1-git-send-email-roretzla@linux.microsoft.com> References: <1678486530-20688-1-git-send-email-roretzla@linux.microsoft.com> 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 Use __atomic_fetch_{add,and,or,sub,xor} instead of __atomic_{add,and,or,sub,xor}_fetch adding the necessary code to allow consumption of the resulting value. Signed-off-by: Tyler Retzlaff --- app/test/test_ring_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index 2d8bb67..3972fd9 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -186,7 +186,7 @@ struct thread_params { void *burst = NULL; #ifdef RTE_USE_C11_MEM_MODEL - if (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) != 2) + if (__atomic_fetch_add(&lcore_count, 1, __ATOMIC_RELAXED) + 1 != 2) #else if (__sync_add_and_fetch(&lcore_count, 1) != 2) #endif -- 1.8.3.1