From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: dev@dpdk.org
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
Ilya Maximets <i.maximets@samsung.com>,
stable@dpdk.org
Subject: Re: [PATCH] vhost: fix fd leaks for vhost-user server mode
Date: Sat, 1 Apr 2017 13:15:20 +0800 [thread overview]
Message-ID: <20170401051520.GP18844@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <1490604735-1704-1-git-send-email-yuanhan.liu@linux.intel.com>
On Mon, Mar 27, 2017 at 04:52:15PM +0800, Yuanhan Liu wrote:
> A vhost-user server socket could have many connections, thus many connfd.
> However, we currently just use one single int var to store it. Meaning,
> it will get overwritten every time a new connection is created.
>
> While this will not create fatal issue as it sounds (since the correct
> connfd is closured to the event loop thread by fdset_add), it may cause
> fd leaks if a user invokes rte_vhost_driver_unregister before shutting
> down all connections: it just closes the recent connfd.
>
> A simple example that should be able to reproduce this leaks issues is,
> del the ovs vhost-user port while the connected VMs are still alive. (Note
> that it's suggested to use one socket for one VM, which makes the issue
> not that fatal as it sounds again).
>
> Since we already use a struct "vhost_user_connection" to track all info
> about one connection, it's obvious that we should put the connfd there.
> Then we could build a connection list inside the vhost_user_socket struct,
> to represent all connections belong that socket file.
>
> Fixes: 164fd396788d ("vhost: fix unregistering in client mode")
Applied to dpdk-next-virtio.
--yliu
>
> Cc: Ilya Maximets <i.maximets@samsung.com>
> Cc: stable@dpdk.org
> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
prev parent reply other threads:[~2017-04-01 5:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 8:52 [PATCH] vhost: fix fd leaks for vhost-user server mode Yuanhan Liu
2017-04-01 5:15 ` Yuanhan Liu [this message]
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=20170401051520.GP18844@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=dev@dpdk.org \
--cc=i.maximets@samsung.com \
--cc=maxime.coquelin@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.