From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 726BEA034C; Wed, 27 Apr 2022 17:00:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41A404284C; Wed, 27 Apr 2022 16:58:55 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by mails.dpdk.org (Postfix) with ESMTP id 88F2E4283D for ; Wed, 27 Apr 2022 16:58:52 +0200 (CEST) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 167A5C0000E8; Wed, 27 Apr 2022 07:58:50 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 167A5C0000E8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1651071532; bh=8yeYhb5xuxcBHp7oC2o+XBa9LC2xEbQG8fBa7zSFDsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XU9nXHJwkTrhtX9V4Z3f2YGgoEp6/xFGFavZvTTZDg0L5w2BykohYvLfaLMoUEiaG WM3M9NKpbqj9qZAgI8g2KfCcaU2bzLmxGimR1vt95bmtBVHhn+iT1G/41TMglkVFqz 7nu+irzxWasUIQFGOcxGNMkMtV9N4GyUcQeoVDm0= From: Kalesh A P To: dev@dpdk.org Cc: ajit.khaparde@broadcom.com Subject: [PATCH 16/17] net/bnxt: fix freeing of VNIC filters Date: Wed, 27 Apr 2022 20:28:20 +0530 Message-Id: <20220427145821.5987-17-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com> References: <20220427145821.5987-1-kalesh-anakkur.purayil@broadcom.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Somnath Kotur 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 Reviewed-by: Kalesh AP --- 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 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); -- 2.10.1