net/i40e: fix dev startup resource release problem

Message ID 20210821094435.6336-1-chenqiming_huawei@163.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: fix dev startup resource release problem |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing fail Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues

Commit Message

Qiming Chen Aug. 21, 2021, 9:44 a.m. UTC
  From: Qiming Chen <chenqiming_huawei@163.com>

In the eth_i40e_dev_init function, the tunnel and ehtertype hash table
resource release interface should be rte_hash_free instead of rte_free,
and the previously registered interrupt handling function also needs to
be removed from the interrupt list. The patch is amended to use the
correct interface to release the hash table resource and release the
interrupt handling function at the same time.

Fixes: 425c3325f0b0 ("net/i40e: store tunnel filter")
Fixes: 5c53c82c8174 ("net/i40e: store flow director filter")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
 drivers/net/i40e/i40e_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Comments

Qi Zhang Sept. 13, 2021, 2:44 a.m. UTC | #1
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of
> chenqiming_huawei@163.com
> Sent: Saturday, August 21, 2021 5:45 PM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Qiming Chen
> <chenqiming_huawei@163.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] net/i40e: fix dev startup resource release problem
> 
> From: Qiming Chen <chenqiming_huawei@163.com>
> 
> In the eth_i40e_dev_init function, the tunnel and ehtertype hash table
> resource release interface should be rte_hash_free instead of rte_free, and the
> previously registered interrupt handling function also needs to be removed
> from the interrupt list. The patch is amended to use the correct interface to
> release the hash table resource and release the interrupt handling function at
> the same time.
> 
> Fixes: 425c3325f0b0 ("net/i40e: store tunnel filter")
> Fixes: 5c53c82c8174 ("net/i40e: store flow director filter")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7b230e2ed1..7a2a8281d2 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1760,12 +1760,14 @@  eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused)
 	return 0;
 
 err_init_fdir_filter_list:
-	rte_free(pf->tunnel.hash_table);
+	rte_hash_free(pf->tunnel.hash_table);
 	rte_free(pf->tunnel.hash_map);
 err_init_tunnel_filter_list:
-	rte_free(pf->ethertype.hash_table);
+	rte_hash_free(pf->ethertype.hash_table);
 	rte_free(pf->ethertype.hash_map);
 err_init_ethtype_filter_list:
+	rte_intr_callback_unregister(intr_handle,
+		i40e_dev_interrupt_handler, dev);
 	rte_free(dev->data->mac_addrs);
 	dev->data->mac_addrs = NULL;
 err_mac_alloc: