Discussion:
[dpdk-dev] [PATCH v1] net/i40e: fix memory leak for dev reset
Zhirun Yan
2018-12-10 09:16:00 UTC
Permalink
Before this patch port reset will call i40evf_dev_uninit() and
i40evf_dev_init(), i40evf_dev_uninit() will call
i40e_dev_free_queues to free queues. If set
dev->data->nb_tx_queues = 0 in i40evf_dev_close, the next time
config queue will never free these queues.

Fixex: 6b4537128394 ("i40e: free queue memory when closing")

Signed-off-by: Zhirun Yan <***@intel.com>
Signed-off-by: Haiyue Wang <***@intel.com>
---
drivers/net/i40e/i40e_rxtx.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index e1152ff0e..cc953ad58 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2753,7 +2753,6 @@ i40e_dev_free_queues(struct rte_eth_dev *dev)
i40e_dev_rx_queue_release(dev->data->rx_queues[i]);
dev->data->rx_queues[i] = NULL;
}
- dev->data->nb_rx_queues = 0;

for (i = 0; i < dev->data->nb_tx_queues; i++) {
if (!dev->data->tx_queues[i])
@@ -2761,7 +2760,6 @@ i40e_dev_free_queues(struct rte_eth_dev *dev)
i40e_dev_tx_queue_release(dev->data->tx_queues[i]);
dev->data->tx_queues[i] = NULL;
}
- dev->data->nb_tx_queues = 0;
}

#define I40E_FDIR_NUM_TX_DESC I40E_MIN_RING_DESC
--
2.17.1
Loading...