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 B7041A0C41; Wed, 15 Sep 2021 08:58:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AB054003F; Wed, 15 Sep 2021 08:58:41 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 7C28F4003C; Wed, 15 Sep 2021 08:58:38 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4H8WD56lZVzbl2s; Wed, 15 Sep 2021 14:54:29 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Wed, 15 Sep 2021 14:58:35 +0800 To: , Chas Williams CC: , References: <20210915050802.454669-1-dapengx.yu@intel.com> From: "Min Hu (Connor)" Message-ID: <2c3d6eac-92fd-fa2c-7ad5-5ff5bc99e1be@huawei.com> Date: Wed, 15 Sep 2021 14:58:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20210915050802.454669-1-dapengx.yu@intel.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected 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" Hi, dapengx, Why not free internals->kvlist at the end of "bond_ethdev_configure" ? Does it call some bugs? ÔÚ 2021/9/15 13:08, dapengx.yu@intel.com дµÀ: > 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 != NULL) > + rte_kvargs_free(internals->kvlist); > + > return 0; > } > > @@ -3475,8 +3478,6 @@ bond_remove(struct rte_vdev_device *dev) > ret = bond_ethdev_stop(eth_dev); > bond_ethdev_close(eth_dev); > } > - if (internals->kvlist != NULL) > - rte_kvargs_free(internals->kvlist); > rte_eth_dev_release_port(eth_dev); > > return ret; >