From: Santosh Shukla Date: Tue, 18 Apr 2017 14:41:29 +0000 (+0530) Subject: test/mempool_perf: free mempool on exit X-Git-Tag: spdx-start~3633 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4fb80afd82d2dbbe5a5fc9f38a9c53442b6c287b;p=dpdk.git test/mempool_perf: free mempool on exit Mempool_perf test not freeing pool memory. Signed-off-by: Santosh Shukla Acked-by: Shreyansh Jain Acked-by: Olivier Matz --- diff --git a/test/test/test_mempool_perf.c b/test/test/test_mempool_perf.c index 1b4045eb37..3749cf8bec 100644 --- a/test/test/test_mempool_perf.c +++ b/test/test/test_mempool_perf.c @@ -313,6 +313,7 @@ test_mempool_perf(void) { struct rte_mempool *mp_cache = NULL; struct rte_mempool *mp_nocache = NULL; + int ret = -1; rte_atomic32_init(&synchro); @@ -323,7 +324,7 @@ test_mempool_perf(void) my_obj_init, NULL, SOCKET_ID_ANY, 0); if (mp_nocache == NULL) - return -1; + goto err; /* create a mempool (with cache) */ mp_cache = rte_mempool_create("perf_test_cache", MEMPOOL_SIZE, @@ -333,48 +334,53 @@ test_mempool_perf(void) my_obj_init, NULL, SOCKET_ID_ANY, 0); if (mp_cache == NULL) - return -1; + goto err; /* performance test with 1, 2 and max cores */ printf("start performance test (without cache)\n"); if (do_one_mempool_test(mp_nocache, 1) < 0) - return -1; + goto err; if (do_one_mempool_test(mp_nocache, 2) < 0) - return -1; + goto err; if (do_one_mempool_test(mp_nocache, rte_lcore_count()) < 0) - return -1; + goto err; /* performance test with 1, 2 and max cores */ printf("start performance test (with cache)\n"); if (do_one_mempool_test(mp_cache, 1) < 0) - return -1; + goto err; if (do_one_mempool_test(mp_cache, 2) < 0) - return -1; + goto err; if (do_one_mempool_test(mp_cache, rte_lcore_count()) < 0) - return -1; + goto err; /* performance test with 1, 2 and max cores */ printf("start performance test (with user-owned cache)\n"); use_external_cache = 1; if (do_one_mempool_test(mp_nocache, 1) < 0) - return -1; + goto err; if (do_one_mempool_test(mp_nocache, 2) < 0) - return -1; + goto err; if (do_one_mempool_test(mp_nocache, rte_lcore_count()) < 0) - return -1; + goto err; rte_mempool_list_dump(stdout); - return 0; + ret = 0; + +err: + rte_mempool_free(mp_cache); + rte_mempool_free(mp_nocache); + return ret; } REGISTER_TEST_COMMAND(mempool_perf_autotest, test_mempool_perf);