diff options
author | mst@redhat.com | 2011-02-01 21:13:42 +0100 |
---|---|---|
committer | Anthony Liguori | 2011-02-01 23:50:44 +0100 |
commit | 5430a28fe452907c9e1b2097e073bc1ea4b29f39 (patch) | |
tree | 066db9fdbac5a5ddca922b5d282161e9b6141b0e /net/tap.c | |
parent | tap: safe sndbuf default (diff) | |
download | qemu-5430a28fe452907c9e1b2097e073bc1ea4b29f39.tar.gz qemu-5430a28fe452907c9e1b2097e073bc1ea4b29f39.tar.xz qemu-5430a28fe452907c9e1b2097e073bc1ea4b29f39.zip |
vhost: force vhost off for non-MSI guests
When MSI is off, each interrupt needs to be bounced through the io
thread when it's set/cleared, so vhost-net causes more context switches and
higher CPU utilization than userspace virtio which handles networking in
the same thread.
We'll need to fix this by adding level irq support in kvm irqfd,
for now disable vhost-net in these configurations.
Added a vhostforce flag to force vhost-net back on.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net/tap.c')
-rw-r--r-- | net/tap.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -491,8 +491,10 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan } } - if (qemu_opt_get_bool(opts, "vhost", !!qemu_opt_get(opts, "vhostfd"))) { + if (qemu_opt_get_bool(opts, "vhost", !!qemu_opt_get(opts, "vhostfd") || + qemu_opt_get_bool(opts, "vhostforce", false))) { int vhostfd, r; + bool force = qemu_opt_get_bool(opts, "vhostforce", false); if (qemu_opt_get(opts, "vhostfd")) { r = net_handle_fd_param(mon, qemu_opt_get(opts, "vhostfd")); if (r == -1) { @@ -502,7 +504,7 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan } else { vhostfd = -1; } - s->vhost_net = vhost_net_init(&s->nc, vhostfd); + s->vhost_net = vhost_net_init(&s->nc, vhostfd, force); if (!s->vhost_net) { error_report("vhost-net requested but could not be initialized"); return -1; |