summaryrefslogtreecommitdiff
path: root/hw/vhost.h
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-01-30 19:12:35 +0800
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-01 11:03:02 -0600
commita9f98bb5ebe6fb1869321dcc58e72041ae626ad8 (patch)
treefe66f183e45763207d12f5298fb8d8d9e3911228 /hw/vhost.h
parent264986e2c8f14a0f4a32ac6f1e083905833a5fc7 (diff)
vhost: multiqueue support
This patch lets vhost support multiqueue. The idea is simple, just launching multiple threads of vhost and let each of vhost thread processing a subset of the virtqueues of the device. After this change each emulated device can have multiple vhost threads as its backend. To do this, a virtqueue index were introduced to record to first virtqueue that will be handled by this vhost_net device. Based on this and nvqs, vhost could calculate its relative index to setup vhost_net device. Since we may have many vhost/net devices for a virtio-net device. The setting of guest notifiers were moved out of the starting/stopping of a specific vhost thread. The vhost_net_{start|stop}() were renamed to vhost_net_{start|stop}_one(), and a new vhost_net_{start|stop}() were introduced to configure the guest notifiers and start/stop all vhost/vhost_net devices. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/vhost.h')
-rw-r--r--hw/vhost.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/vhost.h b/hw/vhost.h
index 44c61a5877..f062d48807 100644
--- a/hw/vhost.h
+++ b/hw/vhost.h
@@ -35,6 +35,8 @@ struct vhost_dev {
MemoryRegionSection *mem_sections;
struct vhost_virtqueue *vqs;
int nvqs;
+ /* the first virtuque which would be used by this vhost dev */
+ int vq_index;
unsigned long long features;
unsigned long long acked_features;
unsigned long long backend_features;