Skip to contentSkip to conversation

ethdev: fix queue start

PATCH Applied Qi Zhang 3 participants 3 messages Mar 22, 2018 – Mar 27, 2018

lore
Share & tools
lore

Qi Zhang

author
#0 lore raw

PATCH 1/1 ethdev: fix queue start

Device must be started before start any queue.

Fixes 0748be2cf9a2 ("ethdev: queue start and stop")
---
 lib/librte_ether/rte_ethdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
lib/librte_ether/rte_ethdev.c +12 -0
index 0590f0c10..7aa404fa5 100644
@@ -732,6 +732,12 @@ rte_eth_dev_rx_queue_start(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;
@@ -785,6 +791,12 @@ rte_eth_dev_tx_queue_start(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;
Signature · 1 line
2.13.6
Acked-by on v1 1/1
#1 lore raw
Quoted 34 lines

Device must be started before start any queue.

Fixes 0748be2cf9a2 ("ethdev: queue start and stop")
---
 lib/librte_ether/rte_ethdev.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
lib/librte_ether/rte_ethdev.c +6 -0
index 0590f0c10..7aa404fa5 100644
@@ -732,6 +732,12 @@ rte_eth_dev_rx_queue_start(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;
@@ -785,6 +791,12 @@ rte_eth_dev_tx_queue_start(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];

lib/librte_ether/rte_ethdev.c rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_t tx_queue_id)

Quoted 10 lines
lib/librte_ether/rte_ethdev.c +6 -1
+	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;
--
Quoted 1 line

2.13.6