ENICPMD_FUNC_TRACE();
enic_start_wq(enic, queue_idx);
- eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
}
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;
}
ENICPMD_FUNC_TRACE();
enic_start_rq(enic, queue_idx);
- eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
return 0;
}
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;
}
void enic_start_wq(struct enic *enic, uint16_t queue_idx)
{
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
vnic_wq_enable(&enic->wq[queue_idx]);
+ eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
}
int enic_stop_wq(struct enic *enic, uint16_t queue_idx)
{
- return vnic_wq_disable(&enic->wq[queue_idx]);
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
+ int ret;
+
+ ret = vnic_wq_disable(&enic->wq[queue_idx]);
+ if (ret)
+ return ret;
+
+ eth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
+ return 0;
}
void enic_start_rq(struct enic *enic, uint16_t queue_idx)
{
struct vnic_rq *rq_sop = &enic->rq[enic_sop_rq(queue_idx)];
struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
if (rq_data->in_use)
vnic_rq_enable(rq_data);
rte_mb();
vnic_rq_enable(rq_sop);
-
+ eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;
}
int enic_stop_rq(struct enic *enic, uint16_t queue_idx)
{
int ret1 = 0, ret2 = 0;
-
+ struct rte_eth_dev *eth_dev = enic->rte_dev;
struct vnic_rq *rq_sop = &enic->rq[enic_sop_rq(queue_idx)];
struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
if (ret2)
return ret2;
- else
+ else if (ret1)
return ret1;
+
+ eth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STOPPED;
+ return 0;
}
int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,