From 5ce434a642c8d80cded32ae054b1fe7b6a20111b Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Mon, 3 Oct 2016 22:58:33 +0200 Subject: [PATCH] app/test: add mempool walk The mempool function rte_mempool_walk was not tested. It will print the name of all mempools. Signed-off-by: Thomas Monjalon Acked-by: Olivier Matz --- app/test/test_mempool.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index fffbf8d981..b9880b32b8 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -500,6 +500,12 @@ test_mempool_xmem_misc(void) return 0; } +static void +walk_cb(struct rte_mempool *mp, void *userdata __rte_unused) +{ + printf("\t%s\n", mp->name); +} + static int test_mempool(void) { @@ -561,6 +567,9 @@ test_mempool(void) goto err; } + printf("Walk into mempools:\n"); + rte_mempool_walk(walk_cb, NULL); + rte_mempool_list_dump(stdout); /* basic tests without cache */ -- 2.20.1