From patchwork Tue Jul 20 03:51:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96073 X-Patchwork-Delegate: david.marchand@redhat.com 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 8ADC7A0C43; Tue, 20 Jul 2021 05:52:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9248A410DB; Tue, 20 Jul 2021 05:52:04 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id E658A40E6E for ; Tue, 20 Jul 2021 05:52:02 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 627021FB; Mon, 19 Jul 2021 20:52:02 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0AC693F694; Mon, 19 Jul 2021 20:51:58 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:18 -0500 Message-Id: <20210720035125.14214-2-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 1/8] test/ticketlock: use compiler atomics for lcores sync 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 Sender: "dev" Convert rte_atomic usages to compiler atomic built-ins for lcores sync in ticketlock testcases. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Reviewed-by: Honnappa Nagarahalli Acked-by: Stephen Hemminger --- app/test/test_ticketlock.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/test/test_ticketlock.c b/app/test/test_ticketlock.c index 7aab8665bc..242c136478 100644 --- a/app/test/test_ticketlock.c +++ b/app/test/test_ticketlock.c @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -49,7 +48,7 @@ static rte_ticketlock_t tl_tab[RTE_MAX_LCORE]; static rte_ticketlock_recursive_t tlr; static unsigned int count; -static rte_atomic32_t synchro; +static uint32_t synchro; static int test_ticketlock_per_core(__rte_unused void *arg) @@ -112,8 +111,7 @@ load_loop_fn(void *func_param) /* wait synchro for workers */ if (lcore != rte_get_main_lcore()) - while (rte_atomic32_read(&synchro) == 0) - ; + rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED); begin = rte_rdtsc_precise(); while (lcore_count[lcore] < MAX_LOOP) { @@ -155,11 +153,11 @@ test_ticketlock_perf(void) printf("\nTest with lock on %u cores...\n", rte_lcore_count()); /* Clear synchro and start workers */ - rte_atomic32_set(&synchro, 0); + __atomic_store_n(&synchro, 0, __ATOMIC_RELAXED); rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN); /* start synchro and launch test on main */ - rte_atomic32_set(&synchro, 1); + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); load_loop_fn(&lock); rte_eal_mp_wait_lcore(); From patchwork Tue Jul 20 03:51:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96074 X-Patchwork-Delegate: david.marchand@redhat.com 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 B5DE6A0C43; Tue, 20 Jul 2021 05:52:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE705410FC; Tue, 20 Jul 2021 05:52:07 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id DED77410F8 for ; Tue, 20 Jul 2021 05:52:06 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3EFE31FB; Mon, 19 Jul 2021 20:52:06 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DB9023F694; Mon, 19 Jul 2021 20:52:02 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:19 -0500 Message-Id: <20210720035125.14214-3-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 2/8] test/spinlock: use compile atomics for lcores sync 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 Sender: "dev" Convert rte_atomic usages to compiler atomic built-ins for lcores sync in spinlock testcases. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Acked-by: Stephen Hemminger --- app/test/test_spinlock.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c index 054fb43a9f..3f59372300 100644 --- a/app/test/test_spinlock.c +++ b/app/test/test_spinlock.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "test.h" @@ -49,7 +48,7 @@ static rte_spinlock_t sl_tab[RTE_MAX_LCORE]; static rte_spinlock_recursive_t slr; static unsigned count = 0; -static rte_atomic32_t synchro; +static uint32_t synchro; static int test_spinlock_per_core(__rte_unused void *arg) @@ -111,7 +110,7 @@ load_loop_fn(void *func_param) /* wait synchro for workers */ if (lcore != rte_get_main_lcore()) - while (rte_atomic32_read(&synchro) == 0); + rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED); begin = rte_get_timer_cycles(); while (lcount < MAX_LOOP) { @@ -150,11 +149,11 @@ test_spinlock_perf(void) printf("\nTest with lock on %u cores...\n", rte_lcore_count()); /* Clear synchro and start workers */ - rte_atomic32_set(&synchro, 0); + __atomic_store_n(&synchro, 0, __ATOMIC_RELAXED); rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN); /* start synchro and launch test on main */ - rte_atomic32_set(&synchro, 1); + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); load_loop_fn(&lock); rte_eal_mp_wait_lcore(); From patchwork Tue Jul 20 03:51:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96075 X-Patchwork-Delegate: david.marchand@redhat.com 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 BB49EA0C43; Tue, 20 Jul 2021 05:52:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D1266410E7; Tue, 20 Jul 2021 05:52:11 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 866C141124 for ; Tue, 20 Jul 2021 05:52:10 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1BA8A1FB; Mon, 19 Jul 2021 20:52:10 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B83193F694; Mon, 19 Jul 2021 20:52:06 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:20 -0500 Message-Id: <20210720035125.14214-4-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 3/8] test/rwlock: use compiler atomics for lcores sync 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 Sender: "dev" Convert rte_atomic usages to compiler atomic built-ins for lcores sync in rwlock testcases. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Acked-by: Stephen Hemminger --- app/test/test_rwlock.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/test/test_rwlock.c b/app/test/test_rwlock.c index b47150a86a..f2d1c8883c 100644 --- a/app/test/test_rwlock.c +++ b/app/test/test_rwlock.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -36,7 +35,7 @@ static rte_rwlock_t sl; static rte_rwlock_t sl_tab[RTE_MAX_LCORE]; -static rte_atomic32_t synchro; +static uint32_t synchro; enum { LC_TYPE_RDLOCK, @@ -102,8 +101,7 @@ load_loop_fn(__rte_unused void *arg) /* wait synchro for workers */ if (lcore != rte_get_main_lcore()) - while (rte_atomic32_read(&synchro) == 0) - ; + rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED); begin = rte_rdtsc_precise(); while (lcount < MAX_LOOP) { @@ -136,12 +134,12 @@ test_rwlock_perf(void) printf("\nRwlock Perf Test on %u cores...\n", rte_lcore_count()); /* clear synchro and start workers */ - rte_atomic32_set(&synchro, 0); + __atomic_store_n(&synchro, 0, __ATOMIC_RELAXED); if (rte_eal_mp_remote_launch(load_loop_fn, NULL, SKIP_MAIN) < 0) return -1; /* start synchro and launch test on main */ - rte_atomic32_set(&synchro, 1); + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); load_loop_fn(NULL); rte_eal_mp_wait_lcore(); From patchwork Tue Jul 20 03:51:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96076 X-Patchwork-Delegate: david.marchand@redhat.com 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 1C1ECA0C43; Tue, 20 Jul 2021 05:52:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 101D140F35; Tue, 20 Jul 2021 05:52:16 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 7294440E0F for ; Tue, 20 Jul 2021 05:52:14 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ECCB31FB; Mon, 19 Jul 2021 20:52:13 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 94CCC3F694; Mon, 19 Jul 2021 20:52:10 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:21 -0500 Message-Id: <20210720035125.14214-5-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 4/8] test/mcslock: use compiler atomics for lcores sync 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 Sender: "dev" Convert rte_atomic usages to compiler atomic built-ins for lcores sync in mcslock testcases. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Acked-by: Stephen Hemminger --- app/test/test_mcslock.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c index 80eaecc90a..52e45e7e2a 100644 --- a/app/test/test_mcslock.c +++ b/app/test/test_mcslock.c @@ -17,7 +17,6 @@ #include #include #include -#include #include "test.h" @@ -43,7 +42,7 @@ rte_mcslock_t *p_ml_perf; static unsigned int count; -static rte_atomic32_t synchro; +static uint32_t synchro; static int test_mcslock_per_core(__rte_unused void *arg) @@ -76,8 +75,7 @@ load_loop_fn(void *func_param) rte_mcslock_t ml_perf_me; /* wait synchro */ - while (rte_atomic32_read(&synchro) == 0) - ; + rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED); begin = rte_get_timer_cycles(); while (lcount < MAX_LOOP) { @@ -102,15 +100,15 @@ test_mcslock_perf(void) const unsigned int lcore = rte_lcore_id(); printf("\nTest with no lock on single core...\n"); - rte_atomic32_set(&synchro, 1); + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); load_loop_fn(&lock); printf("Core [%u] Cost Time = %"PRIu64" us\n", lcore, time_count[lcore]); memset(time_count, 0, sizeof(time_count)); printf("\nTest with lock on single core...\n"); + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); lock = 1; - rte_atomic32_set(&synchro, 1); load_loop_fn(&lock); printf("Core [%u] Cost Time = %"PRIu64" us\n", lcore, time_count[lcore]); @@ -118,11 +116,11 @@ test_mcslock_perf(void) printf("\nTest with lock on %u cores...\n", (rte_lcore_count())); - rte_atomic32_set(&synchro, 0); + __atomic_store_n(&synchro, 0, __ATOMIC_RELAXED); rte_eal_mp_remote_launch(load_loop_fn, &lock, SKIP_MAIN); /* start synchro and launch test on main */ - rte_atomic32_set(&synchro, 1); + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); load_loop_fn(&lock); rte_eal_mp_wait_lcore(); From patchwork Tue Jul 20 03:51:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96077 X-Patchwork-Delegate: david.marchand@redhat.com 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 4AE0EA0C43; Tue, 20 Jul 2021 05:52:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3553341163; Tue, 20 Jul 2021 05:52:20 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 5F3CA410F6 for ; Tue, 20 Jul 2021 05:52:18 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D193D1FB; Mon, 19 Jul 2021 20:52:17 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 71E9F3F694; Mon, 19 Jul 2021 20:52:14 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:22 -0500 Message-Id: <20210720035125.14214-6-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 5/8] test/mempool: remove unused variable for lcores sync 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 Sender: "dev" Remove the unused synchro variable as there is no lcores sync in mempool function test. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Acked-by: Stephen Hemminger --- app/test/test_mempool.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index 3adadd6731..7675a3e605 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -57,8 +56,6 @@ goto label; \ } while (0) -static rte_atomic32_t synchro; - /* * save the object number in the first 4 bytes of object data. All * other bytes are set to 0. @@ -491,8 +488,6 @@ test_mempool(void) }; const char *default_pool_ops = rte_mbuf_best_mempool_ops(); - rte_atomic32_init(&synchro); - /* create a mempool (without cache) */ mp_nocache = rte_mempool_create("test_nocache", MEMPOOL_SIZE, MEMPOOL_ELT_SIZE, 0, 0, From patchwork Tue Jul 20 03:51:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96078 X-Patchwork-Delegate: david.marchand@redhat.com 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 B11E3A0C43; Tue, 20 Jul 2021 05:52:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4882F4117E; Tue, 20 Jul 2021 05:52:24 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 424694117E for ; Tue, 20 Jul 2021 05:52:22 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AE60D1FB; Mon, 19 Jul 2021 20:52:21 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 56A6D3F694; Mon, 19 Jul 2021 20:52:18 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:23 -0500 Message-Id: <20210720035125.14214-7-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 6/8] test/mempool_perf: use compiler atomics for lcores sync 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 Sender: "dev" Convert rte_atomic usages to compiler atomic built-ins for lcores sync in mempool_perf testcases. Meanwhile, remove unnecessary synchro init as it would be set to 0 when launching cores. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Acked-by: Stephen Hemminger --- app/test/test_mempool_perf.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c index d7d0aaa334..8f629736e8 100644 --- a/app/test/test_mempool_perf.c +++ b/app/test/test_mempool_perf.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -83,7 +82,7 @@ static int use_external_cache; static unsigned external_cache_size = RTE_MEMPOOL_CACHE_MAX_SIZE; -static rte_atomic32_t synchro; +static uint32_t synchro; /* number of objects in one bulk operation (get or put) */ static unsigned n_get_bulk; @@ -145,7 +144,7 @@ per_lcore_mempool_test(void *arg) /* wait synchro for workers */ if (lcore_id != rte_get_main_lcore()) - while (rte_atomic32_read(&synchro) == 0); + rte_wait_until_equal_32(&synchro, 1, __ATOMIC_RELAXED); start_cycles = rte_get_timer_cycles(); @@ -198,7 +197,7 @@ launch_cores(struct rte_mempool *mp, unsigned int cores) int ret; unsigned cores_save = cores; - rte_atomic32_set(&synchro, 0); + __atomic_store_n(&synchro, 0, __ATOMIC_RELAXED); /* reset stats */ memset(stats, 0, sizeof(stats)); @@ -223,7 +222,7 @@ launch_cores(struct rte_mempool *mp, unsigned int cores) } /* start synchro and launch test on main */ - rte_atomic32_set(&synchro, 1); + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); ret = per_lcore_mempool_test(mp); @@ -288,8 +287,6 @@ test_mempool_perf(void) const char *default_pool_ops; int ret = -1; - rte_atomic32_init(&synchro); - /* create a mempool (without cache) */ mp_nocache = rte_mempool_create("perf_test_nocache", MEMPOOL_SIZE, MEMPOOL_ELT_SIZE, 0, 0, From patchwork Tue Jul 20 03:51:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96079 X-Patchwork-Delegate: david.marchand@redhat.com 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 6037BA0C43; Tue, 20 Jul 2021 05:52:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56DB341153; Tue, 20 Jul 2021 05:52:28 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 11E7B41190 for ; Tue, 20 Jul 2021 05:52:26 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8AB3E1FB; Mon, 19 Jul 2021 20:52:25 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 334FF3F694; Mon, 19 Jul 2021 20:52:21 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:24 -0500 Message-Id: <20210720035125.14214-8-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 7/8] test/service_cores: use compiler atomics for lock sync 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 Sender: "dev" Convert rte_atomic usages to compiler atomic built-ins for lock sync in service_cores testcases. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Acked-by: Stephen Hemminger --- app/test/test_service_cores.c | 36 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c index 37d7172d53..ece104054e 100644 --- a/app/test/test_service_cores.c +++ b/app/test/test_service_cores.c @@ -53,18 +53,20 @@ static int32_t dummy_cb(void *args) static int32_t dummy_mt_unsafe_cb(void *args) { /* before running test, the initialization has set pass_test to 1. - * If the cmpset in service-cores is working correctly, the code here + * If the CAS in service-cores is working correctly, the code here * should never fail to take the lock. If the lock *is* taken, fail the * test, because two threads are concurrently in a non-MT safe callback. */ uint32_t *test_params = args; - uint32_t *atomic_lock = &test_params[0]; + uint32_t *lock = &test_params[0]; uint32_t *pass_test = &test_params[1]; - int lock_taken = rte_atomic32_cmpset(atomic_lock, 0, 1); + uint32_t exp = 0; + int lock_taken = __atomic_compare_exchange_n(lock, &exp, 1, 0, + __ATOMIC_RELAXED, __ATOMIC_RELAXED); if (lock_taken) { /* delay with the lock held */ rte_delay_ms(250); - rte_atomic32_clear((rte_atomic32_t *)atomic_lock); + __atomic_store_n(lock, 0, __ATOMIC_RELAXED); } else { /* 2nd thread will fail to take lock, so set pass flag */ *pass_test = 0; @@ -83,13 +85,15 @@ static int32_t dummy_mt_safe_cb(void *args) * that 2 threads are running the callback at the same time: MT safe */ uint32_t *test_params = args; - uint32_t *atomic_lock = &test_params[0]; + uint32_t *lock = &test_params[0]; uint32_t *pass_test = &test_params[1]; - int lock_taken = rte_atomic32_cmpset(atomic_lock, 0, 1); + uint32_t exp = 0; + int lock_taken = __atomic_compare_exchange_n(lock, &exp, 1, 0, + __ATOMIC_RELAXED, __ATOMIC_RELAXED); if (lock_taken) { /* delay with the lock held */ rte_delay_ms(250); - rte_atomic32_clear((rte_atomic32_t *)atomic_lock); + __atomic_store_n(lock, 0, __ATOMIC_RELAXED); } else { /* 2nd thread will fail to take lock, so set pass flag */ *pass_test = 1; @@ -622,9 +626,9 @@ service_threaded_test(int mt_safe) TEST_ASSERT_EQUAL(0, rte_service_lcore_add(slcore_2), "mt safe lcore add fail"); - /* Use atomic locks to verify that two threads are in the same function - * at the same time. These are passed to the unit tests through the - * callback userdata parameter + /* Use locks to verify that two threads are in the same function + * at the same time. These are passed to the unit tests through + * the callback userdata parameter. */ uint32_t test_params[2]; memset(test_params, 0, sizeof(uint32_t) * 2); @@ -713,7 +717,7 @@ service_mt_safe_poll(void) } /* tests a NON mt safe service with two cores, the callback is serialized - * using the atomic cmpset. + * using the CAS. */ static int service_mt_unsafe_poll(void) @@ -735,17 +739,17 @@ delay_as_a_mt_safe_service(void *args) RTE_SET_USED(args); uint32_t *params = args; - /* retrieve done flag and atomic lock to inc/dec */ + /* retrieve done flag and lock to add/sub */ uint32_t *done = ¶ms[0]; - rte_atomic32_t *lock = (rte_atomic32_t *)¶ms[1]; + uint32_t *lock = ¶ms[1]; while (!*done) { - rte_atomic32_inc(lock); + __atomic_add_fetch(lock, 1, __ATOMIC_RELAXED); rte_delay_us(500); - if (rte_atomic32_read(lock) > 1) + if (__atomic_load_n(lock, __ATOMIC_RELAXED) > 1) /* pass: second core has simultaneously incremented */ *done = 1; - rte_atomic32_dec(lock); + __atomic_sub_fetch(lock, 1, __ATOMIC_RELAXED); } return 0; From patchwork Tue Jul 20 03:51:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 96080 X-Patchwork-Delegate: david.marchand@redhat.com 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 C9477A0C43; Tue, 20 Jul 2021 05:52:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A20D341196; Tue, 20 Jul 2021 05:52:33 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id D2F5D41199 for ; Tue, 20 Jul 2021 05:52:29 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6809A1FB; Mon, 19 Jul 2021 20:52:29 -0700 (PDT) Received: from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com [10.169.208.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0FAB03F694; Mon, 19 Jul 2021 20:52:25 -0700 (PDT) From: Joyce Kong To: thomas@monjalon.net, david.marchand@redhat.com, roretzla@linux.microsoft.com, stephen@networkplumber.org, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, harry.van.haaren@intel.com, honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 19 Jul 2021 22:51:25 -0500 Message-Id: <20210720035125.14214-9-joyce.kong@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035125.14214-1-joyce.kong@arm.com> References: <20210616025459.22717-1-joyce.kong@arm.com> <20210720035125.14214-1-joyce.kong@arm.com> Subject: [dpdk-dev] [PATCH v3 8/8] test/rcu: use compiler atomics for data sync 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 Sender: "dev" Covert rte_atomic usages to compiler atomic built-ins in rcu_perf testcases. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang Acked-by: Stephen Hemminger --- app/test/test_rcu_qsbr_perf.c | 98 +++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/app/test/test_rcu_qsbr_perf.c b/app/test/test_rcu_qsbr_perf.c index 3017e71120..cf7b158d22 100644 --- a/app/test/test_rcu_qsbr_perf.c +++ b/app/test/test_rcu_qsbr_perf.c @@ -30,8 +30,8 @@ static volatile uint32_t thr_id; static struct rte_rcu_qsbr *t[RTE_MAX_LCORE]; static struct rte_hash *h; static char hash_name[8]; -static rte_atomic64_t updates, checks; -static rte_atomic64_t update_cycles, check_cycles; +static uint64_t updates, checks; +static uint64_t update_cycles, check_cycles; /* Scale down results to 1000 operations to support lower * granularity clocks. @@ -81,8 +81,8 @@ test_rcu_qsbr_reader_perf(void *arg) } cycles = rte_rdtsc_precise() - begin; - rte_atomic64_add(&update_cycles, cycles); - rte_atomic64_add(&updates, loop_cnt); + __atomic_fetch_add(&update_cycles, cycles, __ATOMIC_RELAXED); + __atomic_fetch_add(&updates, loop_cnt, __ATOMIC_RELAXED); /* Make the thread offline */ rte_rcu_qsbr_thread_offline(t[0], thread_id); @@ -113,8 +113,8 @@ test_rcu_qsbr_writer_perf(void *arg) } while (loop_cnt < 20000000); cycles = rte_rdtsc_precise() - begin; - rte_atomic64_add(&check_cycles, cycles); - rte_atomic64_add(&checks, loop_cnt); + __atomic_fetch_add(&check_cycles, cycles, __ATOMIC_RELAXED); + __atomic_fetch_add(&checks, loop_cnt, __ATOMIC_RELAXED); return 0; } @@ -130,10 +130,10 @@ test_rcu_qsbr_perf(void) writer_done = 0; - rte_atomic64_clear(&updates); - rte_atomic64_clear(&update_cycles); - rte_atomic64_clear(&checks); - rte_atomic64_clear(&check_cycles); + __atomic_store_n(&updates, 0, __ATOMIC_RELAXED); + __atomic_store_n(&update_cycles, 0, __ATOMIC_RELAXED); + __atomic_store_n(&checks, 0, __ATOMIC_RELAXED); + __atomic_store_n(&check_cycles, 0, __ATOMIC_RELAXED); printf("\nPerf Test: %d Readers/1 Writer('wait' in qsbr_check == true)\n", num_cores - 1); @@ -168,15 +168,15 @@ test_rcu_qsbr_perf(void) rte_eal_mp_wait_lcore(); printf("Total quiescent state updates = %"PRIi64"\n", - rte_atomic64_read(&updates)); + __atomic_load_n(&updates, __ATOMIC_RELAXED)); printf("Cycles per %d quiescent state updates: %"PRIi64"\n", RCU_SCALE_DOWN, - rte_atomic64_read(&update_cycles) / - (rte_atomic64_read(&updates) / RCU_SCALE_DOWN)); - printf("Total RCU checks = %"PRIi64"\n", rte_atomic64_read(&checks)); + __atomic_load_n(&update_cycles, __ATOMIC_RELAXED) / + (__atomic_load_n(&updates, __ATOMIC_RELAXED) / RCU_SCALE_DOWN)); + printf("Total RCU checks = %"PRIi64"\n", __atomic_load_n(&checks, __ATOMIC_RELAXED)); printf("Cycles per %d checks: %"PRIi64"\n", RCU_SCALE_DOWN, - rte_atomic64_read(&check_cycles) / - (rte_atomic64_read(&checks) / RCU_SCALE_DOWN)); + __atomic_load_n(&check_cycles, __ATOMIC_RELAXED) / + (__atomic_load_n(&checks, __ATOMIC_RELAXED) / RCU_SCALE_DOWN)); rte_free(t[0]); @@ -193,8 +193,8 @@ test_rcu_qsbr_rperf(void) size_t sz; unsigned int i, tmp_num_cores; - rte_atomic64_clear(&updates); - rte_atomic64_clear(&update_cycles); + __atomic_store_n(&updates, 0, __ATOMIC_RELAXED); + __atomic_store_n(&update_cycles, 0, __ATOMIC_RELAXED); __atomic_store_n(&thr_id, 0, __ATOMIC_SEQ_CST); @@ -220,11 +220,11 @@ test_rcu_qsbr_rperf(void) rte_eal_mp_wait_lcore(); printf("Total quiescent state updates = %"PRIi64"\n", - rte_atomic64_read(&updates)); + __atomic_load_n(&updates, __ATOMIC_RELAXED)); printf("Cycles per %d quiescent state updates: %"PRIi64"\n", RCU_SCALE_DOWN, - rte_atomic64_read(&update_cycles) / - (rte_atomic64_read(&updates) / RCU_SCALE_DOWN)); + __atomic_load_n(&update_cycles, __ATOMIC_RELAXED) / + (__atomic_load_n(&updates, __ATOMIC_RELAXED) / RCU_SCALE_DOWN)); rte_free(t[0]); @@ -241,8 +241,8 @@ test_rcu_qsbr_wperf(void) size_t sz; unsigned int i; - rte_atomic64_clear(&checks); - rte_atomic64_clear(&check_cycles); + __atomic_store_n(&checks, 0, __ATOMIC_RELAXED); + __atomic_store_n(&check_cycles, 0, __ATOMIC_RELAXED); __atomic_store_n(&thr_id, 0, __ATOMIC_SEQ_CST); @@ -266,10 +266,10 @@ test_rcu_qsbr_wperf(void) /* Wait until all readers have exited */ rte_eal_mp_wait_lcore(); - printf("Total RCU checks = %"PRIi64"\n", rte_atomic64_read(&checks)); + printf("Total RCU checks = %"PRIi64"\n", __atomic_load_n(&checks, __ATOMIC_RELAXED)); printf("Cycles per %d checks: %"PRIi64"\n", RCU_SCALE_DOWN, - rte_atomic64_read(&check_cycles) / - (rte_atomic64_read(&checks) / RCU_SCALE_DOWN)); + __atomic_load_n(&check_cycles, __ATOMIC_RELAXED) / + (__atomic_load_n(&checks, __ATOMIC_RELAXED) / RCU_SCALE_DOWN)); rte_free(t[0]); @@ -317,8 +317,8 @@ test_rcu_qsbr_hash_reader(void *arg) } while (!writer_done); cycles = rte_rdtsc_precise() - begin; - rte_atomic64_add(&update_cycles, cycles); - rte_atomic64_add(&updates, loop_cnt); + __atomic_fetch_add(&update_cycles, cycles, __ATOMIC_RELAXED); + __atomic_fetch_add(&updates, loop_cnt, __ATOMIC_RELAXED); rte_rcu_qsbr_thread_unregister(temp, thread_id); @@ -389,10 +389,10 @@ test_rcu_qsbr_sw_sv_1qs(void) writer_done = 0; - rte_atomic64_clear(&updates); - rte_atomic64_clear(&update_cycles); - rte_atomic64_clear(&checks); - rte_atomic64_clear(&check_cycles); + __atomic_store_n(&updates, 0, __ATOMIC_RELAXED); + __atomic_store_n(&update_cycles, 0, __ATOMIC_RELAXED); + __atomic_store_n(&checks, 0, __ATOMIC_RELAXED); + __atomic_store_n(&check_cycles, 0, __ATOMIC_RELAXED); __atomic_store_n(&thr_id, 0, __ATOMIC_SEQ_CST); @@ -453,8 +453,8 @@ test_rcu_qsbr_sw_sv_1qs(void) } cycles = rte_rdtsc_precise() - begin; - rte_atomic64_add(&check_cycles, cycles); - rte_atomic64_add(&checks, i); + __atomic_fetch_add(&check_cycles, cycles, __ATOMIC_RELAXED); + __atomic_fetch_add(&checks, i, __ATOMIC_RELAXED); writer_done = 1; @@ -467,12 +467,12 @@ test_rcu_qsbr_sw_sv_1qs(void) printf("Following numbers include calls to rte_hash functions\n"); printf("Cycles per 1 quiescent state update(online/update/offline): %"PRIi64"\n", - rte_atomic64_read(&update_cycles) / - rte_atomic64_read(&updates)); + __atomic_load_n(&update_cycles, __ATOMIC_RELAXED) / + __atomic_load_n(&updates, __ATOMIC_RELAXED)); printf("Cycles per 1 check(start, check): %"PRIi64"\n\n", - rte_atomic64_read(&check_cycles) / - rte_atomic64_read(&checks)); + __atomic_load_n(&check_cycles, __ATOMIC_RELAXED) / + __atomic_load_n(&checks, __ATOMIC_RELAXED)); rte_free(t[0]); @@ -511,7 +511,7 @@ test_rcu_qsbr_sw_sv_1qs_non_blocking(void) printf("Perf test: 1 writer, %d readers, 1 QSBR variable, 1 QSBR Query, Non-Blocking QSBR check\n", num_cores); - __atomic_store_n(&thr_id, 0, __ATOMIC_SEQ_CST); + __atomic_store_n(&thr_id, 0, __ATOMIC_RELAXED); if (all_registered == 1) tmp_num_cores = num_cores; @@ -570,8 +570,8 @@ test_rcu_qsbr_sw_sv_1qs_non_blocking(void) } cycles = rte_rdtsc_precise() - begin; - rte_atomic64_add(&check_cycles, cycles); - rte_atomic64_add(&checks, i); + __atomic_fetch_add(&check_cycles, cycles, __ATOMIC_RELAXED); + __atomic_fetch_add(&checks, i, __ATOMIC_RELAXED); writer_done = 1; /* Wait and check return value from reader threads */ @@ -583,12 +583,12 @@ test_rcu_qsbr_sw_sv_1qs_non_blocking(void) printf("Following numbers include calls to rte_hash functions\n"); printf("Cycles per 1 quiescent state update(online/update/offline): %"PRIi64"\n", - rte_atomic64_read(&update_cycles) / - rte_atomic64_read(&updates)); + __atomic_load_n(&update_cycles, __ATOMIC_RELAXED) / + __atomic_load_n(&updates, __ATOMIC_RELAXED)); printf("Cycles per 1 check(start, check): %"PRIi64"\n\n", - rte_atomic64_read(&check_cycles) / - rte_atomic64_read(&checks)); + __atomic_load_n(&check_cycles, __ATOMIC_RELAXED) / + __atomic_load_n(&checks, __ATOMIC_RELAXED)); rte_free(t[0]); @@ -619,10 +619,10 @@ test_rcu_qsbr_main(void) return TEST_SKIPPED; } - rte_atomic64_init(&updates); - rte_atomic64_init(&update_cycles); - rte_atomic64_init(&checks); - rte_atomic64_init(&check_cycles); + __atomic_store_n(&updates, 0, __ATOMIC_RELAXED); + __atomic_store_n(&update_cycles, 0, __ATOMIC_RELAXED); + __atomic_store_n(&checks, 0, __ATOMIC_RELAXED); + __atomic_store_n(&check_cycles, 0, __ATOMIC_RELAXED); num_cores = 0; RTE_LCORE_FOREACH_WORKER(core_id) {