diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-06-18 13:36:41 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-06-18 13:44:40 +0200 |
commit | 82ecfad773dbce052e2b46a4712a88d2ac266b8a (patch) | |
tree | 61b675053cd2518d1cc287b3db03969f5fa43612 /lib/librte_ether/rte_ethdev.c | |
parent | 547f5865f56b7a2277e00071d1c97d733140e418 (diff) |
New upstream version 17.11.3
Change-Id: Ic462f86fdc2d928727f49581036c19b7914c682b
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'lib/librte_ether/rte_ethdev.c')
-rw-r--r-- | lib/librte_ether/rte_ethdev.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 4d23bc1c..eea11d06 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -533,6 +533,12 @@ rte_eth_dev_rx_queue_stop(uint16_t port_id, uint16_t rx_queue_id) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); dev = &rte_eth_devices[port_id]; + if (!dev->data->dev_started) { + RTE_PMD_DEBUG_TRACE( + "port %d must be started before start any queue\n", port_id); + return -EINVAL; + } + if (rx_queue_id >= dev->data->nb_rx_queues) { RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=%d\n", rx_queue_id); return -EINVAL; @@ -585,6 +591,12 @@ rte_eth_dev_tx_queue_stop(uint16_t port_id, uint16_t tx_queue_id) RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); dev = &rte_eth_devices[port_id]; + if (!dev->data->dev_started) { + RTE_PMD_DEBUG_TRACE( + "port %d must be started before start any queue\n", port_id); + return -EINVAL; + } + if (tx_queue_id >= dev->data->nb_tx_queues) { RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=%d\n", tx_queue_id); return -EINVAL; |