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 AC22C43D14; Thu, 21 Mar 2024 20:20:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13D8A42F53; Thu, 21 Mar 2024 20:18:17 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id C66C042E62 for ; Thu, 21 Mar 2024 20:17:40 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 99CEA20B74DB; Thu, 21 Mar 2024 12:17:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 99CEA20B74DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711048655; bh=FrQ9y69fdBxVW+GjSTabcTRyuo/jXL//rvw6fIBSzIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BHBQf4H9YIcThw6KaDa2M8fmFHWGY/oWdi3kcM/KZPDxaowWRtLuUXGzP+LBoM3VL CH2gKJs00oxnV6MPUAdFboIHxNkNw0LHTZTXTdJFjS5XRkNmup1ALk5rDwv3mg4uPQ mHkIqY/c40nM+i3SWUzhX2174JQ0B//6s7r3SLOM= 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 26/45] dma/skeleton: use rte stdatomic API Date: Thu, 21 Mar 2024 12:17:13 -0700 Message-Id: <1711048652-7512-27-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/dma/skeleton/skeleton_dmadev.c | 5 +++-- drivers/dma/skeleton/skeleton_dmadev.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c index 48f88f9..926c188 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.c +++ b/drivers/dma/skeleton/skeleton_dmadev.c @@ -142,7 +142,7 @@ else if (desc->op == SKELDMA_OP_FILL) do_fill(desc); - __atomic_fetch_add(&hw->completed_count, 1, __ATOMIC_RELEASE); + rte_atomic_fetch_add_explicit(&hw->completed_count, 1, rte_memory_order_release); (void)rte_ring_enqueue(hw->desc_completed, (void *)desc); } @@ -335,7 +335,8 @@ RTE_SET_USED(vchan); *status = RTE_DMA_VCHAN_IDLE; - if (hw->submitted_count != __atomic_load_n(&hw->completed_count, __ATOMIC_ACQUIRE) + if (hw->submitted_count != rte_atomic_load_explicit(&hw->completed_count, + rte_memory_order_acquire) || hw->zero_req_count == 0) *status = RTE_DMA_VCHAN_ACTIVE; return 0; diff --git a/drivers/dma/skeleton/skeleton_dmadev.h b/drivers/dma/skeleton/skeleton_dmadev.h index c9bf315..3730cbc 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.h +++ b/drivers/dma/skeleton/skeleton_dmadev.h @@ -81,7 +81,7 @@ struct skeldma_hw { /* Cache delimiter for cpuwork thread's operation data */ char cache2 __rte_cache_aligned; volatile uint32_t zero_req_count; - uint64_t completed_count; + RTE_ATOMIC(uint64_t) completed_count; }; #endif /* SKELETON_DMADEV_H */ -- 1.8.3.1