Skip to contentSkip to conversation

value of VIRTQUEUE_MAX_SIZE

Qemu-devel Peter Lieven 4 participants 6 messages Jan 30, 2015 – Feb 6, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

Just wondering if VIRTQUEUE_MAX_SIZE in include/hw/virtio/virtio.h should not be equal to IOV_MAX instead of the hardcoded 1024?

Thanks,
Peter

#1 lore raw
Quoted 1 line · Peter Lieven

Just wondering if VIRTQUEUE_MAX_SIZE in include/hw/virtio/virtio.h should not be equal to IOV_MAX instead of the hardcoded 1024?

The vring queue size is guest-visible to some extent (e.g. vring memory layout). Tying it to a constant that is defined by the host operating system could lead to problems (e.g. live migration between different hosts).

Anyway, all of the virtio devices have a queue size that is less than or equal to VIRTQUEUE_MAX_SIZE (and there is an assertion to check this in virtio_add_queue()).

Guests are supposed to honor the vring queue size, although indirect descriptors seem to be able to use up to VIRTQUEUE_MAX_SIZE according to my understanding of QEMU's virtio.c code.

Why would you like to use IOV_MAX?

Stefan

#2 lore raw

Am 05.02.2015 um 15:00 schrieb Stefan Hajnoczi:

Quoted 11 lines · Peter Lieven
Quoted 1 line

Just wondering if VIRTQUEUE_MAX_SIZE in include/hw/virtio/virtio.h should not be equal to IOV_MAX instead of the hardcoded 1024?

The vring queue size is guest-visible to some extent (e.g. vring memory layout). Tying it to a constant that is defined by the host operating system could lead to problems (e.g. live migration between different hosts).

Anyway, all of the virtio devices have a queue size that is less than or equal to VIRTQUEUE_MAX_SIZE (and there is an assertion to check this in virtio_add_queue()).

Quoted 5 lines

Guests are supposed to honor the vring queue size, although indirect descriptors seem to be able to use up to VIRTQUEUE_MAX_SIZE according to my understanding of QEMU's virtio.c code.

Why would you like to use IOV_MAX?

The idea was that IOV_MAX is the limit in case of at least virtio-blk. The host will not support more than IOV_MAX iovecs passed to a block request.

Peter

#3 lore raw
Quoted 12 lines · Peter Lieven

Am 05.02.2015 um 15:00 schrieb Stefan Hajnoczi:

Quoted 11 lines · Peter Lieven
Quoted 1 line

Just wondering if VIRTQUEUE_MAX_SIZE in include/hw/virtio/virtio.h should not be equal to IOV_MAX instead of the hardcoded 1024?

The vring queue size is guest-visible to some extent (e.g. vring memory layout). Tying it to a constant that is defined by the host operating system could lead to problems (e.g. live migration between different hosts).

Anyway, all of the virtio devices have a queue size that is less than or equal to VIRTQUEUE_MAX_SIZE (and there is an assertion to check this in virtio_add_queue()).

Quoted 8 lines
Quoted 5 lines

Guests are supposed to honor the vring queue size, although indirect descriptors seem to be able to use up to VIRTQUEUE_MAX_SIZE according to my understanding of QEMU's virtio.c code.

Why would you like to use IOV_MAX?

The idea was that IOV_MAX is the limit in case of at least virtio-blk. The host will not support more than IOV_MAX iovecs passed to a block request.

Is there an issue in practice?

Stefan

#4 lore raw

Am 06.02.2015 um 11:42 schrieb Stefan Hajnoczi:

Quoted 13 lines · Peter Lieven
Quoted 12 lines

Am 05.02.2015 um 15:00 schrieb Stefan Hajnoczi:

Quoted 11 lines · Peter Lieven
Quoted 1 line

Just wondering if VIRTQUEUE_MAX_SIZE in include/hw/virtio/virtio.h should not be equal to IOV_MAX instead of the hardcoded 1024?

The vring queue size is guest-visible to some extent (e.g. vring memory layout). Tying it to a constant that is defined by the host operating system could lead to problems (e.g. live migration between different hosts).

Anyway, all of the virtio devices have a queue size that is less than or equal to VIRTQUEUE_MAX_SIZE (and there is an assertion to check this in virtio_add_queue()).

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

Guests are supposed to honor the vring queue size, although indirect descriptors seem to be able to use up to VIRTQUEUE_MAX_SIZE according to my understanding of QEMU's virtio.c code.

Why would you like to use IOV_MAX?

The idea was that IOV_MAX is the limit in case of at least virtio-blk. The host will not support more than IOV_MAX iovecs passed to a block request.

Is there an issue in practice?

If there is no platform where IOV_MAX is less than 1024 then not.

Peter

#5 lore raw
Quoted 5 lines · Peter Lieven
Quoted 3 lines
Quoted 2 lines

The idea was that IOV_MAX is the limit in case of at least virtio-blk. The host will not support more than IOV_MAX iovecs passed to a block request.

Is there an issue in practice?

If there is no platform where IOV_MAX is less than 1024 then not.

POSIX allows for a system with IOV_MAX as small as 16. But these days, systems we care about probably have a much larger value; alas, I don't know off-hand what actual systems use to say if 1024 is a common minimum.

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org