From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 7E7705F19 for ; Mon, 30 Jul 2018 18:22:20 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkAq3-00009D-Rm; Mon, 30 Jul 2018 16:16:03 +0000 From: Christian Ehrhardt To: Ajit Khaparde Cc: dpdk stable Date: Mon, 30 Jul 2018 18:11:47 +0200 Message-Id: <20180730161342.16566-62-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'net/bnxt: fix close operation' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:22:20 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From ed210f058c67f24d58f0d22ff839d33af8dfe218 Mon Sep 17 00:00:00 2001 From: Ajit Khaparde Date: Thu, 28 Jun 2018 13:15:31 -0700 Subject: [PATCH] net/bnxt: fix close operation [ upstream commit 3c2e87c10b6f2c249a26e419b565bff5589b4637 ] We are not cleaning up all the memory and also not unregistering the driver during device close operation. This patch fixes the issue. Fixes: 893074951314 ("net/bnxt: free memory in close operation") Signed-off-by: Ajit Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 6e56bfd36..ee5b86bfe 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -152,6 +152,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = { static int bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask); static void bnxt_print_link_info(struct rte_eth_dev *eth_dev); static int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu); +static int bnxt_dev_uninit(struct rte_eth_dev *eth_dev); /***********************/ @@ -664,6 +665,8 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev) rte_free(bp->grp_info); bp->grp_info = NULL; } + + bnxt_dev_uninit(eth_dev); } static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev, @@ -3112,7 +3115,6 @@ init_err_disable: return rc; } -static int bnxt_dev_uninit(struct rte_eth_dev *eth_dev); #define ALLOW_FUNC(x) \ { \ @@ -3404,13 +3406,15 @@ error: } static int -bnxt_dev_uninit(struct rte_eth_dev *eth_dev) { +bnxt_dev_uninit(struct rte_eth_dev *eth_dev) +{ struct bnxt *bp = eth_dev->data->dev_private; int rc; if (rte_eal_process_type() != RTE_PROC_PRIMARY) return -EPERM; + PMD_DRV_LOG(DEBUG, "Calling Device uninit\n"); bnxt_disable_int(bp); bnxt_free_int(bp); bnxt_free_mem(bp); @@ -3424,8 +3428,17 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev) { } rc = bnxt_hwrm_func_driver_unregister(bp, 0); bnxt_free_hwrm_resources(bp); - rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone); - rte_memzone_free((const struct rte_memzone *)bp->rx_mem_zone); + + if (bp->tx_mem_zone) { + rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone); + bp->tx_mem_zone = NULL; + } + + if (bp->rx_mem_zone) { + rte_memzone_free((const struct rte_memzone *)bp->rx_mem_zone); + bp->rx_mem_zone = NULL; + } + if (bp->dev_stopped == 0) bnxt_dev_close_op(eth_dev); if (bp->pf.vf_info) -- 2.17.1