aboutsummaryrefslogtreecommitdiff
path: root/net/tap.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 /net/tap.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 'net/tap.c')
-rw-r--r--net/tap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/tap.c b/net/tap.c
index 49817c7..676bad4 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -663,6 +663,11 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
options.backend_type = VHOST_BACKEND_TYPE_KERNEL;
options.net_backend = &s->nc;
+ if (tap->has_poll_us) {
+ options.busyloop_timeout = tap->poll_us;
+ } else {
+ options.busyloop_timeout = 0;
+ }
if (vhostfdname) {
vhostfd = monitor_fd_param(cur_mon, vhostfdname, &err);
@@ -687,7 +692,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
return;
}
} else if (vhostfdname) {
- error_setg(errp, "vhostfd= is not valid without vhost");
+ error_setg(errp, "vhostfd(s)= is not valid without vhost");
}
}