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: 62d3216d61 ("app/testpmd: add latency statistics calculation")
Cc: stable@dpdk.org

Signed-off-by: Amit Gupta <agupta3@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Amit Gupta 2019-08-07 18:42:09 +05:30 committed by Thomas Monjalon
parent de4473d911
commit 8b36297d15

View File

@ -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. */