]> git.proxmox.com Git - mirror_qemu.git/commit
vhost: multiqueue support
authorJason Wang <jasowang@redhat.com>
Wed, 30 Jan 2013 11:12:35 +0000 (19:12 +0800)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 1 Feb 2013 17:03:02 +0000 (11:03 -0600)
commita9f98bb5ebe6fb1869321dcc58e72041ae626ad8
treefe66f183e45763207d12f5298fb8d8d9e3911228
parent264986e2c8f14a0f4a32ac6f1e083905833a5fc7
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>
hw/vhost.c
hw/vhost.h
hw/vhost_net.c
hw/vhost_net.h
hw/virtio-net.c