From bcbabae8ff7f7ec114da9fe2aa7f25f420f35306 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Sun, 12 Jun 2011 16:21:57 +0300 Subject: virtio: event index support Add support for event_idx feature, and utilize it to reduce the number of interrupts and exits for the guest. Signed-off-by: Michael S. Tsirkin --- hw/vhost_net.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hw/vhost_net.c') diff --git a/hw/vhost_net.c b/hw/vhost_net.c index 420e05f112..e8c9e940d9 100644 --- a/hw/vhost_net.c +++ b/hw/vhost_net.c @@ -50,6 +50,9 @@ unsigned vhost_net_get_features(struct vhost_net *net, unsigned features) if (!(net->dev.features & (1 << VIRTIO_RING_F_INDIRECT_DESC))) { features &= ~(1 << VIRTIO_RING_F_INDIRECT_DESC); } + if (!(net->dev.features & (1 << VIRTIO_RING_F_EVENT_IDX))) { + features &= ~(1 << VIRTIO_RING_F_EVENT_IDX); + } if (!(net->dev.features & (1 << VIRTIO_NET_F_MRG_RXBUF))) { features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF); } @@ -65,6 +68,9 @@ void vhost_net_ack_features(struct vhost_net *net, unsigned features) if (features & (1 << VIRTIO_RING_F_INDIRECT_DESC)) { net->dev.acked_features |= (1 << VIRTIO_RING_F_INDIRECT_DESC); } + if (features & (1 << VIRTIO_RING_F_EVENT_IDX)) { + net->dev.acked_features |= (1 << VIRTIO_RING_F_EVENT_IDX); + } if (features & (1 << VIRTIO_NET_F_MRG_RXBUF)) { net->dev.acked_features |= (1 << VIRTIO_NET_F_MRG_RXBUF); } -- cgit 1.4.1 From 35f754620615138aaae0ef72602f84c88fd8de0f Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Fri, 10 Jun 2011 00:55:57 +0400 Subject: print meaningful error message in case of --disable-vhost-net When qemu gets compiled without support of vhost-net, any attempt to use it fails with a very clear error message: qemu-system-x86_64: -netdev ...,vhost=on: vhost-net requested but could not be initialized there's absolutely no reason given _why_ it coult not be initialized, and even strace'ing the process in question does not reveal any errors. So print a message telling what's going on. Signed-off-by: Michael Tokarev Signed-off-by: Michael S. Tsirkin --- hw/vhost_net.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/vhost_net.c') diff --git a/hw/vhost_net.c b/hw/vhost_net.c index e8c9e940d9..b6dc592db0 100644 --- a/hw/vhost_net.c +++ b/hw/vhost_net.c @@ -15,6 +15,7 @@ #include "virtio-net.h" #include "vhost_net.h" +#include "qemu-error.h" #include "config.h" @@ -203,6 +204,7 @@ void vhost_net_cleanup(struct vhost_net *net) struct vhost_net *vhost_net_init(VLANClientState *backend, int devfd, bool force) { + error_report("vhost-net support is not compiled in"); return NULL; } -- cgit 1.4.1