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 74EE4A04F0; Mon, 13 Jan 2020 05:20:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 163BD1D5C5; Mon, 13 Jan 2020 05:19:20 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 6D5971D59F for ; Mon, 13 Jan 2020 05:19:12 +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 327801BDCFB; Sun, 12 Jan 2020 20:19:10 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 327801BDCFB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578889152; bh=yxQJFrZ8/zYzFagIFQv8UJcneWMBQOuo7SoQHfRxO9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLISe5Wcr3ufgBZ5UBVRqoc+dQ7ef+96mcWp+cxcd5Ze8CAMFwV1O2/N6GrJ5PDK/ zdKJOZZtwsDVIWtwwA37RVxwdhbsw3s/eHbiW0Y4IK1c8uS5CrxwhjTNioYXZHB4b+ FzRLGZvZbhTwLKCxV55gsxkDJgDaAfKr1vpR1oU4= From: Kalesh A P To: dev@dpdk.org, ajit.khaparde@broadcom.com Cc: ferruh.yigit@intel.com Date: Mon, 13 Jan 2020 10:06:06 +0530 Message-Id: <20200113043609.27363-8-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200113043609.27363-1-kalesh-anakkur.purayil@broadcom.com> References: <20200113043609.27363-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 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: 4e40794a18a7 ("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