From c942a182921da7d36d217c837e3288fefcf7f70b Mon Sep 17 00:00:00 2001 From: Ian Dolzhansky Date: Fri, 31 Aug 2018 17:09:37 +0100 Subject: [PATCH] net/failsafe: support runtime Rx queues setup Signed-off-by: Ian Dolzhansky Signed-off-by: Andrew Rybchenko --- doc/guides/nics/features/failsafe.ini | 1 + doc/guides/rel_notes/release_18_11.rst | 1 + drivers/net/failsafe/failsafe_intr.c | 2 +- drivers/net/failsafe/failsafe_ops.c | 8 ++++++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/guides/nics/features/failsafe.ini b/doc/guides/nics/features/failsafe.ini index 74eae4a620..8bb2cac4ca 100644 --- a/doc/guides/nics/features/failsafe.ini +++ b/doc/guides/nics/features/failsafe.ini @@ -8,6 +8,7 @@ Link status = Y Link status event = Y Rx interrupt = Y Queue start/stop = Y +Runtime Rx queue setup = Y MTU update = Y Jumbo frame = Y Promiscuous mode = Y diff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst index d4ef2efc6b..f1b78cd26b 100644 --- a/doc/guides/rel_notes/release_18_11.rst +++ b/doc/guides/rel_notes/release_18_11.rst @@ -78,6 +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. * **Added ability to switch queue deferred start flag on testpmd app.** diff --git a/drivers/net/failsafe/failsafe_intr.c b/drivers/net/failsafe/failsafe_intr.c index fc6ec37fcd..1c2cb71c41 100644 --- a/drivers/net/failsafe/failsafe_intr.c +++ b/drivers/net/failsafe/failsafe_intr.c @@ -372,7 +372,7 @@ void failsafe_rx_intr_uninstall_subdevice(struct sub_device *sdev) for (qid = 0; qid < ETH(sdev)->data->nb_rx_queues; qid++) { if (qid < fsdev->data->nb_rx_queues) { fsrxq = fsdev->data->rx_queues[qid]; - if (fsrxq->enable_events) + if (fsrxq != NULL && fsrxq->enable_events) rte_eth_dev_rx_intr_disable(PORT_ID(sdev), qid); } diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 84f4b7ab8b..a6774f27f1 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -86,6 +86,8 @@ static struct rte_eth_dev_info default_infos = { ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP, + .dev_capa = + RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP, }; static int @@ -177,7 +179,7 @@ fs_set_queues_state_start(struct rte_eth_dev *dev) for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = dev->data->rx_queues[i]; - if (!rxq->info.conf.rx_deferred_start) + if (rxq != NULL && !rxq->info.conf.rx_deferred_start) dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED; } @@ -238,7 +240,9 @@ fs_set_queues_state_stop(struct rte_eth_dev *dev) uint16_t i; for (i = 0; i < dev->data->nb_rx_queues; i++) - dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; + if (dev->data->rx_queues[i] != NULL) + 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; } -- 2.20.1