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 209FB41DAF; Thu, 2 Mar 2023 01:48:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21DF740EE3; Thu, 2 Mar 2023 01:48:13 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 8615341151 for ; Thu, 2 Mar 2023 01:48:03 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 585FA209FE18; Wed, 1 Mar 2023 16:48:02 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 585FA209FE18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1677718082; bh=b/ZWTqZOimNSo2xBbdBtViiX6lqxoqG/3rYUog3nlzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U1t0075BlUNkZmC0TzJ10Q7ndptwqLN8nuXlvob5Scyz28leaOrn4H42GUTxZbKv3 Wfs0Sn6OCh/KCQ6n2xaP6anBE00tLre+MUcq0+4vEIZ/+GS9V2UtBo1oZBL+2EnIL8 g7bn9bKeH3IAAZ0QaQDdj94jm9LVQs1PEVHepowA= From: Tyler Retzlaff To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH 09/17] net/octeontx: use previous value atomic fetch operations Date: Wed, 1 Mar 2023 16:47:40 -0800 Message-Id: <1677718068-2412-10-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 --- drivers/net/octeontx/octeontx_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index d52a3e7..e00298e 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -1581,7 +1581,7 @@ static void build_xstat_names(struct rte_eth_xstat_name *xstat_names) nic->pko_vfid = pko_vfid; nic->port_id = port; nic->evdev = evdev; - __atomic_add_fetch(&evdev_refcnt, 1, __ATOMIC_ACQUIRE); + __atomic_fetch_add(&evdev_refcnt, 1, __ATOMIC_ACQUIRE); res = octeontx_port_open(nic); if (res < 0) -- 1.8.3.1