From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DA72C690F for ; Thu, 8 Sep 2016 18:48:55 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP; 08 Sep 2016 09:48:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,301,1470726000"; d="scan'208";a="6194556" Received: from unknown (HELO silpixa00394369.ir.intel.com) ([10.237.212.103]) by orsmga005.jf.intel.com with ESMTP; 08 Sep 2016 09:48:53 -0700 From: James Poole To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, James Poole Date: Thu, 8 Sep 2016 10:49:16 +0100 Message-Id: <1473328156-32488-1-git-send-email-james.g.poole@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] app/testpmd: fix timeout in Rx queue flushing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2016 16:48:56 -0000 When testpmd is run, the application would hang on the second time that "start" is executed. This is because the timer limit would get multiplied to an unreachably high number. At the start of flush_fwd_rx_queues(), the timer limit now resets to stop it from getting to this high number. The timer has been made local for this function. Fixes: f487715f36f5 ("app/testpmd: add timeout in Rx queue flushing") Signed-off-by: James Poole --- app/test-pmd/testpmd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 1428974..33a1403 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -272,9 +272,6 @@ uint32_t bypass_timeout = RTE_BYPASS_TMT_OFF; #endif -/* default period is 1 second */ -static uint64_t timer_period = 1; - /* * Ethernet device configuration. */ @@ -881,9 +878,10 @@ flush_fwd_rx_queues(void) uint16_t i; uint8_t j; uint64_t prev_tsc = 0, diff_tsc, cur_tsc, timer_tsc = 0; + uint64_t timer_period; /* convert to number of cycles */ - timer_period *= rte_get_timer_hz(); + timer_period = rte_get_timer_hz(); /* 1 second timeout */ for (j = 0; j < 2; j++) { for (rxp = 0; rxp < cur_fwd_config.nb_fwd_ports; rxp++) { -- 2.5.5