From 2df7dfffe3dc5d6b65c77a7fbe155e38a9e3dc24 Mon Sep 17 00:00:00 2001 From: Somnath Kotur Date: Wed, 27 Apr 2022 20:28:20 +0530 Subject: [PATCH] net/bnxt: fix freeing VNIC filters In bnxt_free_all_filters(), all the filters attached to a vnic are removed. But each of these filters hold a backreference ptr to the vnic and they need to be reset to NULL now. Otherwise, during a normal testpmd quit, as part of dev_close_op(), first bnxt_free_all_filters() is invoked in dev_stop, followed by bnxt_free_filter_mem() from bnxt_uninit_resources(), which finds a filter with a vnic back reference ptr and now bnxt_hwrm_clean_up_l2_filter() also tries to remove the filter from the vnic's filter list which was already done as part of bnxt_free_all_filters(). Fixes: f0f6b5e6cf94 ("net/bnxt: fix reusing L2 filter") Cc: stable@dpdk.org Signed-off-by: Somnath Kotur Reviewed-by: Kalesh AP Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_filter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c index 1d08e03b2f..b0c3bbd1b2 100644 --- a/drivers/net/bnxt/bnxt_filter.c +++ b/drivers/net/bnxt/bnxt_filter.c @@ -99,6 +99,8 @@ void bnxt_free_all_filters(struct bnxt *bp) bnxt_filter_info, next); STAILQ_INSERT_TAIL(&bp->free_filter_list, filter, next); + if (filter->vnic) + filter->vnic = NULL; filter = temp_filter; } STAILQ_INIT(&vnic->filter); -- 2.20.1