summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYanglong Wu <yanglong.wu@intel.com>2018-05-11 16:22:28 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:31:54 +0100
commitb447e89e33336324e7b4729cd35b5a017fe5dd82 (patch)
tree23ecf5c010efa31102b40b451bf697ac8f83def5
parent3d4faec9857f04dd25130ab51e356209b2559a39 (diff)
downloaddpdk-b447e89e33336324e7b4729cd35b5a017fe5dd82.zip
dpdk-b447e89e33336324e7b4729cd35b5a017fe5dd82.tar.gz
dpdk-b447e89e33336324e7b4729cd35b5a017fe5dd82.tar.xz
ethdev: fix checking Rx/Tx queue status
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> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
-rw-r--r--lib/librte_ethdev/rte_ethdev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 9ebe869..b3ed821 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1525,8 +1525,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;
@@ -1689,8 +1690,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;