aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-backend.c
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2016-07-06 09:57:55 +0800
committerJason Wang <jasowang@redhat.com>2016-07-07 14:29:04 +0800
commit69e87b32680a41d9761191443587c595b6f5fc3f (patch)
tree683f9339d73eb1f1480672c2586e46deddbeab7e /hw/virtio/vhost-backend.c
parent91d35509903464c7f4b9ed56be223d7370d3597c (diff)
downloadqemu-69e87b32680a41d9761191443587c595b6f5fc3f.zip
qemu-69e87b32680a41d9761191443587c595b6f5fc3f.tar.gz
qemu-69e87b32680a41d9761191443587c595b6f5fc3f.tar.bz2
tap: vhost busy polling support
This patch add the capability of basic vhost net busy polling which is supported by recent kernel. User could configure the maximum number of us that could be spent on busy polling through a new property of tap "poll-us". Cc: Greg Kurz <groug@kaod.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/virtio/vhost-backend.c')
-rw-r--r--hw/virtio/vhost-backend.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
index b358902..d62372e 100644
--- a/hw/virtio/vhost-backend.c
+++ b/hw/virtio/vhost-backend.c
@@ -138,6 +138,12 @@ static int vhost_kernel_set_vring_call(struct vhost_dev *dev,
return vhost_kernel_call(dev, VHOST_SET_VRING_CALL, file);
}
+static int vhost_kernel_set_vring_busyloop_timeout(struct vhost_dev *dev,
+ struct vhost_vring_state *s)
+{
+ return vhost_kernel_call(dev, VHOST_SET_VRING_BUSYLOOP_TIMEOUT, s);
+}
+
static int vhost_kernel_set_features(struct vhost_dev *dev,
uint64_t features)
{
@@ -185,6 +191,8 @@ static const VhostOps kernel_ops = {
.vhost_get_vring_base = vhost_kernel_get_vring_base,
.vhost_set_vring_kick = vhost_kernel_set_vring_kick,
.vhost_set_vring_call = vhost_kernel_set_vring_call,
+ .vhost_set_vring_busyloop_timeout =
+ vhost_kernel_set_vring_busyloop_timeout,
.vhost_set_features = vhost_kernel_set_features,
.vhost_get_features = vhost_kernel_get_features,
.vhost_set_owner = vhost_kernel_set_owner,