qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] vhost-user graceful connect/disconnect


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] vhost-user graceful connect/disconnect
Date: Fri, 12 Jan 2018 10:45:10 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Fri, Jan 12, 2018 at 02:53:43PM +0800, Wei Wang wrote:
> On 01/09/2018 12:09 AM, Stefan Hajnoczi wrote:
> > On Mon, Jan 08, 2018 at 07:22:37PM +0800, Wei Wang wrote:
> > > On 01/05/2018 11:49 PM, Stefan Hajnoczi wrote:
> > > > On Thu, Jan 04, 2018 at 07:15:38PM +0800, Wei Wang wrote:
> > > > > On 01/04/2018 06:47 PM, Stefan Hajnoczi wrote:
> > > > > > On Thu, Dec 21, 2017 at 06:01:29AM -0500, Marc-André Lureau wrote:
> > > > > > 
> > > > > > I'm not going to prototype this yet, I'm working on 
> > > > > > virtio-vhost-user
> > > > > > first, but eventually I might get back to -object 
> > > > > > vhost-user(-backend).
> > > > > > 
> > > > > Hi Stefan, are you implementing the guest slave and vhost-pci driver 
> > > > > (we've
> > > > > posted to the dpdk mailinglist) as well? and do you have an 
> > > > > estimation when
> > > > > would the prototype be ready?
> > > > I'm implementing the "[RFC virtio-dev] vhost-user-slave: add vhost-user
> > > > slave device type" device in QEMU and DPDK in order to show how the
> > > > ideas we've discussed work.
> > > > 
> > > > Here is the VIRTIO spec link again:
> > > > https://stefanha.github.io/virtio/vhost-user-slave.html#x1-2830007
> > > There are four virtqueues documented in the spec, would two suffice? 
> > > Request
> > > and Response can be distinguished by VHOST_USER_REPLY_MASK.
> > That's a good idea and I'll do it for the master-to-slave virtqueue.
> > 
> > Unfortunately virtqueues are asymmetric so a single virtqueue cannot
> > support the slave-to-master message flow (VHOST_USER_SET_SLAVE_REQ_FD):
> > 1. Master puts an empty buffer onto vq.
> > 2. Slave takes buffer and fills in a request.  The buffer is now used.
> > 3. Master pops the used buffer but there is no way to reply back to the
> >     slave!
> 
> 
> Essentially, I think two virtqueues should be sufficient for guest-to-host
> and host-to-guest communication.
> 
> Host-to-guest virtqueue: used for master request/response messages passed to
> the guest slave (driver). The buffer can be primed by the guest driver (like
> virtio-net rxq).
> Guest-to-host virtqueue: used for guest slave request/response messages,
> like virtio-net txq, it doesn't need to prime buffers in advance.

Yes, multiplexing all messages over an rx and tx virtqueue is possible.
QEMU needs to demultiplex them on to the appropriate AF_UNIX fds.

The downside to multiplexing is that it makes per-queue policies
impossible (e.g. per-queue interrupts and affinity, multiqueue, etc).  I
think that's okay because we don't need them for virtio-vhost-user.  And
it's possible to add a feature bit for a new virtqueue layout later if
we hit problems...

I'll give this a try.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]