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 006E5A0524; Thu, 30 Jan 2020 18:40:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D6F931C045; Thu, 30 Jan 2020 18:40:29 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id F18681C02C; Thu, 30 Jan 2020 18:40:27 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2020 09:40:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,382,1574150400"; d="scan'208";a="253078092" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga004.fm.intel.com with ESMTP; 30 Jan 2020 09:40:26 -0800 Received: from sivswdev09.ir.intel.com (sivswdev09.ir.intel.com [10.237.217.48]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 00UHePVV014704; Thu, 30 Jan 2020 17:40:25 GMT Received: from sivswdev09.ir.intel.com (localhost [127.0.0.1]) by sivswdev09.ir.intel.com with ESMTP id 00UHePJC032698; Thu, 30 Jan 2020 17:40:25 GMT Received: (from lma25@localhost) by sivswdev09.ir.intel.com with LOCAL id 00UHeP1E032694; Thu, 30 Jan 2020 17:40:25 GMT Date: Thu, 30 Jan 2020 17:40:25 +0000 From: "Liang, Ma" To: Xiao Wang Cc: david.hunt@intel.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20200130174025.GA30906@sivswdev09.ir.intel.com> References: <20200121030657.39048-1-xiao.w.wang@intel.com> <20200121030657.39048-3-xiao.w.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200121030657.39048-3-xiao.w.wang@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) Subject: Re: [dpdk-dev] [PATCH 2/2] l3fwd-power: fix interrupt disable 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" On 20 Jan 22:06, Xiao Wang wrote: > Since all related queues' interrupts are turned on before epoll, we need > to turn off all the interrupts after wakeup. This patch fixes the issue > of only turning off the interrupted queues. > > Fixes: b736d64787fc ("examples/l3fwd-power: disable Rx interrupt when waking up") > Cc: stable@dpdk.org > > Signed-off-by: Xiao Wang Hi Xiao, I'm OK with the patch. Reviewed-by: Liang Ma Regards Liang > --- > examples/l3fwd-power/main.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c > index ffcc7ecf4..e9b2cb5b3 100644 > --- a/examples/l3fwd-power/main.c > +++ b/examples/l3fwd-power/main.c > @@ -880,9 +880,6 @@ sleep_until_rx_interrupt(int num) > port_id = ((uintptr_t)data) >> CHAR_BIT; > queue_id = ((uintptr_t)data) & > RTE_LEN2MASK(CHAR_BIT, uint8_t); > - rte_spinlock_lock(&(locks[port_id])); > - rte_eth_dev_rx_intr_disable(port_id, queue_id); > - rte_spinlock_unlock(&(locks[port_id])); > RTE_LOG(INFO, L3FWD_POWER, > "lcore %u is waked up from rx interrupt on" > " port %d queue %d\n", > @@ -892,7 +889,7 @@ sleep_until_rx_interrupt(int num) > return 0; > } > > -static void turn_on_intr(struct lcore_conf *qconf) > +static void turn_on_off_intr(struct lcore_conf *qconf, bool on) > { > int i; > struct lcore_rx_queue *rx_queue; > @@ -905,7 +902,10 @@ static void turn_on_intr(struct lcore_conf *qconf) > queue_id = rx_queue->queue_id; > > rte_spinlock_lock(&(locks[port_id])); > - rte_eth_dev_rx_intr_enable(port_id, queue_id); > + if (on) > + rte_eth_dev_rx_intr_enable(port_id, queue_id); > + else > + rte_eth_dev_rx_intr_disable(port_id, queue_id); > rte_spinlock_unlock(&(locks[port_id])); > } > } > @@ -1340,9 +1340,10 @@ main_loop(__attribute__((unused)) void *dummy) > else { > /* suspend until rx interrupt triggers */ > if (intr_en) { > - turn_on_intr(qconf); > + turn_on_off_intr(qconf, 1); > sleep_until_rx_interrupt( > qconf->n_rx_queue); > + turn_on_off_intr(qconf, 0); > /** > * start receiving packets immediately > */ > -- > 2.15.1 >