diff options
author | mst@redhat.com <mst@redhat.com> | 2011-02-01 22:13:42 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-02-01 16:50:44 -0600 |
commit | 5430a28fe452907c9e1b2097e073bc1ea4b29f39 (patch) | |
tree | 066db9fdbac5a5ddca922b5d282161e9b6141b0e /hw/virtio-pci.c | |
parent | f157ed202e51dc2492b201dc34ed28e89c973fb7 (diff) |
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 'hw/virtio-pci.c')
-rw-r--r-- | hw/virtio-pci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index d07ff976be..3911b09b07 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -595,6 +595,12 @@ static int virtio_pci_set_guest_notifier(void *opaque, int n, bool assign) return 0; } +static bool virtio_pci_query_guest_notifiers(void *opaque) +{ + VirtIOPCIProxy *proxy = opaque; + return msix_enabled(&proxy->pci_dev); +} + static int virtio_pci_set_guest_notifiers(void *opaque, bool assign) { VirtIOPCIProxy *proxy = opaque; @@ -658,6 +664,7 @@ static const VirtIOBindings virtio_pci_bindings = { .save_queue = virtio_pci_save_queue, .load_queue = virtio_pci_load_queue, .get_features = virtio_pci_get_features, + .query_guest_notifiers = virtio_pci_query_guest_notifiers, .set_host_notifier = virtio_pci_set_host_notifier, .set_guest_notifiers = virtio_pci_set_guest_notifiers, .vmstate_change = virtio_pci_vmstate_change, |