From: Phil Yang <phil.yang@arm.com>
To: dev@dpdk.org
Cc: nd@arm.com
Subject: [dpdk-dev] [PATCH] app/testpmd: fix stats period can't quit normally in container
Date: Mon, 18 Sep 2017 11:00:34 +0800 [thread overview]
Message-ID: <1505703634-794-1-git-send-email-phil.yang@arm.com> (raw)
While running testpmd in container with stats-period option, it can't
quit normally after received SIGINT.
Signed-off-by: Phil Yang <phil.yang@arm.com>
---
app/test-pmd/testpmd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e097ee0..a4da9ea 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -183,6 +183,7 @@ 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) */
+uint8_t f_quit = 0; /* Receive LSC INTERRUPTION to stop show statistics periodically */
/*
* Configuration of packet segments used by the "txonly" processing engine.
*/
@@ -2285,6 +2286,8 @@ init_port(void)
static void
force_quit(void)
{
+ f_quit = 1;
+
pmd_test_exit();
prompt_exit();
}
@@ -2444,7 +2447,7 @@ main(int argc, char** argv)
/* Convert to number of cycles */
timer_period = stats_period * rte_get_timer_hz();
- while (1) {
+ while (!f_quit) {
cur_time = rte_get_timer_cycles();
diff_time += cur_time - prev_time;
--
2.7.4
next reply other threads:[~2017-09-18 3:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 3:00 Phil Yang [this message]
2017-09-18 3:35 Phil Yang
2017-09-18 3:40 Phil Yang
2017-09-21 8:32 ` Jianbo Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1505703634-794-1-git-send-email-phil.yang@arm.com \
--to=phil.yang@arm.com \
--cc=dev@dpdk.org \
--cc=nd@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).