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 F3FFEA04F3 for ; Fri, 3 Jan 2020 07:41:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DC2B91C296; Fri, 3 Jan 2020 07:41:30 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A6EEE1C23D; Fri, 3 Jan 2020 07:41:27 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 22:41:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,389,1571727600"; d="scan'208";a="214375495" Received: from dpdk-xiao1.sh.intel.com ([10.67.110.150]) by orsmga008.jf.intel.com with ESMTP; 02 Jan 2020 22:41:25 -0800 From: Xiao Wang To: david.hunt@intel.com Cc: dev@dpdk.org, Xiao Wang , stable@dpdk.org Date: Fri, 3 Jan 2020 13:40:31 -0500 Message-Id: <20200103184031.196334-1-xiao.w.wang@intel.com> X-Mailer: git-send-email 2.15.1 Subject: [dpdk-stable] [PATCH] l3fwd-power: fix intr disable 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" Since all related queues' intr is turned on before epoll, we need to turn off all the queues' intr after wake up. Fixes: b736d64787fc ("examples/l3fwd-power: disable Rx interrupt when waking up") Cc: stable@dpdk.org Signed-off-by: Xiao Wang --- 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