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 86A6443D09; Wed, 20 Mar 2024 21:55:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4380A42EB7; Wed, 20 Mar 2024 21:52:20 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 1634842DDE for ; Wed, 20 Mar 2024 21:51:44 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 8A3A520B74E2; Wed, 20 Mar 2024 13:51:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8A3A520B74E2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1710967895; bh=VLhUOuGjbMBh1FYiYAcwRk9EykyH2eArQnxINRUoUBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ow0UZsdm/lOX88/YFGZahBY6MbAINbI0tmaqQnm9Ku60NWOWDt2gpBqETppCWo5js lrn+He8gC5KPObioPx5E1QJnkZyKFcMzxc/Qoylutjs8cMaEvL7s3BiUpLgC7zgZCM kIH+gosIh9ccvJMewOt2w6c+0klZ7HC8zkcfv2II= 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 34/46] net/null: use rte stdatomic API Date: Wed, 20 Mar 2024 13:51:20 -0700 Message-Id: <1710967892-7046-35-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710967892-7046-1-git-send-email-roretzla@linux.microsoft.com> References: <1710967892-7046-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/net/null/rte_eth_null.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 7c46004..f4ed3b8 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -37,8 +37,8 @@ struct null_queue { struct rte_mempool *mb_pool; struct rte_mbuf *dummy_packet; - uint64_t rx_pkts; - uint64_t tx_pkts; + RTE_ATOMIC(uint64_t) rx_pkts; + RTE_ATOMIC(uint64_t) tx_pkts; }; struct pmd_options { @@ -102,7 +102,7 @@ struct pmd_internals { } /* NOTE: review for potential ordering optimization */ - __atomic_fetch_add(&h->rx_pkts, i, __ATOMIC_SEQ_CST); + rte_atomic_fetch_add_explicit(&h->rx_pkts, i, rte_memory_order_seq_cst); return i; } @@ -130,7 +130,7 @@ struct pmd_internals { } /* NOTE: review for potential ordering optimization */ - __atomic_fetch_add(&h->rx_pkts, i, __ATOMIC_SEQ_CST); + rte_atomic_fetch_add_explicit(&h->rx_pkts, i, rte_memory_order_seq_cst); return i; } @@ -155,7 +155,7 @@ struct pmd_internals { rte_pktmbuf_free(bufs[i]); /* NOTE: review for potential ordering optimization */ - __atomic_fetch_add(&h->tx_pkts, i, __ATOMIC_SEQ_CST); + rte_atomic_fetch_add_explicit(&h->tx_pkts, i, rte_memory_order_seq_cst); return i; } @@ -178,7 +178,7 @@ struct pmd_internals { } /* NOTE: review for potential ordering optimization */ - __atomic_fetch_add(&h->tx_pkts, i, __ATOMIC_SEQ_CST); + rte_atomic_fetch_add_explicit(&h->tx_pkts, i, rte_memory_order_seq_cst); return i; } -- 1.8.3.1