From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 90BAAA00C5; Thu, 30 Apr 2020 12:49:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFC0E1DB56; Thu, 30 Apr 2020 12:49:54 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2B5941DB3D; Thu, 30 Apr 2020 12:49:52 +0200 (CEST) IronPort-SDR: rDH2HbuVdEqrseXnXIctlbLJ1NIRSRArFlovSD3tU51nOxbo7gLGOW4Q4gQArQBCuR/dxU3shK HsSdJ1sPi5LQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2020 03:49:51 -0700 IronPort-SDR: fEYXDrDqqVjaAMXWLcdXchj3xyWF5eMBYd8aUy2eu7LP7q3u5U3gwVAzQLQxaVMuwYAflio647 5tGSWbs/eKsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,334,1583222400"; d="scan'208";a="261736201" Received: from aburakov-mobl.ger.corp.intel.com (HELO ubuntu-vm.mshome.net) ([10.249.32.101]) by orsmga006.jf.intel.com with ESMTP; 30 Apr 2020 03:49:49 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: David Hunt , stable@dpdk.org Date: Thu, 30 Apr 2020 10:49:48 +0000 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: <0ebd62205da8cd9964dcd370a69cc5a38f54dede.1588162894.git.anatoly.burakov@intel.com> References: <0ebd62205da8cd9964dcd370a69cc5a38f54dede.1588162894.git.anatoly.burakov@intel.com> Subject: [dpdk-dev] [PATCH v2] l3fwd-power: add Rx interrupt timeout 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Currently, thread waiting on an interrupt does not have a timeout, so it will not ever wake up until traffic arrives. This means that, when time comes to exit the application, it will not quit unless there happens to be traffic coming in and waking up the thread from sleep. Fix it so that the interrupt thread sleeps for 10ms before waking up and attempting to poll again. Additionally, remove the log message to avoid spamming about entering interrupt mode. Fixes: 613ce6691c0d ("examples/l3fwd-power: implement proper shutdown") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov --- examples/l3fwd-power/main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 293b3da4ae..21fb15e1a2 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -829,11 +829,7 @@ sleep_until_rx_interrupt(int num) uint8_t queue_id; void *data; - RTE_LOG(INFO, L3FWD_POWER, - "lcore %u sleeps until interrupt triggers\n", - rte_lcore_id()); - - n = rte_epoll_wait(RTE_EPOLL_PER_THREAD, event, num, -1); + n = rte_epoll_wait(RTE_EPOLL_PER_THREAD, event, num, 10); for (i = 0; i < n; i++) { data = event[i].epdata.data; port_id = ((uintptr_t)data) >> CHAR_BIT; @@ -1306,7 +1302,8 @@ main_loop(__rte_unused void *dummy) /** * start receiving packets immediately */ - goto start_rx; + if (likely(!is_done())) + goto start_rx; } } stats[lcore_id].sleep_time += lcore_idle_hint; -- 2.17.1