DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yanglong Wu <yanglong.wu@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, wenzhuo.lu@intel.com,
	Yanglong Wu <yanglong.wu@intel.com>
Subject: [dpdk-dev] [PATCH] ethdev: fix checking Rx/Tx queue status
Date: Fri, 11 May 2018 16:22:28 +0800	[thread overview]
Message-ID: <20180511082228.158405-1-yanglong.wu@intel.com> (raw)

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 <yanglong.wu@intel.com>
---
 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

             reply	other threads:[~2018-05-11  8:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  8:22 Yanglong Wu [this message]
2018-05-11  8:39 ` Ananyev, Konstantin
2018-05-11  9:23   ` Zhang, Qi Z
2018-05-11  9:51     ` Ananyev, Konstantin
2018-05-11 12:34       ` Zhang, Qi Z
2018-05-11 12:52         ` Ananyev, Konstantin
2018-05-11 13:33           ` Zhang, Qi Z
2018-05-11 15:43       ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180511082228.158405-1-yanglong.wu@intel.com \
    --to=yanglong.wu@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).