From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yongji Xie <elohimes@gmail.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Coquelin, Maxime" <maxime.coquelin@redhat.com>,
"Yury Kotov" <yury-kotov@yandex-team.ru>,
"Евгений Яковлев" <wrfsh@yandex-team.ru>,
qemu-devel <qemu-devel@nongnu.org>,
zhangyu31@baidu.com, chaiwen@baidu.com, nixun@baidu.com,
lilin24@baidu.com, "Xie Yongji" <xieyongji@baidu.com>
Subject: Re: [Qemu-devel] [PATCH v3 for-4.0 2/7] vhost-user: Support providing shared memory to backend
Date: Thu, 3 Jan 2019 21:41:41 -0500 [thread overview]
Message-ID: <20190103214028-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAONzpcaD6DeDfhjxm_3-ZSrfTXJAenYWN1LC78nU-fovCpuGqQ@mail.gmail.com>
On Fri, Jan 04, 2019 at 10:31:34AM +0800, Yongji Xie wrote:
> On Fri, 4 Jan 2019 at 01:02, Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> > On Thu, Jan 03, 2019 at 06:18:14PM +0800, elohimes@gmail.com wrote:
> > > From: Xie Yongji <xieyongji@baidu.com>
> > >
> > > This patch introduces two new messages VHOST_USER_GET_SHM_SIZE
> > > and VHOST_USER_SET_SHM_FD to support providing shared
> > > memory to backend.
> >
> > So this seems a bit vague. Since we are going to use it
> > for tracking in-flight I/O I would prefer it that we
> > actually call it that.
> >
> >
>
> So how about VHOST_USER_GET_INFLIGHT_SIZE and VHOST_USER_SET_INFLIHGT_FD?
Sounds good.
> > >
> > > Firstly, qemu uses VHOST_USER_GET_SHM_SIZE to get the
> > > required size of shared memory from backend. Then, qemu
> > > allocates memory and sends them
> >
> > s/them/it/ ?
> >
>
> Will fix it in v4.
>
> > > back to backend through
> > > VHOST_USER_SET_SHM_FD.
> > >
> > > Note that the shared memory should be used to record
> > > inflight I/O by backend. Qemu will clear it when vm reset.
> > >
> > > Signed-off-by: Xie Yongji <xieyongji@baidu.com>
> > > Signed-off-by: Chai Wen <chaiwen@baidu.com>
> > > Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
> > > ---
> > > docs/interop/vhost-user.txt | 41 +++++++++++
> > > hw/virtio/vhost-user.c | 86 ++++++++++++++++++++++
> > > hw/virtio/vhost.c | 117 ++++++++++++++++++++++++++++++
> > > include/hw/virtio/vhost-backend.h | 9 +++
> > > include/hw/virtio/vhost.h | 19 +++++
> > > 5 files changed, 272 insertions(+)
> > >
> > > diff --git a/docs/interop/vhost-user.txt b/docs/interop/vhost-user.txt
> > > index c2194711d9..5ee9c28ab0 100644
> > > --- a/docs/interop/vhost-user.txt
> > > +++ b/docs/interop/vhost-user.txt
> > > @@ -142,6 +142,19 @@ Depending on the request type, payload can be:
> > > Offset: a 64-bit offset of this area from the start of the
> > > supplied file descriptor
> > >
> > > + * Shm description
> > > + -----------------------------------
> > > + | mmap_size | mmap_offset | dev_size | vq_size | align | version |
> > > + -----------------------------------
> > > +
> > > + Mmap_size: a 64-bit size of the shared memory
> > > + Mmap_offset: a 64-bit offset of the shared memory from the start
> > > + of the supplied file descriptor
> > > + Dev_size: a 32-bit size of device region in shared memory
> > > + Vq_size: a 32-bit size of each virtqueue region in shared memory
> > > + Align: a 32-bit align of each region in shared memory
> > > + Version: a 32-bit version of this shared memory
> > > +
> >
> > This is an informal description so please avoid _ in field
> > names, just put a space in there. See e.g. log description.
> >
> >
> Got it!
>
> > > In QEMU the vhost-user message is implemented with the following struct:
> > >
> > > typedef struct VhostUserMsg {
> >
> >
> > For things to work, in-flight format must not change when
> > backend reconnects.
> >
>
> I'm not sure whether there will be some cases that we want to add some fields to
> the inflight area without stopping vm.
Sorry I'm not sure I understand this comment. All I am saying is that
when one backend disconnects and another reconnects they must agree on
the format, so it's a good idea to document it.
> > To encourage consistency, how about including a recommended format for
> > this buffer in this document?
> >
> >
>
> Sure. Will add it in v4.
>
> Thanks,
> Yongji
next prev parent reply other threads:[~2019-01-04 2:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 10:18 [Qemu-devel] [PATCH v3 for-4.0 0/7] vhost-user-blk: Add support for backend reconnecting elohimes
2019-01-03 10:18 ` [Qemu-devel] [PATCH v3 for-4.0 1/7] char-socket: Enable "nowait" option on client sockets elohimes
2019-01-03 10:18 ` [Qemu-devel] [PATCH v3 for-4.0 2/7] vhost-user: Support providing shared memory to backend elohimes
2019-01-03 17:02 ` Michael S. Tsirkin
2019-01-04 2:31 ` Yongji Xie
2019-01-04 2:41 ` Michael S. Tsirkin [this message]
2019-01-04 3:16 ` Yongji Xie
2019-01-03 17:13 ` Michael S. Tsirkin
2019-01-04 3:20 ` Yongji Xie
2019-01-03 10:18 ` [Qemu-devel] [PATCH v3 for-4.0 3/7] libvhost-user: Introduce vu_queue_map_desc() elohimes
2019-01-03 10:18 ` [Qemu-devel] [PATCH v3 for-4.0 4/7] libvhost-user: Support recording inflight I/O in shared memory elohimes
2019-01-03 10:18 ` [Qemu-devel] [PATCH v3 for-4.0 5/7] vhost-user-blk: Add support to provide shared memory to backend elohimes
2019-01-03 10:18 ` [Qemu-devel] [PATCH v3 for-4.0 6/7] vhost-user-blk: Add support to reconnect backend elohimes
2019-01-03 10:18 ` [Qemu-devel] [PATCH v3 for-4.0 7/7] contrib/vhost-user-blk: enable inflight I/O recording elohimes
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=20190103214028-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=berrange@redhat.com \
--cc=chaiwen@baidu.com \
--cc=elohimes@gmail.com \
--cc=jasowang@redhat.com \
--cc=lilin24@baidu.com \
--cc=marcandre.lureau@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=nixun@baidu.com \
--cc=qemu-devel@nongnu.org \
--cc=wrfsh@yandex-team.ru \
--cc=xieyongji@baidu.com \
--cc=yury-kotov@yandex-team.ru \
--cc=zhangyu31@baidu.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).