From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: "Ma, WenwuX" <wenwux.ma@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>,
"Jiang, Cheng1" <cheng1.jiang@intel.com>,
"Hu, Jiayu" <jiayu.hu@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] examples/vhost: fix memory leak on forwarding packets
Date: Tue, 31 Aug 2021 05:50:24 +0000 [thread overview]
Message-ID: <MN2PR11MB40633D641959E5002A1AF06D9CCC9@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210827140037.3822-1-wenwux.ma@intel.com>
Hi Wenwu,
> -----Original Message-----
> From: Ma, WenwuX <wenwux.ma@intel.com>
> Sent: Friday, August 27, 2021 10:01 PM
> To: dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Jiang,
> Cheng1 <cheng1.jiang@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>; Ma, WenwuX
> <wenwux.ma@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] examples/vhost: fix memory leak on forwarding packets
>
> In function virtio_tx_local(), when the device receiving the packet
> is the same as the device to which the packet is forwarded,
> or the device is removed, we return but not free the packet,
> it will cause a memory leak.
>
> Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
> Cc: stable@dpdk.org
>
> v2:
> - Delete '.' in the title.
>
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
The version description should be after signed-off-by tag like:
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
v2:XXX
---
examples/vhost/main.c | 2 ++
Please fix this to save Maxime's effort when applying.
And you missed the Acked-by/Reviewed-by tag of Jiayu/Cheng/Mine.
Thanks,
Chenbo
> ---
> examples/vhost/main.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index bc3d71c898..07fd90ec64 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -965,6 +965,7 @@ virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m)
> return -1;
>
> if (vdev->vid == dst_vdev->vid) {
> + rte_pktmbuf_free(m);
> RTE_LOG_DP(DEBUG, VHOST_DATA,
> "(%d) TX: src and dst MAC is same. Dropping packet.\n",
> vdev->vid);
> @@ -975,6 +976,7 @@ virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m)
> "(%d) TX: MAC address is local\n", dst_vdev->vid);
>
> if (unlikely(dst_vdev->remove)) {
> + rte_pktmbuf_free(m);
> RTE_LOG_DP(DEBUG, VHOST_DATA,
> "(%d) device is marked for removal\n", dst_vdev->vid);
> return 0;
> --
> 2.25.1
next prev parent reply other threads:[~2021-08-31 5:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-17 17:13 [dpdk-dev] [PATCH] " Wenwu Ma
2021-08-17 5:26 ` Jiang, Cheng1
2021-08-17 7:12 ` Hu, Jiayu
2021-08-26 11:47 ` Xia, Chenbo
2021-08-27 14:00 ` [dpdk-dev] [PATCH v2] " Wenwu Ma
2021-08-31 5:50 ` Xia, Chenbo [this message]
2021-09-02 6:50 ` Yang, YvonneX
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=MN2PR11MB40633D641959E5002A1AF06D9CCC9@MN2PR11MB4063.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=cheng1.jiang@intel.com \
--cc=dev@dpdk.org \
--cc=jiayu.hu@intel.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=wenwux.ma@intel.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).