qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] snabbswitch integration with QEMU for userspace etherne


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] snabbswitch integration with QEMU for userspace ethernet I/O
Date: Tue, 28 May 2013 14:53:26 +0300

On Tue, May 28, 2013 at 01:36:36PM +0200, Julian Stecklina wrote:
> On 05/28/2013 12:10 PM, Luke Gorrie wrote:
> > On 27 May 2013 11:34, Stefan Hajnoczi <address@hidden
> > <mailto:address@hidden>> wrote:
> > 
> >     vhost_net is about connecting the a virtio-net speaking process to a
> >     tun-like device.  The problem you are trying to solve is connecting a
> >     virtio-net speaking process to Snabb Switch.
> > 
> > 
> > Yep!
> 
> Since I am on a similar path as Luke, let me share another idea.
> 
> What about extending qemu in a way to allow PCI device models to be
> implemented in another process. This is not as hard as it may sound.
> qemu would open a domain socket to this process and map VM memory over
> to the other side. This can be accomplished by having file descriptors
> in qemu to VM memory (reusing -mem-path code) and passing those over the
> domain socket. The other side can then just mmap them. The socket would
> also be used for configuration and I/O by the guest on the PCI
> I/O/memory regions. You could also use this to do IRQs or use eventfds,
> whatever works better.
> 
> To have a zero copy userspace switch, the switch would offer virtio-net
> devices to any qemu that wants to connect to it and implement the
> complete device logic itself. Since it has access to all guest memory,
> it can just do memcpy for packet data. Of course, this only works for
> 64-bit systems, because you need vast amounts of virtual address space.
> In my experience, doing this in userspace is _way less painful_.
> 
> If you can get away with polling in the switch the overhead of doing all
> this in userspace is zero. And as long as you can rate-limit explicit
> notifications over the socket even that overhead should be okay.
> 
> Opinions?
> 
> Julian

Implementing out of process device logic would absolutely be useful for
qemu, for security.

Don't expect it to be zero overhead though, latency overhead
of bouncing each packet through multiple processes would
be especially painful.

Yes, you can maybe trade some of this latency for power/CPU cycles by
aggressive polling.  Doing this in a way that does not waste a lot of
power would be tricky.

-- 
MST



reply via email to

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