From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 822E8A0352; Thu, 16 Jan 2020 13:48:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D13D31D455; Thu, 16 Jan 2020 13:47:59 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id 1614B1D40F for ; Thu, 16 Jan 2020 13:47:49 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 8A13228F541; Thu, 16 Jan 2020 04:47:48 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 8A13228F541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1579178868; bh=5amfrjVPyPulkOjlPIzQ0A1B1kXZZxngKeu15yxnJfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p7OF9I6fDkVx/qCjCFYUUVYTjsQTm4zIbqKqr3TCiKgjVQ3R5ayuMM3bp5A/K7wxg oQrof0OLmQ/UNcR1I4ozTLKbTMdHAxOZnnxnakb4u79UqE5FreuXs81tfJWRHEy7vy WOiMbGWEWbi3dl2lmMhsg+GZs6wOdX+e5DIO7Qcs= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com Date: Thu, 16 Jan 2020 18:34:52 +0530 Message-Id: <20200116130455.30193-8-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200116130455.30193-1-kalesh-anakkur.purayil@broadcom.com> References: <20200116130455.30193-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH V4 07/10] net/bnxt: fix a memory leak in port stop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 The memory for mark table is allocated during port start. But the allocated memory is freed only during port close or driver unload which in turn causes a memory leakage on each port start/stop. Fixed it by moving the memory free to port stop. Fixes: a968a9f5456d ("net/bnxt: add support for flow mark action") Signed-off-by: Kalesh AP Reviewed-by: Ajit Kumar Khaparde --- drivers/net/bnxt/bnxt_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 436ecbb..2661418 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -970,7 +970,10 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev) bnxt_int_handler(eth_dev); bnxt_shutdown_nic(bp); bnxt_hwrm_if_change(bp, 0); - memset(bp->mark_table, 0, BNXT_MARK_TABLE_SZ); + + rte_free(bp->mark_table); + bp->mark_table = NULL; + bp->flags &= ~BNXT_FLAG_RX_VECTOR_PKT_MODE; bp->dev_stopped = 1; bp->rx_cosq_cnt = 0; @@ -992,9 +995,6 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev) bp->grp_info = NULL; } - rte_free(bp->mark_table); - bp->mark_table = NULL; - bnxt_dev_uninit(eth_dev); } -- 2.10.1