From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Rich Lane <rich.lane@bigswitch.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 1/1] vhost: fix leak of fds and mmaps
Date: Sat, 6 Feb 2016 13:23:20 +0800 [thread overview]
Message-ID: <20160206052320.GJ22958@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <CAGSMBPN=5qemS6Ah4x5jUeqcULVWCaStOXp+0OA0mcBKGEHqEg@mail.gmail.com>
Hey Rich,
Sorry for the long delay; I barely forgot it :(
On Tue, Jan 19, 2016 at 10:13:23AM -0800, Rich Lane wrote:
> On Sun, Jan 17, 2016 at 11:58 PM, Yuanhan Liu <yuanhan.liu@linux.intel.com>
> wrote:
>
> On Sun, Jan 17, 2016 at 11:57:18AM -0800, Rich Lane wrote:
> > +/*
> > + * Implementation-specific cleanup. Defined by vhost-cuse and
> vhost-user.
> > + */
> > +void vhost_impl_cleanup(struct virtio_net *dev);
>
> TBH, I am not quite like "_impl_"; maybe "_backend_" is better?
>
>
> If you have a strong preference I will change it. Let me know.
"backend" is just a more common word to me, as well as to QEMU.
So, I would suggest you to do such change, and if so, you could
add my ACK:
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
>
> OTOH, what I thought of has slight difference than yours: not
> necessary to export a function, but instead, call the vhost
> backend specific unmap function inside the backend itself. Say,
> call vhost_user_unmap() on RESET_OWNER and connection close.
> What do you think of that?
>
>
> The munmap must be done after the notify_ops->destroy_device callback. That
> means
> the backend can't call it before reset_owner() or destroy_device().
Well, you could:
case VHOST_USER_RESET_OWNER:
ops->reset_owner();
vhost_user_unmap();
break;
Anyway, it's not a big deal. Let's go with your solution first.
--yliu
> The munmap
> could
> be done afterwards, but that requires saving dev->mem in the caller in the case
> of
> destroy_device. The cleanest solution is for the vhost common code to ask the
> backend to clean up at the correct time.
next prev parent reply other threads:[~2016-02-06 5:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-05 22:14 [dpdk-dev] [PATCH] " Rich Lane
2016-01-07 2:31 ` Yuanhan Liu
2016-01-07 6:50 ` Xie, Huawei
2016-01-17 19:57 ` [dpdk-dev] [PATCH v2 1/1] " Rich Lane
2016-01-18 7:58 ` Yuanhan Liu
2016-01-19 18:13 ` Rich Lane
2016-02-06 5:23 ` Yuanhan Liu [this message]
2016-02-10 18:40 ` [dpdk-dev] [PATCH v3] " Rich Lane
2016-02-19 15:08 ` Thomas Monjalon
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=20160206052320.GJ22958@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=dev@dpdk.org \
--cc=rich.lane@bigswitch.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).