net/sfc: support runtime Tx queue setup
authorIgor Romanov <igor.romanov@oktetlabs.ru>
Wed, 29 Aug 2018 07:35:34 +0000 (08:35 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 14 Sep 2018 18:08:41 +0000 (20:08 +0200)
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
doc/guides/nics/features/sfc_efx.ini
drivers/net/sfc/sfc_ethdev.c
drivers/net/sfc/sfc_tx.c

index 5d2e901..d1aa833 100644 (file)
@@ -10,6 +10,7 @@ Link status event    = Y
 Fast mbuf free       = Y
 Queue start/stop     = Y
 Runtime Rx queue setup = Y
+Runtime Tx queue setup = Y
 MTU update           = Y
 Jumbo frame          = Y
 Scattered Rx         = Y
index 9b5324c..435bde6 100644 (file)
@@ -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)
                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 *
@@ -1197,6 +1198,9 @@ sfc_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)
        if (sa->state != SFC_ADAPTER_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);
        if (rc != 0)
                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_not_setup:
 fail_not_started:
        sfc_adapter_unlock(sa);
        SFC_ASSERT(rc > 0);
index 6d42a1a..8af08b3 100644 (file)
@@ -421,6 +421,7 @@ sfc_tx_qstart(struct sfc_adapter *sa, unsigned int sw_index)
 
        txq = txq_info->txq;
 
+       SFC_ASSERT(txq != NULL);
        SFC_ASSERT(txq->state == SFC_TXQ_INITIALIZED);
 
        evq = txq->evq;
@@ -501,7 +502,7 @@ sfc_tx_qstop(struct sfc_adapter *sa, unsigned int sw_index)
 
        txq = txq_info->txq;
 
-       if (txq->state == SFC_TXQ_INITIALIZED)
+       if (txq == NULL || txq->state == SFC_TXQ_INITIALIZED)
                return;
 
        SFC_ASSERT(txq->state & SFC_TXQ_STARTED);
@@ -578,8 +579,9 @@ sfc_tx_start(struct sfc_adapter *sa)
                goto fail_efx_tx_init;
 
        for (sw_index = 0; sw_index < sa->txq_count; ++sw_index) {
-               if (!(sa->txq_info[sw_index].deferred_start) ||
-                   sa->txq_info[sw_index].deferred_started) {
+               if (sa->txq_info[sw_index].txq != NULL &&
+                   (!(sa->txq_info[sw_index].deferred_start) ||
+                    sa->txq_info[sw_index].deferred_started)) {
                        rc = sfc_tx_qstart(sa, sw_index);
                        if (rc != 0)
                                goto fail_tx_qstart;