From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 4DE0F56A3 for ; Fri, 11 May 2018 10:29:22 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 May 2018 01:29:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,387,1520924400"; d="scan'208";a="50007303" Received: from wuyanglong.sh.intel.com ([10.67.111.162]) by orsmga003.jf.intel.com with ESMTP; 11 May 2018 01:29:20 -0700 From: Yanglong Wu To: dev@dpdk.org Cc: qi.z.zhang@intel.com, wenzhuo.lu@intel.com, Yanglong Wu Date: Fri, 11 May 2018 16:22:28 +0800 Message-Id: <20180511082228.158405-1-yanglong.wu@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status 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: , X-List-Received-Date: Fri, 11 May 2018 08:29:23 -0000 Relax the check for queue setup, since some device may not update queue states during dev_stop. Fixes: cac923cfea47 ("ethdev: support runtime queue setup") Signed-off-by: Yanglong Wu --- lib/librte_ethdev/rte_ethdev.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index a357ee09f..34379642a 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1479,8 +1479,9 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP)) return -EBUSY; - if (dev->data->rx_queue_state[rx_queue_id] != - RTE_ETH_QUEUE_STATE_STOPPED) + if (dev->data->dev_started && + (dev->data->rx_queue_state[rx_queue_id] != + RTE_ETH_QUEUE_STATE_STOPPED)) return -EBUSY; rxq = dev->data->rx_queues; @@ -1611,8 +1612,9 @@ rte_eth_tx_queue_setup(uint16_t port_id, uint16_t tx_queue_id, RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP)) return -EBUSY; - if (dev->data->tx_queue_state[tx_queue_id] != - RTE_ETH_QUEUE_STATE_STOPPED) + if (dev->data->dev_started && + (dev->data->tx_queue_state[tx_queue_id] != + RTE_ETH_QUEUE_STATE_STOPPED)) return -EBUSY; txq = dev->data->tx_queues; -- 2.11.0