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 7BA0443D99; Mon, 6 May 2024 20:03:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E3E942B71; Mon, 6 May 2024 19:59:26 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id AED084064A for ; Mon, 6 May 2024 19:58:37 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 073C020B2CBC; Mon, 6 May 2024 10:58:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 073C020B2CBC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715018310; bh=rl0ezMLCtew6Ru3ptc0ov012Zw22oAEOpnYAMZFm6gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CEsUgLS88unEjZYdEUTpzT+OBAecMt4pC2BSTwJnHEq1GIWMx43hYtd3mNlJHLqeI yrk+Lb8L8/2JDXCfzVdwq/iiTOqVIRrxGiN3K0WGCNaUN976zEy6WvCTt38ejjGnaH 5hA4JAcf++nW0FQF0THQX6UOsL2DFg67rS/TRsuI= 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 38/45] bus/vmbus: use rte stdatomic API Date: Mon, 6 May 2024 10:58:19 -0700 Message-Id: <1715018306-13741-39-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/bus/vmbus/rte_vmbus_reg.h | 2 +- drivers/bus/vmbus/vmbus_channel.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/bus/vmbus/rte_vmbus_reg.h b/drivers/bus/vmbus/rte_vmbus_reg.h index a17ce40..e3299aa 100644 --- a/drivers/bus/vmbus/rte_vmbus_reg.h +++ b/drivers/bus/vmbus/rte_vmbus_reg.h @@ -28,7 +28,7 @@ struct vmbus_message { */ struct vmbus_mon_trig { - uint32_t pending; + RTE_ATOMIC(uint32_t) pending; uint32_t armed; } __rte_packed; diff --git a/drivers/bus/vmbus/vmbus_channel.c b/drivers/bus/vmbus/vmbus_channel.c index 4d74df3..925c2aa 100644 --- a/drivers/bus/vmbus/vmbus_channel.c +++ b/drivers/bus/vmbus/vmbus_channel.c @@ -19,16 +19,16 @@ #include "private.h" static inline void -vmbus_sync_set_bit(volatile uint32_t *addr, uint32_t mask) +vmbus_sync_set_bit(volatile RTE_ATOMIC(uint32_t) *addr, uint32_t mask) { - /* Use GCC builtin which atomic does atomic OR operation */ - __atomic_fetch_or(addr, mask, __ATOMIC_SEQ_CST); + rte_atomic_fetch_or_explicit(addr, mask, rte_memory_order_seq_cst); } static inline void vmbus_set_monitor(const struct vmbus_channel *channel, uint32_t monitor_id) { - uint32_t *monitor_addr, monitor_mask; + RTE_ATOMIC(uint32_t) *monitor_addr; + uint32_t monitor_mask; unsigned int trigger_index; trigger_index = monitor_id / HV_MON_TRIG_LEN; -- 1.8.3.1