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: cac923cfea ("ethdev: support runtime queue setup")

Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit is contained in:
Yanglong Wu 2018-05-11 16:22:28 +08:00 committed by Ferruh Yigit
parent 3d4faec985
commit b447e89e33

View File

@ -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;