From: Olivier Matz Date: Thu, 9 Jul 2015 09:01:29 +0000 (+0200) Subject: app/test: decrease size of requested mempool X-Git-Tag: spdx-start~8815 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=2465980ad2e7ccaa223050b00d97b403477b2394;p=dpdk.git app/test: decrease size of requested mempool In test application, the default size of allocated mempool is calculated as following: (RTE_MAX_LCORE * (RTE_MEMPOOL_CACHE_MAX_SIZE + max_kept_objects)) - 1 The objective is to ensure that all cores can fill their cache and keep 'max_kept_objects' at the same time. As RTE_MAX_LCORE is 128 and RTE_MEMPOOL_CACHE_MAX_SIZE is 512 in the default configuration, it can produce very large mempools (170 MB). We can replace the number of core by a dynamic value, which drastically reduces the amount of memory needed for this test (5 MB with 4 cores). Signed-off-by: Olivier Matz Acked-by: Bruce Richardson --- diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index 9eb0d5da12..72f8fb62b6 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -75,7 +75,7 @@ #define TIME_S 5 #define MEMPOOL_ELT_SIZE 2048 #define MAX_KEEP 128 -#define MEMPOOL_SIZE ((RTE_MAX_LCORE*(MAX_KEEP+RTE_MEMPOOL_CACHE_MAX_SIZE))-1) +#define MEMPOOL_SIZE ((rte_lcore_count()*(MAX_KEEP+RTE_MEMPOOL_CACHE_MAX_SIZE))-1) static struct rte_mempool *mp; static struct rte_mempool *mp_cache, *mp_nocache; diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c index 1f7539c7b7..cdc02a007c 100644 --- a/app/test/test_mempool_perf.c +++ b/app/test/test_mempool_perf.c @@ -94,7 +94,7 @@ #define TIME_S 5 #define MEMPOOL_ELT_SIZE 2048 #define MAX_KEEP 128 -#define MEMPOOL_SIZE ((RTE_MAX_LCORE*(MAX_KEEP+RTE_MEMPOOL_CACHE_MAX_SIZE))-1) +#define MEMPOOL_SIZE ((rte_lcore_count()*(MAX_KEEP+RTE_MEMPOOL_CACHE_MAX_SIZE))-1) static struct rte_mempool *mp; static struct rte_mempool *mp_cache, *mp_nocache;