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 3383441DB5; Thu, 2 Mar 2023 17:20:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0183E42D52; Thu, 2 Mar 2023 17:18:46 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 2FE8442B7E for ; Thu, 2 Mar 2023 17:18:32 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id A486820BC5F5; Thu, 2 Mar 2023 08:18:30 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A486820BC5F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1677773910; bh=JoEsjLRgoJN3vPQE9I9lZKcqGJ69b3ihxcZDUvKWsN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iUYfA+LtAHmOwIFCmoz88oCQrk6HDduAHweAUPfXGNTWVjXLxpBlRbjiUJze86vG6 LQLvNYnj/uk7yJp1A7t/mznL/3ndh1Jo9Nh6WCzLCmUhLLbquAV96VqjoDi0cs/kXP w+fia8T3du2xxuJsFx9gtfS+npUS0Wio6bpAGS78= From: Tyler Retzlaff To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, thomas@monjalon.net, bruce.richardson@intel.com, mb@smartsharesystems.com, Ruifeng.Wang@arm.com, maxime.coquelin@redhat.com, Tyler Retzlaff Subject: [PATCH v2 14/17] dma/skeleton: use previous value atomic fetch operations Date: Thu, 2 Mar 2023 08:18:19 -0800 Message-Id: <1677773902-5167-15-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1677773902-5167-1-git-send-email-roretzla@linux.microsoft.com> References: <1677718068-2412-1-git-send-email-roretzla@linux.microsoft.com> <1677773902-5167-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 when we have no interest in the result of the operation. Reduces unnecessary codegen that provided the result of the atomic operation that was not used. Change brings closer alignment with atomics available in C11 standard and will reduce review effort when they are integrated. Signed-off-by: Tyler Retzlaff Acked-by: Morten Brørup --- drivers/dma/skeleton/skeleton_dmadev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c index 9b6da65..43e7052 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.c +++ b/drivers/dma/skeleton/skeleton_dmadev.c @@ -77,7 +77,7 @@ hw->zero_req_count = 0; rte_memcpy(desc->dst, desc->src, desc->len); - __atomic_add_fetch(&hw->completed_count, 1, __ATOMIC_RELEASE); + __atomic_fetch_add(&hw->completed_count, 1, __ATOMIC_RELEASE); (void)rte_ring_enqueue(hw->desc_completed, (void *)desc); } -- 1.8.3.1