[16/17] net/bnxt: fix freeing of VNIC filters

Message ID 20220427145821.5987-17-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series bnxt PMD fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kalesh A P April 27, 2022, 2:58 p.m. UTC
  From: Somnath Kotur <somnath.kotur@broadcom.com>

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: f0f6b5e6cf9("net/bnxt: fix reusing L2 filter")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
---
 drivers/net/bnxt/bnxt_filter.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 1d08e03..b0c3bbd 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);