net/i40e: fix memzone leak on queue re-configure
authorYunjian Wang <wangyunjian@huawei.com>
Wed, 22 Sep 2021 13:29:36 +0000 (21:29 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 7 Oct 2021 11:38:16 +0000 (13:38 +0200)
commite3188d5f9925d378be535bb48ccb5f26834605aa
treead681f864506d3a45bc95ad102a3aeacb65492c4
parentd3778bf39a1dd36181b11459ad3936501ca17f4d
net/i40e: fix memzone leak on queue re-configure

Normally when closing the device the queue memzone should be
freed. But the memzone will be not freed, when device setup
ops like:

rte_eth_bond_slave_remove
-->__eth_bond_slave_remove_lock_free
---->slave_remove
------>rte_eth_dev_internal_reset
-------->rte_eth_dev_rx_queue_config
---------->eth_dev_rx_queue_config
------------>i40e_dev_rx_queue_release
rte_eth_dev_close
-->i40e_dev_close
---->i40e_dev_free_queues
------>i40e_dev_rx_queue_release
      (not been called due to nb_rx_queues and nb_tx_queues are 0)

And when queue number is changed to small size, the BIG memzone
queue index will be lost. This will lead to a memory leak. So we
should release the memzone when releasing queues.

Fixes: 460d1679586e ("drivers/net: delete HW rings while freeing queues")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
drivers/net/i40e/i40e_fdir.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/i40e/i40e_rxtx.h