net/sfc: support runtime Rx queue setup
authorIgor Romanov <igor.romanov@oktetlabs.ru>
Wed, 29 Aug 2018 07:35:33 +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_rx.c

index 8a497ee..5d2e901 100644 (file)
@@ -9,6 +9,7 @@ Link status          = Y
 Link status event    = Y
 Fast mbuf free       = Y
 Queue start/stop     = Y
+Runtime Rx queue setup = Y
 MTU update           = Y
 Jumbo frame          = Y
 Scattered Rx         = Y
index 9decbf5..9b5324c 100644 (file)
@@ -171,6 +171,8 @@ sfc_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                sa->dp_rx->get_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;
 }
 
 static const uint32_t *
@@ -1143,6 +1145,9 @@ sfc_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        if (sa->state != SFC_ADAPTER_STARTED)
                goto fail_not_started;
 
+       if (sa->rxq_info[rx_queue_id].rxq == NULL)
+               goto fail_not_setup;
+
        rc = sfc_rx_qstart(sa, rx_queue_id);
        if (rc != 0)
                goto fail_rx_qstart;
@@ -1154,6 +1159,7 @@ sfc_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
        return 0;
 
 fail_rx_qstart:
+fail_not_setup:
 fail_not_started:
        sfc_adapter_unlock(sa);
        SFC_ASSERT(rc > 0);
index d8503e2..c6321d1 100644 (file)
@@ -673,6 +673,7 @@ sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index)
 
        rxq_info = &sa->rxq_info[sw_index];
        rxq = rxq_info->rxq;
+       SFC_ASSERT(rxq != NULL);
        SFC_ASSERT(rxq->state == SFC_RXQ_INITIALIZED);
 
        evq = rxq->evq;
@@ -763,7 +764,7 @@ sfc_rx_qstop(struct sfc_adapter *sa, unsigned int sw_index)
        rxq_info = &sa->rxq_info[sw_index];
        rxq = rxq_info->rxq;
 
-       if (rxq->state == SFC_RXQ_INITIALIZED)
+       if (rxq == NULL || rxq->state == SFC_RXQ_INITIALIZED)
                return;
        SFC_ASSERT(rxq->state & SFC_RXQ_STARTED);
 
@@ -1363,7 +1364,8 @@ sfc_rx_start(struct sfc_adapter *sa)
                goto fail_rss_config;
 
        for (sw_index = 0; sw_index < sa->rxq_count; ++sw_index) {
-               if ((!sa->rxq_info[sw_index].deferred_start ||
+               if (sa->rxq_info[sw_index].rxq != NULL &&
+                   (!sa->rxq_info[sw_index].deferred_start ||
                     sa->rxq_info[sw_index].deferred_started)) {
                        rc = sfc_rx_qstart(sa, sw_index);
                        if (rc != 0)