DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: <dapengx.yu@intel.com>, Chas Williams <chas3@att.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix memory leak on closing device
Date: Wed, 15 Sep 2021 14:58:35 +0800	[thread overview]
Message-ID: <2c3d6eac-92fd-fa2c-7ad5-5ff5bc99e1be@huawei.com> (raw)
In-Reply-To: <20210915050802.454669-1-dapengx.yu@intel.com>

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 <dapengx.yu@intel.com>
> 
> 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 <dapengx.yu@intel.com>
> ---
>   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;
> 

  reply	other threads:[~2021-09-15  6:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15  5:08 dapengx.yu
2021-09-15  6:58 ` Min Hu (Connor) [this message]
2021-09-15  7:18   ` Yu, DapengX
2021-09-15  8:16     ` Min Hu (Connor)
2021-09-21  8:04       ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c3d6eac-92fd-fa2c-7ad5-5ff5bc99e1be@huawei.com \
    --to=humin29@huawei.com \
    --cc=chas3@att.com \
    --cc=dapengx.yu@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).