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 974C043D99; Mon, 6 May 2024 20:03:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A288842D0C; Mon, 6 May 2024 19:59:28 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 3660A402F1 for ; Mon, 6 May 2024 19:58:38 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 2908520B2CBF; Mon, 6 May 2024 10:58:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2908520B2CBF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1715018310; bh=FfjiEeN8sOwlG79hwOsf5c/U1F+OfIYxvFSw8Mw2BbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=no1qLvIEXygxnmGW1kDDa1azf5m+y393tG4LsHJK/gob+o5k3+H7dmEDTr2YLzWcc 7xU+EaqX+DnnhJN6MduTV7m6MtD5yeS8dB7nN5DeFgaI4za+WHybPHtuK51VC0Gw9t e75q+lRZQIvvzOFSvUSL6zWP9SARSAAwkXfOGT+E= 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 40/45] app/dumpcap: use rte stdatomic API Date: Mon, 6 May 2024 10:58:21 -0700 Message-Id: <1715018306-13741-41-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 --- app/dumpcap/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index cc0f66b..b25b95e 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -51,7 +51,7 @@ /* command line flags */ static const char *progname; -static bool quit_signal; +static RTE_ATOMIC(bool) quit_signal; static bool group_read; static bool quiet; static bool use_pcapng = true; @@ -475,7 +475,7 @@ static void parse_opts(int argc, char **argv) static void signal_handler(int sig_num __rte_unused) { - __atomic_store_n(&quit_signal, true, __ATOMIC_RELAXED); + rte_atomic_store_explicit(&quit_signal, true, rte_memory_order_relaxed); } @@ -490,7 +490,7 @@ static void statistics_loop(void) printf("%-15s %10s %10s\n", "Interface", "Received", "Dropped"); - while (!__atomic_load_n(&quit_signal, __ATOMIC_RELAXED)) { + while (!rte_atomic_load_explicit(&quit_signal, rte_memory_order_relaxed)) { RTE_ETH_FOREACH_DEV(p) { if (rte_eth_dev_get_name_by_port(p, name) < 0) continue; @@ -528,7 +528,7 @@ static void statistics_loop(void) static void monitor_primary(void *arg __rte_unused) { - if (__atomic_load_n(&quit_signal, __ATOMIC_RELAXED)) + if (rte_atomic_load_explicit(&quit_signal, rte_memory_order_relaxed)) return; if (rte_eal_primary_proc_alive(NULL)) { @@ -536,7 +536,7 @@ static void statistics_loop(void) } else { fprintf(stderr, "Primary process is no longer active, exiting...\n"); - __atomic_store_n(&quit_signal, true, __ATOMIC_RELAXED); + rte_atomic_store_explicit(&quit_signal, true, rte_memory_order_relaxed); } } @@ -983,7 +983,7 @@ int main(int argc, char **argv) show_count(0); } - while (!__atomic_load_n(&quit_signal, __ATOMIC_RELAXED)) { + while (!rte_atomic_load_explicit(&quit_signal, rte_memory_order_relaxed)) { if (process_ring(out, r) < 0) { fprintf(stderr, "pcapng file write failed; %s\n", strerror(errno)); -- 1.8.3.1