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 165F5A0524; Mon, 31 May 2021 09:06:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14DFD410FD; Mon, 31 May 2021 09:05:31 +0200 (CEST) Received: from relay.smtp-ext.broadcom.com (lpdvacalvio01.broadcom.com [192.19.229.182]) by mails.dpdk.org (Postfix) with ESMTP id 85C5B410ED for ; Mon, 31 May 2021 09:05:28 +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 D5C3824329; Mon, 31 May 2021 00:05:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com D5C3824329 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1622444727; bh=FxVMqz0eg9WeA/3MnHpd7Pc7McmKUhz3Bxpsrc8PiQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WFJI+k/g6AuXkhBmth433WHW+Iqs1J0ZniidEiPfGKMrPVietco/NdnTpPrzm8pEH q3YojeYrFrokcemuEYUC34LCnAKPCFuVU94D8lpqVL8TEISTOhKPnrpQAkfCrB+4n6 XOIF362QtlbSAPbkSx3N4E0m2jZfhhqY6J8fske0= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Mon, 31 May 2021 12:56:41 +0530 Message-Id: <20210531072644.24656-7-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20210531072644.24656-1-kalesh-anakkur.purayil@broadcom.com> References: <20210531072644.24656-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 6/9] net/bnxt: use common function to destroy VNIC resource 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 Sender: "dev" From: Kalesh AP Use the function bnxt_vnic_destroy() to destroy VNIC resources and thereby eliminate few duplicate code. Fixes: 8d0a244b40b2 ("net/bnxt: cleanup VNIC after flow validate") Fixes: 49d0709b257f ("net/bnxt: delete and flush L2 filters cleanly") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_flow.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index ed201a3..59489b5 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -1577,10 +1577,7 @@ bnxt_flow_validate(struct rte_eth_dev *dev, vnic = find_matching_vnic(bp, filter); if (vnic) { if (STAILQ_EMPTY(&vnic->filter)) { - rte_free(vnic->fw_grp_ids); - bnxt_hwrm_vnic_ctx_free(bp, vnic); - bnxt_hwrm_vnic_free(bp, vnic); - vnic->rx_queue_cnt = 0; + bnxt_vnic_cleanup(bp, vnic); bp->nr_vnics--; PMD_DRV_LOG(DEBUG, "Free VNIC\n"); } @@ -2045,12 +2042,7 @@ _bnxt_flow_destroy(struct bnxt *bp, */ if (vnic && !vnic->func_default && STAILQ_EMPTY(&vnic->flow_list)) { - rte_free(vnic->fw_grp_ids); - if (vnic->rx_queue_cnt > 1) - bnxt_hwrm_vnic_ctx_free(bp, vnic); - - bnxt_hwrm_vnic_free(bp, vnic); - vnic->rx_queue_cnt = 0; + bnxt_vnic_cleanup(bp, vnic); bp->nr_vnics--; } } else { -- 2.10.1