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 0ABE443D14; Thu, 21 Mar 2024 20:20:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8924642F4B; Thu, 21 Mar 2024 20:18:12 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 0B1FD42E72 for ; Thu, 21 Mar 2024 20:17:40 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 542B120B74D6; Thu, 21 Mar 2024 12:17:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 542B120B74D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711048655; bh=TllvZE5t2T/rvMUvKT0SnzdqMGIXmgRT5ZjejW9Hq/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sGpCaK56NMZvkTcfnANLW412QUKG6sDYI1klCed8LyLRnMqZUXx9VWcfnmKl3DO6G 7DXX/gXBLOWWxfF1hkHs+qIUMUb25m6SJcxS+1TNVFO95VjBLyC7phChH+FrJKL8BW PNQi7cZgjKsSIIAgo7QJG1wIQycKpaMgRcnVNFl4= 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 , Yuying Zhang , Yuying Zhang , Ziyang Xuan , Tyler Retzlaff Subject: [PATCH v2 22/45] raw/ifpga: use rte stdatomic API Date: Thu, 21 Mar 2024 12:17:09 -0700 Message-Id: <1711048652-7512-23-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1711048652-7512-1-git-send-email-roretzla@linux.microsoft.com> References: <1710967892-7046-1-git-send-email-roretzla@linux.microsoft.com> <1711048652-7512-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 --- drivers/raw/ifpga/ifpga_rawdev.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index f89bd3f..78d3c88 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -73,7 +73,7 @@ static struct ifpga_rawdev ifpga_rawdevices[IFPGA_RAWDEV_NUM]; -static int ifpga_monitor_refcnt; +static RTE_ATOMIC(int) ifpga_monitor_refcnt; static rte_thread_t ifpga_monitor_start_thread; static struct ifpga_rawdev * @@ -512,7 +512,7 @@ static int set_surprise_link_check_aer( int gsd_enable, ret; #define MS 1000 - while (__atomic_load_n(&ifpga_monitor_refcnt, __ATOMIC_RELAXED)) { + while (rte_atomic_load_explicit(&ifpga_monitor_refcnt, rte_memory_order_relaxed)) { gsd_enable = 0; for (i = 0; i < IFPGA_RAWDEV_NUM; i++) { ifpga_rdev = &ifpga_rawdevices[i]; @@ -549,7 +549,7 @@ static int set_surprise_link_check_aer( dev->poll_enabled = 1; - if (!__atomic_fetch_add(&ifpga_monitor_refcnt, 1, __ATOMIC_RELAXED)) { + if (!rte_atomic_fetch_add_explicit(&ifpga_monitor_refcnt, 1, rte_memory_order_relaxed)) { ret = rte_thread_create_internal_control(&ifpga_monitor_start_thread, "ifpga-mon", ifpga_rawdev_gsd_handle, NULL); if (ret != 0) { @@ -573,7 +573,8 @@ static int set_surprise_link_check_aer( dev->poll_enabled = 0; - if (!(__atomic_fetch_sub(&ifpga_monitor_refcnt, 1, __ATOMIC_RELAXED) - 1) && + if (!(rte_atomic_fetch_sub_explicit(&ifpga_monitor_refcnt, 1, + rte_memory_order_relaxed) - 1) && ifpga_monitor_start_thread.opaque_id != 0) { ret = pthread_cancel((pthread_t)ifpga_monitor_start_thread.opaque_id); if (ret) -- 1.8.3.1