From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B3C8DA0C41; Wed, 15 Sep 2021 09:18:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39ED74003F; Wed, 15 Sep 2021 09:18:43 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 72D584003C; Wed, 15 Sep 2021 09:18:40 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10107"; a="222300561" X-IronPort-AV: E=Sophos;i="5.85,294,1624345200"; d="scan'208";a="222300561" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2021 00:18:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,294,1624345200"; d="scan'208";a="700075858" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga005.fm.intel.com with ESMTP; 15 Sep 2021 00:18:38 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 15 Sep 2021 00:18:38 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 15 Sep 2021 00:18:38 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 15 Sep 2021 00:18:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=idSEyzoGRvL2cA5k05Cm6YaClWTcoLVpQZps/OjcEOu5U1MG0XNzqUGQBzg5QjPHisNxr0M70jGUNXhWDV3HvXWicIa72VJlWENLZOGWrPMofKuwRmhxaZZwrRj3QkpwUMphHUHkNWklVyQepPIKljBE0MtzKoCLJykzRM5QVMVGcqhCJfhTNPHHo6ZvzpEWOyObptbdL2EM+7DfApJGKqsiiqtVAB9gufWgnkk1krv3ZlOEZfU0hwkbbjAdJlxAEuxQO6WOhmjdX7NBlrQDBOU2uNHwIzB8YLvTEOtAFQtKmsyLjuVArs9Iwj4qmnBFSnM8Tn9rZvNf2V03c3qOIw== 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; bh=4dT1JIVolbBS8LGNJIzjsJLUpaQS82VK1k8F30LLUi4=; b=bW+I17BClt2w1QUjl1iI8v+chY95JKk2KilWsLS3xNjty0O2xji+Hh8ISkp5ksop98Drr92QCgt4zDs0Z9l8EDUETAQYIu15THC9rAEwKt8SQYBEAC7wobfnIFSx+Be8eDvonkvaf7vm5I7hJzhkob3Nj/9rxkpX18zQxd9k5f1RrP2XbjSp49nh9KbKCZ3si7MspVQmopGQq8Kt0vLeKA6Fhm+6ATpTo9eZminN0EmNvKbJRHf0kYRdhWdroPJ2W3LyNsFNcaCkhvkwMqmARRq4TuMvjcc7sBdzSw/cEbCGzILYCJtIARMCrgR49pIGFctjCRDucbeXibpUv4hFCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4dT1JIVolbBS8LGNJIzjsJLUpaQS82VK1k8F30LLUi4=; b=bkF/vnW9Wc7nh+M9AkAnEjTX5RUZzB4BleSR4YIxjQUMHQxtas/3ByiSxHIP+iEfxKlH1foHSG1xesUihVHch2PLX2x3O0akwkeV1Mk8ambtyu2nC49Nzri3ltYQiWoax9V/DeQy2KKetxuUlKj2SasmZCQwzTu3C0ZF9nbqPkA= Received: from PH0PR11MB5125.namprd11.prod.outlook.com (2603:10b6:510:3e::15) by PH0PR11MB5160.namprd11.prod.outlook.com (2603:10b6:510:3e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Wed, 15 Sep 2021 07:18:36 +0000 Received: from PH0PR11MB5125.namprd11.prod.outlook.com ([fe80::7972:c119:8746:20d4]) by PH0PR11MB5125.namprd11.prod.outlook.com ([fe80::7972:c119:8746:20d4%6]) with mapi id 15.20.4523.014; Wed, 15 Sep 2021 07:18:36 +0000 From: "Yu, DapengX" To: "Min Hu (Connor)" , Chas Williams CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/bonding: fix memory leak on closing device Thread-Index: AQHXqe/DGYaJZGZIXk2lJsxpNN8wzaukqlSAgAABt+A= Date: Wed, 15 Sep 2021 07:18:36 +0000 Message-ID: References: <20210915050802.454669-1-dapengx.yu@intel.com> <2c3d6eac-92fd-fa2c-7ad5-5ff5bc99e1be@huawei.com> In-Reply-To: <2c3d6eac-92fd-fa2c-7ad5-5ff5bc99e1be@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 50ff3982-2739-4839-1201-08d9781908d0 x-ms-traffictypediagnostic: PH0PR11MB5160: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2kQ2KuZm3hGMyTpBImNC9TNpiBExLDc/2sCFf4bR/pBPLo8bxMxDRQ/6/4CZxSjxCTM+PxnOnG+1REMSAp+BEPekZl2xpMqkqZ/krJZApe+ItrWMWXLGixkEf7E5yLDKggFW9t7t0wHu/14Caw2d0cJUiPwF96aTSPH2BJuJISs/dUrhe8P3mNgE4eLuD2w0w/6dn/KJCMa0YdAS+xlIehp/vz+aODzB+QATPVLQ3eZy1Wesqh4cNIShNI8XEHr9tG4OFkL6kQtEBZrSDplZKiiuJzED/9Mx1xSQHBuCJbYRa1lrM30qmV36YMY+D7SAM7FBiw4oyJKbIT31G8qHKcHtKPto/0xlVqDcOV7hRrzq+FIXxBYrBSaZfWd6spMSKDLBWh5qIksZIm1x8G7LiuXCO5kLTRKgrhRe1pRDquCnXHal64H9zPKcX06guUEgYCd/8OvUBNbQxT8pkcjnjv9+stTXg4RWTDXdD6K5Q7Bf3Sde40X0FDvsfsv1qRMt+9jU1ABXvFTx6+No38S8+O35SEGC/TmwBgoCnR8hOFGSqPJNI32eX8+yRMNWV74jC0/JQg/n7Gx6mWQ0ebUXgL0uScoeNmakHCK643DtlDKBANweKVo2CbGGDMtxziJDhIu7I2ifeB8pnINoT1p+UqzM95CsJSokxpWt3oYIWvbfP3CDsuS29pw1GMNz9jnRFN7b6Gz/Z1vUtym7OFGB/w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5125.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(376002)(39860400002)(136003)(346002)(122000001)(4326008)(9686003)(38100700002)(26005)(54906003)(76116006)(8676002)(2906002)(66556008)(66446008)(64756008)(66946007)(7696005)(478600001)(55016002)(66476007)(6506007)(38070700005)(186003)(52536014)(8936002)(71200400001)(316002)(5660300002)(33656002)(110136005)(83380400001)(86362001)(53546011); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?R1dmbjMyOE93cnFCU212cGVhNDJVSFpxREVUMXlTaUs5ZVFGSVNwbkJF?= =?iso-2022-jp?B?dUlSZE1GZmt3eXhRN0xOVnkza0VhbGx6b2FXWktaelZVbURaUzRCbUlU?= =?iso-2022-jp?B?M0VDY1hob1hoeGxKUkhzRzRQbUliOEZIZStqVjB1bXBYa211OW1FeWZx?= =?iso-2022-jp?B?ZmIyeFZJLzdmZ0kyM1ErOE1GUnJkK3FsK2pJOXJDc09FWXVjWjcwYnYx?= =?iso-2022-jp?B?c0cwZ2o2TkFkb3RobHYyK0txM2VkQkc5WjBoVWlaTlFXaGtzc3JlbU5V?= =?iso-2022-jp?B?OUFDMkJCM0ZUeTd2SEZHTkE1Q0pLRlh2WC9Wc0ZJdFRjSzVJT21jQWx4?= =?iso-2022-jp?B?MndHRlFpcVlNYkpVZnRUaWMweSs0NE1mOThjOVIyRHdYMFhjc3p6QXI1?= =?iso-2022-jp?B?dWZ6eUlPdGY3L1dYeXovTmJjblRWemJBWWNDSnY0M3dNdUcrazd3bFlN?= =?iso-2022-jp?B?emxpWWxSKy9ENWJ3UkZJSUNPT0l0STJUam54MVRUcmpEb3lUYTFkUWVC?= =?iso-2022-jp?B?djFoSERRbFRCYU9ic1gwTXVSMk9ld01ld2ttQUZqUjZJWHJSeC9EcXFR?= =?iso-2022-jp?B?bWJlbC9JdE1OczlXS3QzaXZoaThEMzNraFdYNTZjdEtMa1ZERzYyeDd1?= =?iso-2022-jp?B?M3Nsa216OXBjM0p3MmQ5VC9hQnpJTW1sUHBiYWV6OElUcWhpUG1tSy9V?= =?iso-2022-jp?B?ZkFwTHhTZWo4MUFYVjlQK3hneUhteHhJWFpOaj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1daU3pWZ2gySjd1ck03bVduU0lMVVlXZUc4?= =?iso-2022-jp?B?VjNZZ3ZhYTJrK2Q0WERHbnl3Q2RQV3NnSUNibGdjRlJ6QzRRYU1DSzM4?= =?iso-2022-jp?B?MjlrekZRayt4Q2Vwd0Z3TitUVTFPMytDRnczYlZQdkx6dTNVcVNmNVNs?= =?iso-2022-jp?B?dVJYQ0pIanhXVGxXZ0l4ZUhsdlRJZWQrZ0poSDh5YWxxRjhyL3dRTUJ3?= =?iso-2022-jp?B?NE94bkJ3ZzU5eWdiUVZkQUlncTllZ1A4Yk53VGwydTRGa0VUT24xeUZ4?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5125.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50ff3982-2739-4839-1201-08d9781908d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2021 07:18:36.5820 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WodciDJRFE31Y6lakIx8hsRA8jQTURasIhjYr5zTbntQZgLDOlKMB1KH/14+xK6ornWcm6nBl/XoIhWLCf51bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5160 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix memory leak on closing device X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: Min Hu (Connor) > Sent: Wednesday, September 15, 2021 2:59 PM > To: Yu, DapengX ; Chas Williams > Cc: dev@dpdk.org; stable@dpdk.org > Subject: Re: [PATCH] net/bonding: fix memory leak on closing device >=20 > Hi, dapengx, > Why not free internals->kvlist at the end of > "bond_ethdev_configure" ? > Does it call some bugs? Just try not to deviate too much from the previous fix: 144dc4739975 ("net/= bonding: fix leak on remove") Since it is reasonable. And releasing port resource in bond_ethdev_close() is in order to avoid that memory leak detect tool to find memory leak after device is clos= ed. free internals->kvlist at the end of "bond_ethdev_configure" is also ok. >=20 > =1B$B:_=1B(B 2021/9/15 13:08, dapengx.yu@intel.com =1B$B > From: Dapeng Yu > > > > If the bond device was created by vdev mode, the kvlist was not free > > after the bond device was closed. > > > > This patch fixes it. > > > > Fixes: 144dc4739975 ("net/bonding: fix leak on remove") > > Cc: stable@dpdk.org > > > > Signed-off-by: Dapeng Yu > > --- > > drivers/net/bonding/rte_eth_bond_pmd.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c > > b/drivers/net/bonding/rte_eth_bond_pmd.c > > index a6755661c4..2e96b850fb 100644 > > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > > @@ -2163,6 +2163,9 @@ bond_ethdev_close(struct rte_eth_dev *dev) > > */ > > rte_mempool_free(internals->mode6.mempool); > > > > + if (internals->kvlist !=3D NULL) > > + rte_kvargs_free(internals->kvlist); > > + > > return 0; > > } > > > > @@ -3475,8 +3478,6 @@ bond_remove(struct rte_vdev_device *dev) > > ret =3D bond_ethdev_stop(eth_dev); > > bond_ethdev_close(eth_dev); > > } > > - if (internals->kvlist !=3D NULL) > > - rte_kvargs_free(internals->kvlist); > > rte_eth_dev_release_port(eth_dev); > > > > return ret; > >