From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 9B180199A9 for ; Thu, 21 Sep 2017 10:32:13 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id r68so13303196wmg.3 for ; Thu, 21 Sep 2017 01:32:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=EHkthbnHd9hFJ4fbIJOCNCmLN9b2lKexQUIt0Xdd+y0=; b=NR7a4v4juAwcWx8y1CPtSJZpHQVhJi7t5W0m2LZoBie9dMV3FIb1To3mYhbgFM8WCy su2Vq61IiPwAUQRX5mUThJp5mqpwQht6QuzNnc73m5ktkDUF/gzdzTo5BIy7Dc5ZOIBB qowmBxb60W/o8B6tyScAa7tRbBX2d+7VdGZpA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=EHkthbnHd9hFJ4fbIJOCNCmLN9b2lKexQUIt0Xdd+y0=; b=MvRTx1yT1a1tbMGwVO9THMytVSsqYpicoGkzNf5OGl9DysWYPZZ6f4+Wdaen+wNYya BvqzaWIoRh4aRGJzxqyZ1jhlWTs16vOeRRWVAICnaFyqI94QKWa2LVbhA92MMdQFN2TH Pj6+l8t6Sw5/CtbJPSuMzmkNgJwgaGWC2vPj0fB3LqyFUtG7tlTjtdKGQQuymZWM+ZTS UCNeqzvSeFeaVIaTJ+mKw9i6owYILoQSqDXj2yYZGHBZY1AQ9a8En0hsUzpKtSHAl0d1 CzWuC+VRRpeMESD4AtxcFnnmtejEDp7uhZ5/t/6s/s1ZIhJW0PUQTBJTjAMEm1WUTQ34 3bRA== X-Gm-Message-State: AHPjjUiYoWggr5dHBz/CN2ReqyBDX8XsJyQVHFGjUJW0cOJCU3GPJf2z dWFAIbaC2sArZQc0p5+sFDNcBW5ndZ1EBV9bMk5KLO7bMPQ= X-Google-Smtp-Source: AOwi7QCk/05QrQrf5WTSKKsBMy8Rf9rM7UT8lgoKclF01XnNq0HWOP9G4PEKiLmlX2zGiupcdKYwFtwBPxYxni4b5Kk= X-Received: by 10.80.164.212 with SMTP id x20mr287378edb.287.1505982733300; Thu, 21 Sep 2017 01:32:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.174.148 with HTTP; Thu, 21 Sep 2017 01:32:12 -0700 (PDT) In-Reply-To: <1505706058-1841-1-git-send-email-phil.yang@arm.com> References: <1505706058-1841-1-git-send-email-phil.yang@arm.com> From: Jianbo Liu Date: Thu, 21 Sep 2017 16:32:12 +0800 Message-ID: To: Phil Yang Cc: dev@dpdk.org, nd@arm.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix stats period can't quit normally in container X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 08:32:13 -0000 On 18 September 2017 at 11:40, Phil Yang wrote: > While running testpmd in container with stats-period option, it can't > quit normally after received SIGINT. > > Signed-off-by: Phil Yang > --- > app/test-pmd/testpmd.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index e097ee0..d94c63b 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; /* Receive LSC INTERRUPTION to stop show statistics periodically */ The comment seems wrong, as it's not related to LSC. > /* > * 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; I suggest moving this line to the bottom of this function. > + > pmd_test_exit(); > prompt_exit(); > } > @@ -2441,10 +2444,13 @@ main(int argc, char** argv) > uint64_t prev_time = 0, cur_time, diff_time = 0; > uint64_t timer_period; > > + /* Receive LSC interrupt to stop showing statistics period */ > + f_quit = 0; > + > /* 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 >