X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_mempool_perf.c;h=8f629736e8fd31ebaea2ba85a9804c617c1df6d2;hb=88caad251c8de3a84e353b0b2a27014bc303df87;hp=60bda8aadbe88eacd8d6b4d86a21aa6f44a32856;hpb=f2fc83b40f06da6a6b2476005279ba52d4ce3c44;p=dpdk.git diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c index 60bda8aadb..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; @@ -143,9 +142,9 @@ per_lcore_mempool_test(void *arg) stats[lcore_id].enq_count = 0; - /* wait synchro for slaves */ - if (lcore_id != rte_get_master_lcore()) - while (rte_atomic32_read(&synchro) == 0); + /* wait synchro for workers */ + if (lcore_id != rte_get_main_lcore()) + 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)); @@ -214,7 +213,7 @@ launch_cores(struct rte_mempool *mp, unsigned int cores) return -1; } - RTE_LCORE_FOREACH_SLAVE(lcore_id) { + RTE_LCORE_FOREACH_WORKER(lcore_id) { if (cores == 1) break; cores--; @@ -222,13 +221,13 @@ launch_cores(struct rte_mempool *mp, unsigned int cores) mp, lcore_id); } - /* start synchro and launch test on master */ - rte_atomic32_set(&synchro, 1); + /* start synchro and launch test on main */ + __atomic_store_n(&synchro, 1, __ATOMIC_RELAXED); ret = per_lcore_mempool_test(mp); cores = cores_save; - RTE_LCORE_FOREACH_SLAVE(lcore_id) { + RTE_LCORE_FOREACH_WORKER(lcore_id) { if (cores == 1) break; cores--; @@ -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,