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 3DFC7A00BE for ; Wed, 29 Apr 2020 14:21:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 064B01DA97; Wed, 29 Apr 2020 14:21:50 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 7EF021DA11; Wed, 29 Apr 2020 14:21:46 +0200 (CEST) IronPort-SDR: 6TKanuLKUYIVWwBHdpDsgHzS0Scq42n19KADZ5wr2wjoC9MzN8WUccQYcqryHF8VvuBPLTZ4MH AvxMDIBPo98g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 05:21:45 -0700 IronPort-SDR: nIYZS5W/tvODiMm4PjrnDF9dlBCv2lIHPNq8j90XFp9vWOQcCkzHTaVhO4Hf6bpDTXGauuZtiJ hDkuF74Lt0PQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,332,1583222400"; d="scan'208";a="276154708" Received: from aburakov-mobl.ger.corp.intel.com (HELO ubuntu-vm.mshome.net) ([10.213.243.43]) by orsmga002.jf.intel.com with ESMTP; 29 Apr 2020 05:21:44 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: David Hunt , stable@dpdk.org Date: Wed, 29 Apr 2020 12:21:43 +0000 Message-Id: <0ebd62205da8cd9964dcd370a69cc5a38f54dede.1588162894.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH] l3fwd-power: add Rx interrupt timeout 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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. Fixes: 613ce6691c0d ("examples/l3fwd-power: implement proper shutdown") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov --- examples/l3fwd-power/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 293b3da4ae..4112bbbee4 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -833,7 +833,7 @@ sleep_until_rx_interrupt(int num) "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 +1306,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