net/failsafe: support runtime Tx queues setup
authorIan Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Fri, 31 Aug 2018 16:09:38 +0000 (17:09 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 27 Sep 2018 23:41:02 +0000 (01:41 +0200)
Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
doc/guides/nics/features/failsafe.ini
doc/guides/rel_notes/release_18_11.rst
drivers/net/failsafe/failsafe_ops.c

index 8bb2cac..e3c4c08 100644 (file)
@@ -9,6 +9,7 @@ Link status event    = Y
 Rx interrupt         = Y
 Queue start/stop     = Y
 Runtime Rx queue setup = Y
+Runtime Tx queue setup = Y
 MTU update           = Y
 Jumbo frame          = Y
 Promiscuous mode     = Y
index f1b78cd..1581c2b 100644 (file)
@@ -78,7 +78,7 @@ New Features
 
   * Support for Rx and Tx queues start and stop.
   * Support for Rx and Tx queues deferred start.
-  * Support for runtime Rx queues setup.
+  * Support for runtime Rx and Tx queues setup.
 
 * **Added ability to switch queue deferred start flag on testpmd app.**
 
index a6774f2..7fadf06 100644 (file)
@@ -87,7 +87,8 @@ static struct rte_eth_dev_info default_infos = {
                        ETH_RSS_UDP |
                        ETH_RSS_TCP,
        .dev_capa =
-               RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP,
+               RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP |
+               RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP,
 };
 
 static int
@@ -185,7 +186,7 @@ fs_set_queues_state_start(struct rte_eth_dev *dev)
        }
        for (i = 0; i < dev->data->nb_tx_queues; i++) {
                txq = dev->data->tx_queues[i];
-               if (!txq->info.conf.tx_deferred_start)
+               if (txq != NULL && !txq->info.conf.tx_deferred_start)
                        dev->data->tx_queue_state[i] =
                                                RTE_ETH_QUEUE_STATE_STARTED;
        }
@@ -244,7 +245,9 @@ fs_set_queues_state_stop(struct rte_eth_dev *dev)
                        dev->data->rx_queue_state[i] =
                                                RTE_ETH_QUEUE_STATE_STOPPED;
        for (i = 0; i < dev->data->nb_tx_queues; i++)
-               dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
+               if (dev->data->tx_queues[i] != NULL)
+                       dev->data->tx_queue_state[i] =
+                                               RTE_ETH_QUEUE_STATE_STOPPED;
 }
 
 static void