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 A667343FA4; Mon, 6 May 2024 19:59:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0518340A84; Mon, 6 May 2024 19:58:46 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 88F9E40608 for ; Mon, 6 May 2024 19:58:30 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 222A620B2C94; Mon, 6 May 2024 10:58:27 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 222A620B2C94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715018308; bh=+Ux2dhi8enOZlNdaBvjnx7M7x4cG69DRKNpKEnPinMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SjfKAapO4QFsl0sADaohOM/YX53uw0YqLCrLMoJzP8vi/k3y4WRJ+htIP0qxhcPiC avSx3tf4YkgO8E3YLn6mMfyD3GUuZ9AtJQrITaSCFhIdjv9cz9uiq2gQxSlZeKmpIE n2W/vHcQCoaQQZgSCkRZDebO8G92BNOX+J/MO774= From: Tyler Retzlaff To: dev@dpdk.org Cc: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Abdullah Sevincer , Ajit Khaparde , Alok Prasad , Anatoly Burakov , Andrew Rybchenko , Anoob Joseph , Bruce Richardson , Byron Marohn , Chenbo Xia , Chengwen Feng , Ciara Loftus , Ciara Power , Dariusz Sosnowski , David Hunt , Devendra Singh Rawat , Erik Gabriel Carrillo , Guoyang Zhou , Harman Kalra , Harry van Haaren , Honnappa Nagarahalli , Jakub Grajciar , Jerin Jacob , Jeroen de Borst , Jian Wang , Jiawen Wu , Jie Hai , Jingjing Wu , Joshua Washington , Joyce Kong , Junfeng Guo , Kevin Laatz , Konstantin Ananyev , Liang Ma , Long Li , Maciej Czekaj , Matan Azrad , Maxime Coquelin , Nicolas Chautru , Ori Kam , Pavan Nikhilesh , Peter Mccarthy , Rahul Lakkireddy , Reshma Pattan , Rosen Xu , Ruifeng Wang , Rushil Gupta , Sameh Gobriel , Sivaprasad Tummala , Somnath Kotur , Stephen Hemminger , Suanming Mou , Sunil Kumar Kori , Sunil Uttarwar , Tetsuya Mukawa , Vamsi Attunuru , Viacheslav Ovsiienko , Vladimir Medvedkin , Xiaoyun Wang , Yipeng Wang , Yisen Zhuang , Ziyang Xuan , Tyler Retzlaff Subject: [PATCH v5 11/45] net/octeontx: use rte stdatomic API Date: Mon, 6 May 2024 10:57:52 -0700 Message-Id: <1715018306-13741-12-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1715018306-13741-1-git-send-email-roretzla@linux.microsoft.com> References: <1710967892-7046-1-git-send-email-roretzla@linux.microsoft.com> <1715018306-13741-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 Replace the use of gcc builtin __atomic_xxx intrinsics with corresponding rte_atomic_xxx optional rte stdatomic API. Signed-off-by: Tyler Retzlaff Acked-by: Stephen Hemminger --- drivers/net/octeontx/octeontx_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index e397136..3c21540 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -31,7 +31,7 @@ /* Useful in stopping/closing event device if no of * eth ports are using it. */ -uint16_t evdev_refcnt; +RTE_ATOMIC(uint16_t) evdev_refcnt; #define OCTEONTX_QLM_MODE_SGMII 7 #define OCTEONTX_QLM_MODE_XFI 12 @@ -559,7 +559,7 @@ enum octeontx_link_speed { return 0; /* Stopping/closing event device once all eth ports are closed. */ - if (__atomic_fetch_sub(&evdev_refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0) { + if (rte_atomic_fetch_sub_explicit(&evdev_refcnt, 1, rte_memory_order_acquire) - 1 == 0) { rte_event_dev_stop(nic->evdev); rte_event_dev_close(nic->evdev); } @@ -1593,7 +1593,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_fetch_add(&evdev_refcnt, 1, __ATOMIC_ACQUIRE); + rte_atomic_fetch_add_explicit(&evdev_refcnt, 1, rte_memory_order_acquire); res = octeontx_port_open(nic); if (res < 0) @@ -1844,7 +1844,7 @@ static void build_xstat_names(struct rte_eth_xstat_name *xstat_names) } } - __atomic_store_n(&evdev_refcnt, 0, __ATOMIC_RELEASE); + rte_atomic_store_explicit(&evdev_refcnt, 0, rte_memory_order_release); /* * Do 1:1 links for ports & queues. All queues would be mapped to * one port. If there are more ports than queues, then some ports -- 1.8.3.1