From: Jan Blunck Date: Thu, 24 Nov 2016 11:26:46 +0000 (+0100) Subject: ethdev: free queue array after releasing all queues X-Git-Tag: spdx-start~5270 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c3d3ba989232c97ab2f7e3baa147d3bdaa9486a0;p=dpdk.git ethdev: free queue array after releasing all queues If all queues are released lets also free up the dev->data->rx/tx_queues to be able to properly reinitialize. Signed-off-by: Jan Blunck --- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 7003ac3c0e..418434c7ef 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -529,6 +529,9 @@ rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) for (i = nb_queues; i < old_nb_queues; i++) (*dev->dev_ops->rx_queue_release)(rxq[i]); + + rte_free(dev->data->rx_queues); + dev->data->rx_queues = NULL; } dev->data->nb_rx_queues = nb_queues; return 0; @@ -680,6 +683,9 @@ rte_eth_dev_tx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues) for (i = nb_queues; i < old_nb_queues; i++) (*dev->dev_ops->tx_queue_release)(txq[i]); + + rte_free(dev->data->tx_queues); + dev->data->tx_queues = NULL; } dev->data->nb_tx_queues = nb_queues; return 0;