diff options
author | Victor Kaplansky <victork@redhat.com> | 2016-02-18 16:12:23 +0200 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:45:29 -0600 |
commit | 74075250ca54b7afc8677715413068ec596b46c2 (patch) | |
tree | d14643d6712493fe0736009f4a13f3ac3cb544bd /hw/net | |
parent | 4492eb6610f9dcefeb7ec4c61c4122658f57dbf2 (diff) | |
download | hqemu-74075250ca54b7afc8677715413068ec596b46c2.zip hqemu-74075250ca54b7afc8677715413068ec596b46c2.tar.gz |
vhost-user interrupt management fixes
Since guest_mask_notifier can not be used in vhost-user mode due
to buffering implied by unix control socket, force
use_mask_notifier on virtio devices of vhost-user interfaces, and
send correct callfd to the guest at vhost start.
Using guest_notifier_mask function in vhost-user case may
break interrupt mask paradigm, because mask/unmask is not
really done when returning from guest_notifier_mask call, instead
message is posted in a unix socket, and processed later.
Add an option boolean flag 'use_mask_notifier' to disable the use
of guest_notifier_mask in virtio pci.
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Victor Kaplansky <victork@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/vhost_net.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index b242832..6e1032f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -284,8 +284,19 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, } for (i = 0; i < total_queues; i++) { - vhost_net_set_vq_index(get_vhost_net(ncs[i].peer), i * 2); - } + struct vhost_net *net; + + net = get_vhost_net(ncs[i].peer); + vhost_net_set_vq_index(net, i * 2); + + /* Suppress the masking guest notifiers on vhost user + * because vhost user doesn't interrupt masking/unmasking + * properly. + */ + if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER) { + dev->use_guest_notifier_mask = false; + } + } r = k->set_guest_notifiers(qbus->parent, total_queues * 2, true); if (r < 0) { |