From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: Gaoxiang Liu <clgx0086@163.com>,
Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"liugaoxiang@huawei.com" <liugaoxiang@huawei.com>
Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix memory leak in dev close
Date: Mon, 26 Jul 2021 08:42:57 +0000 [thread overview]
Message-ID: <MN2PR11MB4063521F9A34C18DD40010039CE89@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210725020315.15010-1-clgx0086@163.com>
Hi Gaoxiang,
> -----Original Message-----
> From: Gaoxiang Liu <clgx0086@163.com>
> Sent: Sunday, July 25, 2021 10:03 AM
> To: Maxime Coquelin <maxime.coquelin@redhat.com>; Xia, Chenbo
> <chenbo.xia@intel.com>
> Cc: dev@dpdk.org; liugaoxiang@huawei.com; Gaoxiang Liu <clgx0086@163.com>
> Subject: [PATCH] net/virtio: fix memory leak in dev close
I suggest the title: fix memory leak of interrupt handle
>
> Free the "intr_handle" memory in virtio_user_dev_uninit() to
> avoid memory leak.
> when virtio user dev closes, the "intr_handle" memory is not freeed
> that is alloced in virtio_user_fill_intr_handle().
I suggest to replace 'intr_handle memory' with 'memory of interrupt handle'
freeed -> freed
alloced -> allocated
>
> Fixes: 7f468b2ebfad ("net/virtio: release port upon close")
Please add cc stable tag under fixes line:
Cc: stable@dpdk.org
And I think the fix commit id is not correct. Fix commit id should be the
first commit that introduces the bug. I think it's:
3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
Please help me double confirm.
>
> Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
I suggest to send patch using this email too.
The patch content looks good to me.
Thanks,
Chenbo
> ---
> drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index 1cd1e95f4..16c58710d 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -654,6 +654,13 @@ virtio_user_dev_init(struct virtio_user_dev *dev,
> char *path, int queues,
> void
> virtio_user_dev_uninit(struct virtio_user_dev *dev)
> {
> + struct rte_eth_dev *eth_dev = &rte_eth_devices[dev->hw.port_id];
> +
> + if (eth_dev->intr_handle) {
> + free(eth_dev->intr_handle);
> + eth_dev->intr_handle = NULL;
> + }
> +
> virtio_user_stop_device(dev);
>
> rte_mem_event_callback_unregister(VIRTIO_USER_MEM_EVENT_CLB_NAME,
> dev);
> --
> 2.32.0
next prev parent reply other threads:[~2021-07-26 8:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-25 2:03 Gaoxiang Liu
2021-07-26 8:42 ` Xia, Chenbo [this message]
2021-07-26 11:38 ` 刘高翔
2021-07-26 11:59 ` [dpdk-dev] [PATCH] net/virtio: fix memory leak of interrupt handle Gaoxiang Liu
2021-07-26 12:54 ` Maxime Coquelin
2021-07-26 14:42 ` Gaoxiang Liu
2021-07-27 1:52 ` Xia, Chenbo
2021-07-27 1:54 ` Xia, Chenbo
2021-07-28 6:51 ` Xia, Chenbo
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=MN2PR11MB4063521F9A34C18DD40010039CE89@MN2PR11MB4063.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=clgx0086@163.com \
--cc=dev@dpdk.org \
--cc=liugaoxiang@huawei.com \
--cc=maxime.coquelin@redhat.com \
/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).