net/sfc: support runtime Tx queue setup
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
This commit is contained in:
parent
0668a27a62
commit
862b35afca
@ -10,6 +10,7 @@ Link status event = Y
|
|||||||
Fast mbuf free = Y
|
Fast mbuf free = Y
|
||||||
Queue start/stop = Y
|
Queue start/stop = Y
|
||||||
Runtime Rx queue setup = Y
|
Runtime Rx queue setup = Y
|
||||||
|
Runtime Tx queue setup = Y
|
||||||
MTU update = Y
|
MTU update = Y
|
||||||
Jumbo frame = Y
|
Jumbo frame = Y
|
||||||
Scattered Rx = Y
|
Scattered Rx = Y
|
||||||
|
@ -172,7 +172,8 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
|
|||||||
if (sa->dp_tx->get_dev_info != NULL)
|
if (sa->dp_tx->get_dev_info != NULL)
|
||||||
sa->dp_tx->get_dev_info(dev_info);
|
sa->dp_tx->get_dev_info(dev_info);
|
||||||
|
|
||||||
dev_info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP;
|
dev_info->dev_capa = RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
|
||||||
|
RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint32_t *
|
static const uint32_t *
|
||||||
@ -1197,6 +1198,9 @@ sfc_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
|
|||||||
if (sa->state != SFC_ADAPTER_STARTED)
|
if (sa->state != SFC_ADAPTER_STARTED)
|
||||||
goto fail_not_started;
|
goto fail_not_started;
|
||||||
|
|
||||||
|
if (sa->txq_info[tx_queue_id].txq == NULL)
|
||||||
|
goto fail_not_setup;
|
||||||
|
|
||||||
rc = sfc_tx_qstart(sa, tx_queue_id);
|
rc = sfc_tx_qstart(sa, tx_queue_id);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
goto fail_tx_qstart;
|
goto fail_tx_qstart;
|
||||||
@ -1208,6 +1212,7 @@ sfc_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
|
|||||||
|
|
||||||
fail_tx_qstart:
|
fail_tx_qstart:
|
||||||
|
|
||||||
|
fail_not_setup:
|
||||||
fail_not_started:
|
fail_not_started:
|
||||||
sfc_adapter_unlock(sa);
|
sfc_adapter_unlock(sa);
|
||||||
SFC_ASSERT(rc > 0);
|
SFC_ASSERT(rc > 0);
|
||||||
|
@ -421,6 +421,7 @@ sfc_tx_qstart(struct sfc_adapter *sa, unsigned int sw_index)
|
|||||||
|
|
||||||
txq = txq_info->txq;
|
txq = txq_info->txq;
|
||||||
|
|
||||||
|
SFC_ASSERT(txq != NULL);
|
||||||
SFC_ASSERT(txq->state == SFC_TXQ_INITIALIZED);
|
SFC_ASSERT(txq->state == SFC_TXQ_INITIALIZED);
|
||||||
|
|
||||||
evq = txq->evq;
|
evq = txq->evq;
|
||||||
@ -501,7 +502,7 @@ sfc_tx_qstop(struct sfc_adapter *sa, unsigned int sw_index)
|
|||||||
|
|
||||||
txq = txq_info->txq;
|
txq = txq_info->txq;
|
||||||
|
|
||||||
if (txq->state == SFC_TXQ_INITIALIZED)
|
if (txq == NULL || txq->state == SFC_TXQ_INITIALIZED)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SFC_ASSERT(txq->state & SFC_TXQ_STARTED);
|
SFC_ASSERT(txq->state & SFC_TXQ_STARTED);
|
||||||
@ -578,8 +579,9 @@ sfc_tx_start(struct sfc_adapter *sa)
|
|||||||
goto fail_efx_tx_init;
|
goto fail_efx_tx_init;
|
||||||
|
|
||||||
for (sw_index = 0; sw_index < sa->txq_count; ++sw_index) {
|
for (sw_index = 0; sw_index < sa->txq_count; ++sw_index) {
|
||||||
if (!(sa->txq_info[sw_index].deferred_start) ||
|
if (sa->txq_info[sw_index].txq != NULL &&
|
||||||
sa->txq_info[sw_index].deferred_started) {
|
(!(sa->txq_info[sw_index].deferred_start) ||
|
||||||
|
sa->txq_info[sw_index].deferred_started)) {
|
||||||
rc = sfc_tx_qstart(sa, sw_index);
|
rc = sfc_tx_qstart(sa, sw_index);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
goto fail_tx_qstart;
|
goto fail_tx_qstart;
|
||||||
|
Loading…
Reference in New Issue
Block a user