From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gw2-out.broadcom.com (mail-gw2-out.broadcom.com [216.31.210.63]) by dpdk.org (Postfix) with ESMTP id D118BAD90 for ; Wed, 15 Jun 2016 00:57:15 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.26,473,1459839600"; d="scan'208";a="97627322" Received: from mail-irv-18.broadcom.com ([10.15.198.37]) by mail-gw2-out.broadcom.com with ESMTP; 14 Jun 2016 16:17:21 -0700 Received: from mail-irva-12.broadcom.com (mail-irva-12.broadcom.com [10.11.16.101]) by mail-irv-18.broadcom.com (Postfix) with ESMTP id 37FB98203C; Tue, 14 Jun 2016 15:57:12 -0700 (PDT) Received: from DPDK-C1.broadcom.com (dhcp-10-13-115-104.irv.broadcom.com [10.13.115.104]) by mail-irva-12.broadcom.com (Postfix) with ESMTP id C4617A6294; Tue, 14 Jun 2016 15:57:06 -0700 (PDT) From: Stephen Hurd To: dev@dpdk.org, ajit.khaparde@broadcom.com, bruce.richardson@intel.com Date: Tue, 14 Jun 2016 15:56:06 -0700 Message-Id: <1465944971-113413-33-git-send-email-stephen.hurd@broadcom.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465944971-113413-1-git-send-email-stephen.hurd@broadcom.com> References: <1465250923-78695-1-git-send-email-stephen.hurd@broadcom.com> <1465944971-113413-1-git-send-email-stephen.hurd@broadcom.com> Subject: [dpdk-dev] [PATCH v5 33/38] bnxt: free memory in close operation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 22:57:16 -0000 From: Ajit Khaparde This patch adds code to free all resources except the one corresponding to HWRM, which are required to notify the HWRM that the driver is unloaded (these are freed in uninit()). Signed-off-by: Ajit Khaparde Signed-off-by: Stephen Hurd Reviewed-by: David Christensen -- v5: Reorder the footer. --- drivers/net/bnxt/bnxt_ethdev.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index d3a624f..4254531 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -62,14 +62,6 @@ static struct rte_pci_id bnxt_pci_id_map[] = { {.device_id = 0}, }; -static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev) -{ - struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; - - rte_free(eth_dev->data->mac_addrs); - bnxt_free_hwrm_resources(bp); -} - /***********************/ /* @@ -388,6 +380,16 @@ error: return rc; } +static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev) +{ + struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; + + bnxt_free_tx_mbufs(bp); + bnxt_free_rx_mbufs(bp); + bnxt_free_mem(bp); + rte_free(eth_dev->data->mac_addrs); +} + /* Unload the driver, release resources */ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) { -- 1.9.1