From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 6932A235 for ; Tue, 21 Nov 2017 14:25:38 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1DF0720B75; Tue, 21 Nov 2017 08:25:38 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:25:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=dh8d5vCmnuk5CASv+ zcbxP8LPFJCYl4YpRCvY8koq7k=; b=RPEcsxwvTxOCUltRDIvNAchGwc9JxBgoO sB1H8XBLD1SyHG4ih8htFd9+GHwYeA4+vkPCBIa1hYlWfm6r1ho7tzfoP7x0lYcO LPLP2kLZU7WnRS0/RSF8LAA+nDi0/Pr1a6ifHZhTF+oJ9XNZOGbPzMGJx8o6zjC7 et8HHX1z0Yi4pzwVqGRgLwVaDWx1rKV8MIsNag7RtxWKHxuesc/uFDMDe6KcQfXz 52WMhJUI6NB6I1df4VwHTyvxcrRJbi5C1MS4Zkv80+OyNSVgW6DBISIjhhM9e5YA ZyzNWTaNZxHZTNQf7hPIDKuBpOuIdDEvcNEtLq67zowJBXdqSzq3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=dh8d5vCmnuk5CASv+zcbxP8LPFJCYl4YpRCvY8koq7k=; b=GyXvFzMW bahuwJ8B2eOvAy6TCQmtsnNHUWqQ6Yt22AcoEEXqFAQ+oOJ8+qYnfRv91JbBlTR0 VetrHw4yRyQoKsRs2UqNu9O43X6JEiUDMo1UYJH3BsF5OWuNazjOkYyif7yQ/n34 1Y1gV3k3g59GtFCrD03p9G6DOV+cL6RGjvFYZMhDKsEh5FiFAmkr54Gy7gh/0enx zG9auANgAl+s9SxbqVmYlY0+pKiogAb60DUGt3+xkNccwiXSL9g0hQO8q/cesCt6 69pOYnLtd/xsgIslMNniTMwutdGcoNq+G3moLYGCh1t6Lg2WkkK8lZdealstzrO9 s/4LdYn2qa98/Q== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id A5A5924A81; Tue, 21 Nov 2017 08:25:35 -0500 (EST) From: Yuanhan Liu To: Phil Yang Cc: Jianbo Liu , dpdk stable Date: Tue, 21 Nov 2017 21:17:21 +0800 Message-Id: <1511270333-31002-99-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'app/testpmd: fix quitting in container' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:25:38 -0000 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 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 Acked-by: Jianbo Liu --- 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