qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Antonios Motakis <a.motakis@virtualopensystems.com>
To: qemu-devel@nongnu.org, snabb-devel@googlegroups.com
Cc: lukego@gmail.com,
	Antonios Motakis <a.motakis@virtualopensystems.com>,
	tech@virtualopensystems.com, n.nikolaev@virtualopensystems.com
Subject: [Qemu-devel] [PATCH v3 0/7] host and vhost-net support for userspace based backends
Date: Fri, 13 Dec 2013 12:14:30 +0100	[thread overview]
Message-ID: <1386933277-20003-1-git-send-email-a.motakis@virtualopensystems.com> (raw)

In this patch series we would like to introduce our approach for putting a
virtio-net backend in an external userspace process. Our eventual target is to
run the network backend in the Snabbswitch ethernet switch, while receiving
traffic from a guest inside QEMU/KVM which runs an unmodified virtio-net
implementation.

For this, we are working into extending vhost to allow equivalent functionality
for userspace. Vhost already passes control of the data plane of virtio-net to
the host kernel; we want to realize a similar model, but for userspace.

In this patch series the concept of a vhost-backend is introduced.

We define two vhost backend types - vhost-kernel and vhost-user. The former is
the interface to the current kernel module implementation. Its control plane is
ioctl based. The data plane is the kernel directly accessing the QEMU allocated,
guest memory.

In the new vhost-user backend, the control plane is based on communication
between QEMU and another userspace process using a unix domain socket. This
allows to implement a virtio backend for a guest running in QEMU, inside the
other userspace process.

We introduce a new memory related flag: -mem-share. When used the ram is
created as a shared memory object. When combined with -mem-path, it will reuse
a HugeTLBFS file instead of /dev/shm. This flag also implies -mem-prealloc.

The data path is realized by directly accessing the vrings and the buffer data
off the guest's memory.

The current user of vhost-user is only vhost-net. We add new netdev backend
that is intended to initialize vhost-net with vhost-user backend.

Example usage:

qemu -m 1024 -mem-share -mem-path /hugetlbfs \
     -netdev type=vhost-user,id=net0,file=/path/to/sock \
     -device virtio-net-pci,netdev=net0

Changes from v2:
 - Reconnect when the backend disappears

Changes from v1:
 - Implementation of vhost-user netdev backend
 - Code improvements

Antonios Motakis (7):
  Add -mem-share option
  Decouple vhost from kernel interface
  Add vhost-user skeleton
  Add domain socket communication for vhost-user backend
  Add vhost-user calls implementation
  Add new vhost-user netdev backend
  Add vhost-user reconnection

 exec.c                            |  72 +++++---
 hmp-commands.hx                   |   4 +-
 hw/net/vhost_net.c                | 144 +++++++++++----
 hw/net/virtio-net.c               |  42 ++---
 hw/scsi/vhost-scsi.c              |  13 +-
 hw/virtio/Makefile.objs           |   2 +-
 hw/virtio/vhost-backend.c         | 372 ++++++++++++++++++++++++++++++++++++++
 hw/virtio/vhost.c                 |  46 ++---
 include/exec/cpu-all.h            |   1 +
 include/hw/virtio/vhost-backend.h |  40 ++++
 include/hw/virtio/vhost.h         |   4 +-
 include/net/vhost-user.h          |  17 ++
 include/net/vhost_net.h           |  15 +-
 net/Makefile.objs                 |   2 +-
 net/clients.h                     |   3 +
 net/hub.c                         |   1 +
 net/net.c                         |   2 +
 net/tap.c                         |  16 +-
 net/vhost-user.c                  | 167 +++++++++++++++++
 qapi-schema.json                  |  18 +-
 qemu-options.hx                   |  12 ++
 vl.c                              |   5 +
 22 files changed, 873 insertions(+), 125 deletions(-)
 create mode 100644 hw/virtio/vhost-backend.c
 create mode 100644 include/hw/virtio/vhost-backend.h
 create mode 100644 include/net/vhost-user.h
 create mode 100644 net/vhost-user.c

-- 
1.8.3.2

             reply	other threads:[~2013-12-13 11:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-13 11:14 Antonios Motakis [this message]
2013-12-13 11:14 ` [Qemu-devel] [PATCH v3 1/7] Add -mem-share option Antonios Motakis
2013-12-14  3:53   ` Eric Blake
2013-12-14 11:09     ` [Qemu-devel] [snabb-devel:650] " Paolo Bonzini
2013-12-16 15:20     ` [Qemu-devel] " Antonios Motakis
2013-12-16 15:47       ` Igor Mammedov
2013-12-17 11:11         ` Paolo Bonzini
2013-12-16  7:32   ` Edgar E. Iglesias
2013-12-16 10:17     ` Paolo Bonzini
2013-12-16 15:21     ` Antonios Motakis
2013-12-17  1:55       ` Edgar E. Iglesias
2013-12-13 11:14 ` [Qemu-devel] [PATCH v3 2/7] Decouple vhost from kernel interface Antonios Motakis
2013-12-13 11:14 ` [Qemu-devel] [PATCH v3 3/7] Add vhost-user skeleton Antonios Motakis
2013-12-13 11:14 ` [Qemu-devel] [PATCH v3 4/7] Add domain socket communication for vhost-user backend Antonios Motakis
2013-12-13 11:14 ` [Qemu-devel] [PATCH v3 5/7] Add vhost-user calls implementation Antonios Motakis
2013-12-16  9:15   ` Luke Gorrie
2013-12-13 11:14 ` [Qemu-devel] [PATCH v3 6/7] Add new vhost-user netdev backend Antonios Motakis
2013-12-13 11:14 ` [Qemu-devel] [PATCH v3 7/7] Add vhost-user reconnection Antonios Motakis
2013-12-16  9:17   ` Luke Gorrie

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=1386933277-20003-1-git-send-email-a.motakis@virtualopensystems.com \
    --to=a.motakis@virtualopensystems.com \
    --cc=lukego@gmail.com \
    --cc=n.nikolaev@virtualopensystems.com \
    --cc=qemu-devel@nongnu.org \
    --cc=snabb-devel@googlegroups.com \
    --cc=tech@virtualopensystems.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).