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 78A06A04FD; Tue, 14 Jan 2020 06:17:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 279A91C2F8; Tue, 14 Jan 2020 06:16:44 +0100 (CET) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id C379A1C2AD for ; Tue, 14 Jan 2020 06:16:33 +0100 (CET) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 348C530C55C; Mon, 13 Jan 2020 21:10:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 348C530C55C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578978622; bh=EGJ5s30g6MnYl2VCGaQfiiYRTFwIBHjsR227gM27G4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vdQWKgh9lOlcxMqulnCiUxLKguLJqdcYH7mnISU54za/1pjaNG/nCmOV0tI12vbEU 0ki3Ib7FXgKeKqd5InYXX7cBbu4KfJmgF7Isum4o8wXZMyewwEoKVV8vFxpHzy640y E6FOXvrlATg0/5ayTSPfzPqGDD31t2yv/+Q0vHm8= Received: from localhost.localdomain (unknown [10.230.30.124]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id AB5E614008D; Mon, 13 Jan 2020 21:16:32 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP Date: Mon, 13 Jan 2020 21:14:32 -0800 Message-Id: <20200114051435.46093-8-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122.2) In-Reply-To: <20200114051435.46093-1-ajit.khaparde@broadcom.com> References: <20200113050118.28719-1-kalesh-anakkur.purayil@broadcom.com> <20200114051435.46093-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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 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 436ecbb84..26614186f 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.21.0 (Apple Git-122.2)