qemu/hw
Changchun Ouyang b931bfbf04 vhost-user: add multiple queue support
This patch is initially based a patch from Nikolay Nikolaev.

This patch adds vhost-user multiple queue support, by creating a nc
and vhost_net pair for each queue.

Qemu exits if find that the backend can't support the number of requested
queues (by providing queues=# option). The max number is queried by a
new message, VHOST_USER_GET_QUEUE_NUM, and is sent only when protocol
feature VHOST_USER_PROTOCOL_F_MQ is present first.

The max queue check is done at vhost-user initiation stage. We initiate
one queue first, which, in the meantime, also gets the max_queues the
backend supports.

In older version, it was reported that some messages are sent more times
than necessary. Here we came an agreement with Michael that we could
categorize vhost user messages to 2 types: non-vring specific messages,
which should be sent only once, and vring specific messages, which should
be sent per queue.

Here I introduced a helper function vhost_user_one_time_request(), which
lists following messages as non-vring specific messages:

        VHOST_USER_SET_OWNER
        VHOST_USER_RESET_DEVICE
        VHOST_USER_SET_MEM_TABLE
        VHOST_USER_GET_QUEUE_NUM

For above messages, we simply ignore them when they are not sent the first
time.

Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Tested-by: Marcel Apfelbaum <marcel@redhat.com>
2015-09-24 16:27:53 +03:00
..
9pfs
acpi
alpha Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
arm Revert use of DEFINE_MACHINE() for registrations of multiple machines 2015-09-19 16:40:27 +02:00
audio typofixes - v4 2015-09-11 10:45:43 +03:00
block Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
bt maint: avoid useless "if (foo) free(foo)" pattern 2015-09-11 10:21:38 +03:00
char maint: avoid useless "if (foo) free(foo)" pattern 2015-09-11 10:21:38 +03:00
core Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
cpu hw/cpu/{a15mpcore, a9mpcore}: Handle missing has_el3 CPU props gracefully 2015-09-14 14:39:49 +01:00
cris Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
display Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
dma * Support for jemalloc 2015-09-14 16:13:16 +01:00
gpio i.MX: Add GPIO device 2015-09-14 14:39:49 +01:00
i2c i.MX: Add I2C controller emulator 2015-09-07 10:39:30 +01:00
i386 pc: Introduce pc-*-2.5 machine classes 2015-09-24 13:42:00 +03:00
ide ahci: clean up initial d2h semantics 2015-09-18 10:58:56 -04:00
input Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
intc typofixes - v4 2015-09-11 10:45:43 +03:00
ipack
isa i8257: remove cpu_request_exit irq 2015-09-09 15:34:53 +02:00
lm32 Revert use of DEFINE_MACHINE() for registrations of multiple machines 2015-09-19 16:40:27 +02:00
m68k Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
mem
microblaze Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
mips Revert use of DEFINE_MACHINE() for registrations of multiple machines 2015-09-19 16:40:27 +02:00
misc mac_dbdma: always clear FLUSH bit once DBDMA channel flush is complete 2015-09-20 22:48:38 +02:00
moxie Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
net vhost-user: add multiple queue support 2015-09-24 16:27:53 +03:00
nvram maint: avoid useless "if (foo) free(foo)" pattern 2015-09-11 10:21:38 +03:00
openrisc Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
pci Fix bad error handling after memory_region_init_ram() 2015-09-18 14:39:29 +02:00
pci-bridge
pci-host PPC: e500 pci host: Fix ATMUs register reads 2015-09-20 22:48:39 +02:00
pcmcia
ppc sPAPR: Enable EEH on VFIO PCI device only 2015-09-23 10:51:11 +10:00
s390x virtio-ccw: enable virtio-1 2015-09-24 13:42:17 +03:00
scsi * Support for jemalloc 2015-09-14 16:13:16 +01:00
sd typofixes - v4 2015-09-11 10:45:43 +03:00
sh4 Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
smbios smbios: add smbios 3.0 support 2015-09-07 10:39:28 +01:00
sparc Revert use of DEFINE_MACHINE() for registrations of multiple machines 2015-09-19 16:40:27 +02:00
sparc64 Revert use of DEFINE_MACHINE() for registrations of multiple machines 2015-09-19 16:40:27 +02:00
ssi arm: Use g_new() & friends where that makes obvious sense 2015-09-07 10:39:27 +01:00
timer i.MX: KZM: use standalone i.MX31 SOC support 2015-09-07 10:39:30 +01:00
tpm maint: remove unused include for dirent.h 2015-09-11 10:21:38 +03:00
tricore Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
unicore32 Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
usb maint: avoid useless "if (foo) free(foo)" pattern 2015-09-11 10:21:38 +03:00
vfio vfio/pci: Add emulated PCI IDs 2015-09-23 13:04:49 -06:00
virtio vhost-user: add multiple queue support 2015-09-24 16:27:53 +03:00
watchdog i6300esb: fix timer overflow 2015-09-11 10:21:38 +03:00
xen typofixes - v4 2015-09-11 10:45:43 +03:00
xenpv Use DEFINE_MACHINE() to register all machines 2015-09-19 16:40:15 +02:00
xtensa Revert use of DEFINE_MACHINE() for registrations of multiple machines 2015-09-19 16:40:27 +02:00
Makefile.objs