From patchwork Thu Mar 21 19:17:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 138724 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9D3343D14; Thu, 21 Mar 2024 20:21:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54D0042FB9; Thu, 21 Mar 2024 20:18:31 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B27BD42E9C for ; Thu, 21 Mar 2024 20:17:43 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 7060420B57B4; Thu, 21 Mar 2024 12:17:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7060420B57B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711048656; bh=UZM3TXsQBKgPZtZIGI09IvMnhRg2yK1SzgLAPXJh2Fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IPFciaQEfRVHltpYhbav7O8i4l79osET7i583Tz0k4OBhVhVxYpWD0Nq14vbfgBkb zFox0g8R5C+sfA/xRAg9myrbr5hUC2OxivQU+yAeZqbqmbHYo2xChAwgUks/kEHZjm otJrrr+7FTFagEusIuqjyqzJMHCHFZ9zHE75EXnU= From: Tyler Retzlaff To: dev@dpdk.org Cc: =?utf-8?q?Mattias_R=C3=B6nnblom?= , =?utf-8?q?Morten_Br=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 38/45] bus/vmbus: use rte stdatomic API Date: Thu, 21 Mar 2024 12:17:25 -0700 Message-Id: <1711048652-7512-39-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/bus/vmbus/vmbus_channel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/bus/vmbus/vmbus_channel.c b/drivers/bus/vmbus/vmbus_channel.c index 4d74df3..e96a4eb 100644 --- a/drivers/bus/vmbus/vmbus_channel.c +++ b/drivers/bus/vmbus/vmbus_channel.c @@ -19,22 +19,23 @@ #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, monitor_mask; unsigned int trigger_index; trigger_index = monitor_id / HV_MON_TRIG_LEN; monitor_mask = 1u << (monitor_id % HV_MON_TRIG_LEN); - monitor_addr = &channel->monitor_page->trigs[trigger_index].pending; + monitor_addr = + (uint32_t __rte_atomic *)&channel->monitor_page->trigs[trigger_index].pending; vmbus_sync_set_bit(monitor_addr, monitor_mask); }