From 5e516c89830aacae67968490dbd8c542b9ffc430 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 7 Jan 2020 10:59:42 -0800 Subject: [PATCH] app/testpmd: call cleanup on exit The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program. This helps exercise free and close paths which can be checked with tools like valgrind. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger Acked-by: Bernard Iremonger --- app/test-pmd/testpmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index b374682236..2eec8afda1 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3570,5 +3570,10 @@ main(int argc, char** argv) return 1; } - return 0; + ret = rte_eal_cleanup(); + if (ret != 0) + rte_exit(EXIT_FAILURE, + "EAL cleanup failed: %s\n", strerror(-ret)); + + return EXIT_SUCCESS; } -- 2.20.1