net/bnxt: fix freeing VNIC filters
authorSomnath Kotur <somnath.kotur@broadcom.com>
Wed, 27 Apr 2022 14:58:20 +0000 (20:28 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 10 May 2022 05:14:20 +0000 (07:14 +0200)
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 <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_filter.c

index 1d08e03..b0c3bbd 100644 (file)
@@ -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);