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 61118A052F; Wed, 29 Jan 2020 13:28:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D0831BFC3; Wed, 29 Jan 2020 13:28:13 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id BEAFB1BFC0; Wed, 29 Jan 2020 13:28:11 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00TCG4cY032293; Wed, 29 Jan 2020 04:28:11 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0818; bh=B4+ra9nP9b0XiNo9fDS3rRaDlFzzgp7dYA+RkOwruK0=; b=Wl//azXq0s6Ed2ZZ/WAWUiakQE0kP1PYZ/+EM0/HbHkeRmdAtfxEAC9kPf13XjLe7TOr NuUThln3ZySyqIMzodBn47A9ZQBK6WyQjyZd3+70PQ+Yry0COYPEdcvN+kt72FMOEnMR 0uOMD6oWf+vxieQzj9CCygShbgjQY1MhYk56MA/byl+xlZNQULOuEKdhHVd2YTP0zKUo Xlwj6/SrVYuGuIiPuWRq15/89vP7q2fSenAujhONb0mxiyyTNu+OZ+fkpjXSJc94aimR XcoprG3N1Y22r8p3h5QoYu3ybPyvZIDh0WVvo18shuv68RIKaGfg3G4DGwkpWeGF6tLj AQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2xt6bt0fe3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 29 Jan 2020 04:28:10 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 29 Jan 2020 04:28:09 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.175) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 29 Jan 2020 04:28:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F1Ii/ndtnnu1xkYMSKG6PSvoel5AFDvMAfhqQ+8TTQT4u2MIN2UPh5b7fhqkHpnMbV2yzkUGpfrhdW7NMALF2fVZwOf6Atls9tw9MhbsfU0DEgxl+5lwv+BQjdyY1iw5FhVr+nWjBp/P2V4kiV4wDmrhR/P1tNNEJxks4wH6fJ3UU+sISFft8gfuKpaBrpOxxpBrkr1KYmQc6e/eMqulE9BgMU+C4gdzP2zkQKFhfvCALLxMEBBSKIUAkxeTrO4HM9vYrj0c/e0nm1EP5qc7MvtItS0BWR1SS/TfnVhNZXu3rFfprvIAmWvzU4R7vgsFbfiBv9u6EyVP5BF2FdCIIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B4+ra9nP9b0XiNo9fDS3rRaDlFzzgp7dYA+RkOwruK0=; b=Wt4xgKzCLdp069rFxCJp1tt126bzbwr6gEAY01zXiEFls9nDSHw2bZu/P+f6iPb4saMVyTXxmRq9wISQLp2DKOA9MOQu4wGTaQOGzzBetd/49YmUaNT6sDnypuSwqI5TkrzkBlGYaoCvnPD/6SmGHng9/d1fabq1F4nM14J0EvCTF/vb/a17VRRkDZGnGQ64l2NM8Kjvu7cSOpKMykzVPoKTty1wRDRZFT4CUKxs+8uZbQY26Ru3Hr+Bak9va9jnw5VgXJhdg4J9Rlg/yrO4AdG8BrDTwRQO46YS6lysFRTzERLBAVKg0mXvvuWdPaXfRfdWrASyNQRhUmizT5sv5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B4+ra9nP9b0XiNo9fDS3rRaDlFzzgp7dYA+RkOwruK0=; b=bES+6H4fAtGmmGJnwrJt02WeA75jgzwCQlWX4YTDibRkfssthM4+1BQsI2p+hRGMkorc8j+CRtPxVVjlQB5vJZHm+IFZUgY7xFIyN1+ydEk61j8WXuiynQNshL68vLUFVNVohlU3o/dtZtg8/keBT7oxpWANy19Fjh45OwChF9U= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.20.19) by MN2PR18MB2477.namprd18.prod.outlook.com (20.179.81.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.22; Wed, 29 Jan 2020 12:28:08 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::6de0:6ead:9fc:5beb]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::6de0:6ead:9fc:5beb%3]) with mapi id 15.20.2665.027; Wed, 29 Jan 2020 12:28:08 +0000 Received: from outlook.office365.com (115.113.156.2) by BMXPR01CA0026.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.22 via Frontend Transport; Wed, 29 Jan 2020 12:28:07 +0000 From: Harman Kalra To: Sunil Kumar Kori CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/octeontx: fix memory leak of MAC address table Thread-Index: AQHV1oTv7EOffaM4skmaBjmzo4KrxKgBkgaA Date: Wed, 29 Jan 2020 12:28:08 +0000 Message-ID: <20200129122754.GA173086@outlook.office365.com> References: <20200129091704.18217-1-skori@marvell.com> In-Reply-To: <20200129091704.18217-1-skori@marvell.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0026.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::12) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e70b1f4c-ae0c-491c-e303-08d7a4b6b287 x-ms-traffictypediagnostic: MN2PR18MB2477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 02973C87BC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(366004)(376002)(136003)(39860400002)(396003)(189003)(199004)(16526019)(8676002)(186003)(54906003)(316002)(956004)(6862004)(9686003)(55016002)(450100002)(4326008)(2906002)(66946007)(64756008)(66476007)(6506007)(66556008)(33656002)(66446008)(8936002)(26005)(7696005)(55236004)(478600001)(6636002)(5660300002)(1076003)(81166006)(52116002)(71200400001)(86362001)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2477; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LYvxhDQxovT/2Oo/b2cn7F/qSF5N/S7LI0nGGTaDIS/8JhCATdPIW/sj9s5/GDkVfjY211PEplrALshvYxX8yvZ6R2vge17uQYmoaz4Gpudhhmnt0291kUdab0sDD2TAM7wAyLSkojAVeZDRr8wl8M0HXhgz8MakTirl389LHaykwJE3AjHp92UL6yejeaqYE83eq3mfEEs4nwnfCSr/lZ3eF6T3+c2egAKk/AY2eADeiFfjOJP7LNXQkqMXk/7jpkOgBaqfwjqpbYaN27pwTqY++ptspGbeeUAT5aJSqfAX/TZQQEkYrbLo/SM+tP0uaLT3J13Y98al20S9Wcd5Oq6uveyMmAllQ9nwgy4d9ZcCTcOSOl5cDpThk4EgsCFJcmqcfKnmB25iy4MIVQbQdNpkYdus2KsAFgkdxHyTTnjonlM64WRhMU3jRdNJREqM x-ms-exchange-antispam-messagedata: f5yMcnvwqLC4vNjALVsfNCX2QwGzojPhfybZSJ38tjaTPHYqhVW7uBkU4EToNlVgMZnnpd5KSq0xjRGcP6v+igJ9gxnYoaaStAs6zYXZTsS/ANSN2zsOSN7r1HVyjD2vATQhm3530BehXKjRsX/hzQ== Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e70b1f4c-ae0c-491c-e303-08d7a4b6b287 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jan 2020 12:28:08.3566 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jH8ChltEF3iSmk7/Xt2PuOGBa+UFUFTevnhjGFByBcUxD0ryd8/CzwsDffGNrQYcPhMc1b+Dpy1dJM+aQG/Z3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2477 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-29_02:2020-01-28, 2020-01-29 signatures=0 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 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. >=20 > Patch fixes memory required memory for both the cases as mentioned. >=20 > Fixes: f18b146c498d ("net/octeontx: create ethdev ports") >=20 > Signed-off-by: Sunil Kumar Kori Acked-by: Harman Kalra > --- > drivers/net/octeontx/octeontx_ethdev.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeont= x/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); > } > =20 > + /* Free MAC address table */ > + rte_free(dev->data->mac_addrs); > + dev->data->mac_addrs =3D NULL; > + > dev->tx_pkt_burst =3D NULL; > dev->rx_pkt_burst =3D NULL; > } > @@ -1143,7 +1147,7 @@ octeontx_create(struct rte_vdev_device *dev, int po= rt, uint8_t evdev, > octeontx_log_err("eth_dev->port_id (%d) is diff to orig (%d)", > data->port_id, nic->port_id); > res =3D -EINVAL; > - goto err; > + goto free_mac_addrs; > } > =20 > /* Update port_id mac to eth_dev */ > @@ -1162,6 +1166,8 @@ octeontx_create(struct rte_vdev_device *dev, int po= rt, uint8_t evdev, > rte_eth_dev_probing_finish(eth_dev); > return data->port_id; > =20 > +free_mac_addrs: > + rte_free(data->mac_addrs); > err: > if (nic) > octeontx_port_close(nic); > --=20 > 2.17.1 >=20