From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 243CDC678D4 for ; Thu, 2 Mar 2023 00:48:48 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 173D742BB1; Thu, 2 Mar 2023 01:48:12 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 681814021F for ; Thu, 2 Mar 2023 01:48:03 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 3498F20B9C3F; Wed, 1 Mar 2023 16:48:02 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3498F20B9C3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1677718082; bh=NgrRmXAtFFPS0Qg/CZqo11R32oxUWCsQq1n7CNdAj8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XlX+rGJLBKUA5u6b7RPQWNsIKXIqVqzfO6Vbz/5bfE3VMLwyFP4MZo816sv7P0M6U SqFpuOujoPC82LuOumWn4ZucUlMMNwpyUxxrUBP7bAfi3dLW/4SW3mCAarUGCZ/xtj UYGUrkh5WeOzPQfcAfzqHgHSg7ZajhNIRyaSrms8= From: Tyler Retzlaff To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH 06/17] bbdev: use previous value atomic fetch operations Date: Wed, 1 Mar 2023 16:47:37 -0800 Message-Id: <1677718068-2412-7-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1677718068-2412-1-git-send-email-roretzla@linux.microsoft.com> References: <1677718068-2412-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 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 --- lib/bbdev/rte_bbdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index 1521cdb..69e099d 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -208,7 +208,7 @@ struct rte_bbdev * return NULL; } - __atomic_add_fetch(&bbdev->data->process_cnt, 1, __ATOMIC_RELAXED); + __atomic_fetch_add(&bbdev->data->process_cnt, 1, __ATOMIC_RELAXED); bbdev->data->dev_id = dev_id; bbdev->state = RTE_BBDEV_INITIALIZED; -- 1.8.3.1