From 8b36297d15f90265b50fae211157dff573513359 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Wed, 7 Aug 2019 18:42:09 +0530 Subject: [PATCH] app/testpmd: fix latency stats deinit on signal On receiving signal, testpmd showing warning as "LATENCY_STATS: failed to remove Rx/Tx callback" because rte_latencystats_uninit is called without checking if latencystats is enabled or not. After this fix, rte_latencystats_uninit will be called only if latencystats is enabled. Fixes: 62d3216d6194 ("app/testpmd: add latency statistics calculation") Cc: stable@dpdk.org Signed-off-by: Amit Gupta Acked-by: Jerin Jacob Tested-by: Jerin Jacob --- app/test-pmd/testpmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index a461cef188..e8e2a39b64 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3212,7 +3212,8 @@ signal_handler(int signum) rte_pdump_uninit(); #endif #ifdef RTE_LIBRTE_LATENCY_STATS - rte_latencystats_uninit(); + if (latencystats_enabled != 0) + rte_latencystats_uninit(); #endif force_quit(); /* Set flag to indicate the force termination. */ -- 2.20.1