[dpdk-stable] patch 'app/testpmd: fix quitting in container' has been queued to stable release 17.08.1

Yuanhan Liu yliu at fridaylinux.org
Tue Nov 21 14:17:21 CET 2017


Hi,

FYI, your patch has been queued to stable release 17.08.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/24/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 9ed8e0ed8baee86220785abe1e0c1865f1f99507 Mon Sep 17 00:00:00 2001
From: Phil Yang <phil.yang at arm.com>
Date: Fri, 22 Sep 2017 14:21:32 +0800
Subject: [PATCH] app/testpmd: fix quitting in container

[ upstream commit d9a191a00e817739e2a6ecc01178a29918adf199 ]

In container, the process cannot be terminated by SIGINT/SIGTERM when
execute with 'stats-period' option.
Fixed by adding a flag to exit stats period loop after received either
SIGINT or SIGTERM.

Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")

Signed-off-by: Phil Yang <phil.yang at arm.com>
Acked-by: Jianbo Liu <jianbo.liu at linaro.org>
---
 app/test-pmd/testpmd.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f9bdbf8..91e94fc 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -183,6 +183,13 @@ uint16_t mbuf_data_size = DEFAULT_MBUF_DATA_SIZE; /**< Mbuf data space size. */
 uint32_t param_total_num_mbufs = 0;  /**< number of mbufs in all pools - if
                                       * specified on command-line. */
 uint16_t stats_period; /**< Period to show statistics (disabled by default) */
+
+/*
+ * In container, it cannot terminate the process which running with 'stats-period'
+ * option. Set flag to exit stats period loop after received SIGINT/SIGTERM.
+ */
+uint8_t f_quit;
+
 /*
  * Configuration of packet segments used by the "txonly" processing engine.
  */
@@ -2278,6 +2285,8 @@ signal_handler(int signum)
 		rte_latencystats_uninit();
 #endif
 		force_quit();
+		/* Set flag to indicate the force termination. */
+		f_quit = 1;
 		/* exit with the expected status */
 		signal(signum, SIG_DFL);
 		kill(getpid(), signum);
@@ -2395,6 +2404,8 @@ main(int argc, char** argv)
 		char c;
 		int rc;
 
+		f_quit = 0;
+
 		printf("No commandline core given, start packet forwarding\n");
 		start_packet_forwarding(tx_first);
 		if (stats_period != 0) {
@@ -2404,7 +2415,7 @@ main(int argc, char** argv)
 			/* Convert to number of cycles */
 			timer_period = stats_period * rte_get_timer_hz();
 
-			while (1) {
+			while (f_quit == 0) {
 				cur_time = rte_get_timer_cycles();
 				diff_time += cur_time - prev_time;
 
-- 
2.7.4



More information about the stable mailing list