qemu-patch-raspberry4/hw/virtio
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
..
dataplane virtio: avoid leading underscores for helpers 2015-09-10 11:06:05 +03:00
Makefile.objs dataplane: endianness-aware accesses 2015-02-16 15:07:16 +00:00
vhost-backend.c vhost: introduce vhost_backend_get_vq_index method 2015-09-24 16:27:53 +03:00
vhost-user.c vhost-user: add multiple queue support 2015-09-24 16:27:53 +03:00
vhost.c vhost-user: add multiple queue support 2015-09-24 16:27:53 +03:00
virtio-balloon.c virtio: avoid leading underscores for helpers 2015-09-10 11:06:05 +03:00
virtio-bus.c virtio: get_features() can fail 2015-07-27 18:11:53 +03:00
virtio-mmio.c virtio: allow virtio-1 queue layout 2015-06-10 18:15:04 +02:00
virtio-pci.c hw/virtio/virtio-pci: Remove meaningless blank Property 2015-09-11 11:03:42 +03:00
virtio-pci.h virtio-pci: implement cfg capability 2015-07-08 10:09:57 +03:00
virtio-rng.c virtio: get_features() can fail 2015-07-27 18:11:53 +03:00
virtio.c virtio: ring sizes vs. reset 2015-09-24 13:42:17 +03:00