Delete memzones for HW rings in i40e while freeing queues

Signed-off-by: Renata Saiakhova <renata.saiakh...@ekinops.com>
---
 drivers/net/i40e/i40e_fdir.c | 3 +++
 drivers/net/i40e/i40e_rxtx.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
index d59399afe..3a82cafac 100644
--- a/drivers/net/i40e/i40e_fdir.c
+++ b/drivers/net/i40e/i40e_fdir.c
@@ -269,6 +269,7 @@ i40e_fdir_teardown(struct i40e_pf *pf)
 {
        struct i40e_hw *hw = I40E_PF_TO_HW(pf);
        struct i40e_vsi *vsi;
+       struct rte_eth_dev *dev = pf->adapter->eth_dev;
 
        vsi = pf->fdir.fdir_vsi;
        if (!vsi)
@@ -280,8 +281,10 @@ i40e_fdir_teardown(struct i40e_pf *pf)
        if (err)
                PMD_DRV_LOG(DEBUG, "Failed to do FDIR RX switch off");
        i40e_dev_rx_queue_release(pf->fdir.rxq);
+       rte_eth_dma_zone_free(dev, "fdir_rx_ring", pf->fdir.rxq->queue_id);
        pf->fdir.rxq = NULL;
        i40e_dev_tx_queue_release(pf->fdir.txq);
+       rte_eth_dma_zone_free(dev, "fdir_tx_ring", pf->fdir.txq->queue_id);
        pf->fdir.txq = NULL;
        i40e_vsi_release(vsi);
        pf->fdir.fdir_vsi = NULL;
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 840b6f387..2d2efb71a 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -2928,6 +2928,7 @@ i40e_dev_free_queues(struct rte_eth_dev *dev)
                        continue;
                i40e_dev_rx_queue_release(dev->data->rx_queues[i]);
                dev->data->rx_queues[i] = NULL;
+               rte_eth_dma_zone_free(dev, "rx_ring", i);
        }
 
        for (i = 0; i < dev->data->nb_tx_queues; i++) {
@@ -2935,6 +2936,7 @@ i40e_dev_free_queues(struct rte_eth_dev *dev)
                        continue;
                i40e_dev_tx_queue_release(dev->data->tx_queues[i]);
                dev->data->tx_queues[i] = NULL;
+               rte_eth_dma_zone_free(dev, "tx_ring", i);
        }
 }
 
-- 
2.17.2

Reply via email to