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 D076EA0530; Mon, 3 Feb 2020 10:54:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4E51E1BFE2; Mon, 3 Feb 2020 10:54:21 +0100 (CET) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by dpdk.org (Postfix) with ESMTP id D65B01BFE0; Mon, 3 Feb 2020 10:54:19 +0100 (CET) Received: by mail-io1-f66.google.com with SMTP id k24so16022513ioc.4; Mon, 03 Feb 2020 01:54:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6SZGS3q62Q/lihWCnQJTnfbLdeuuz1UWyD+xCyWsNOU=; b=PZ9rnp7VYKVjp/xslA172iSDBwkjR5rUmmhnJ6cAPW64sNY848/3gA5YpI6Wn66Jgu w876SS8hJSuaZxMDljYIWDWW/+RaecA0vZm9K52CWyIxESUS319gWDc2KBimezTb3p5o tGFQO7PRLYfQ5cUEoqhU6TAg4pNmOWnz6mx4KMSzBbExO4X8cvtxDAAC+u9nLWhrqX8r pdr2nwkrL9HnTgIp7z0oiJDD61sey1bamW98q9fsrU+ameNqHJ9qaOpoxh16k662cKMC k6uchQRQmsSIjxqgC+OoKThm1a946nrNRrtMsz7lObCM899xfLi13jiVmfGFKJvafGii /VEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6SZGS3q62Q/lihWCnQJTnfbLdeuuz1UWyD+xCyWsNOU=; b=VPL2BmsS7MVAKRgFFvqRKzHL1s4T/3qyMuHjDr8/mG7dRHLfC9v6A+oVbnE5/ExKPV w/TQWh2HE34FXX/ATDyB6y/nsGUkX/GVZiXgnvplEJMFVJigpbkjUiAUcV3ez2LaBpv7 gz4TzEVhaOcnai4oMn3U1GrrNn0p+v90R+zj5Prh/0Fq9P6f4mSOH+gbcqmbPvqNp20n Z8Ewjl7CHhPVI2OSR2Mergzt4XFxywTA1uvTIXJZv4NVkuDTY69Wa2RzqVmZ1h6BBl2g pV08RhDZDeeQGSMKdH05Opj9UDCKwZxymrR8MqQm+sR4CgE+m3QQopcSv0j8YAXfCz/9 ENTA== X-Gm-Message-State: APjAAAU12/vBHz8GZQAPzt2/0Uz9hgNfhHtCUpGvMhMvByiyO/Z4FGwC EQDZRA0e0bN6a/4+aunvDFAFISjPzIW3syiPjMI= X-Google-Smtp-Source: APXvYqwRrehyOyefv2qIG3yMeYwBbk2x2mNA3ccUnaPKRH2uOqkj1Ss/Af/pO+BrFMVkwZ8HUyy73Jml3g3dC6z28/I= X-Received: by 2002:a6b:39c4:: with SMTP id g187mr18289167ioa.271.1580723659107; Mon, 03 Feb 2020 01:54:19 -0800 (PST) MIME-Version: 1.0 References: <20200129091704.18217-1-skori@marvell.com> <20200129122754.GA173086@outlook.office365.com> In-Reply-To: <20200129122754.GA173086@outlook.office365.com> From: Jerin Jacob Date: Mon, 3 Feb 2020 15:24:02 +0530 Message-ID: To: Harman Kalra Cc: Sunil Kumar Kori , "dev@dpdk.org" , "stable@dpdk.org" Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] net/octeontx: fix memory leak of MAC address table 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" On Wed, Jan 29, 2020 at 5:58 PM Harman Kalra wrote: > > On Wed, Jan 29, 2020 at 02:47:04PM +0530, Sunil Kumar Kori wrote: > > MAC address table is allocated during octeontx device create and > > same is used to maintain list of MAC address associated to port. > > This table is not getting freed niether in case of error nor during > > graceful shutdown of port. > > > > Patch fixes memory required memory for both the cases as mentioned. > > > > Fixes: f18b146c498d ("net/octeontx: create ethdev ports") Cc: stable@dpdk.org > > > > Signed-off-by: Sunil Kumar Kori > > Acked-by: Harman Kalra Applied to dpdk-next-net-mrvl/master. Thanks > > > --- > > drivers/net/octeontx/octeontx_ethdev.c | 8 +++++++- > > 1 file changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c > > index e23162d8a..40d9d67da 100644 > > --- a/drivers/net/octeontx/octeontx_ethdev.c > > +++ b/drivers/net/octeontx/octeontx_ethdev.c > > @@ -351,6 +351,10 @@ octeontx_dev_close(struct rte_eth_dev *dev) > > rte_free(txq); > > } > > > > + /* Free MAC address table */ > > + rte_free(dev->data->mac_addrs); > > + dev->data->mac_addrs = NULL; > > + > > dev->tx_pkt_burst = NULL; > > dev->rx_pkt_burst = NULL; > > } > > @@ -1143,7 +1147,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, > > octeontx_log_err("eth_dev->port_id (%d) is diff to orig (%d)", > > data->port_id, nic->port_id); > > res = -EINVAL; > > - goto err; > > + goto free_mac_addrs; > > } > > > > /* Update port_id mac to eth_dev */ > > @@ -1162,6 +1166,8 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, > > rte_eth_dev_probing_finish(eth_dev); > > return data->port_id; > > > > +free_mac_addrs: > > + rte_free(data->mac_addrs); > > err: > > if (nic) > > octeontx_port_close(nic); > > -- > > 2.17.1 > >