ethdev: check queue state before starting or stopping
[dpdk.git] / drivers / net / enic / enic_ethdev.c
index 1e1a5da..3888dbb 100644 (file)
@@ -193,6 +193,7 @@ static int enicpmd_dev_tx_queue_start(struct rte_eth_dev *eth_dev,
        ENICPMD_FUNC_TRACE();
 
        enic_start_wq(enic, queue_idx);
+       eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
 
        return 0;
 }
@@ -208,6 +209,8 @@ static int enicpmd_dev_tx_queue_stop(struct rte_eth_dev *eth_dev,
        ret = enic_stop_wq(enic, queue_idx);
        if (ret)
                dev_err(enic, "error in stopping wq %d\n", queue_idx);
+       else
+               eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
 
        return ret;
 }
@@ -220,6 +223,7 @@ static int enicpmd_dev_rx_queue_start(struct rte_eth_dev *eth_dev,
        ENICPMD_FUNC_TRACE();
 
        enic_start_rq(enic, queue_idx);
+       eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
 
        return 0;
 }
@@ -235,6 +239,8 @@ static int enicpmd_dev_rx_queue_stop(struct rte_eth_dev *eth_dev,
        ret = enic_stop_rq(enic, queue_idx);
        if (ret)
                dev_err(enic, "error in stopping rq %d\n", queue_idx);
+       else
+               eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
 
        return ret;
 }