mirror_qemu/include/hw/virtio
Denis Plotnikov 1bf8a989a5 virtio: make seg_max virtqueue size dependent
Before the patch, seg_max parameter was immutable and hardcoded
to 126 (128 - 2) without respect to queue size. This has two negative effects:

1. when queue size is < 128, we have Virtio 1.1 specfication violation:
   (2.6.5.3.1 Driver Requirements) seq_max must be <= queue_size.
   This violation affects the old Linux guests (ver < 4.14). These guests
   crash on these queue_size setups.

2. when queue_size > 128, as was pointed out by Denis Lunev <den@virtuozzo.com>,
   seg_max restrics guest's block request length which affects guests'
   performance making them issues more block request than needed.
   https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg03721.html

To mitigate this two effects, the patch adds the property adjusting seg_max
to queue size automaticaly. Since seg_max is a guest visible parameter,
the property is machine type managable and allows to choose between
old (seg_max = 126 always) and new (seg_max = queue_size - 2) behaviors.

Not to change the behavior of the older VMs, prevent setting the default
seg_max_adjust value for older machine types.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com>
Message-Id: <20191220140905.1718-2-dplotnikov@virtuozzo.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-01-06 12:04:43 -05:00
..
vhost-backend.h vhost-user: add vhost_user_gpu_set_socket() 2019-05-29 06:29:07 +02:00
vhost-scsi-common.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
vhost-scsi.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
vhost-user-blk.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
vhost-user-fs.h vhost-user-fs: remove "vhostfd" property 2019-12-13 10:38:58 +00:00
vhost-user-scsi.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
vhost-user.h vhost-user: simplify vhost_user_init/vhost_user_cleanup 2019-03-12 21:22:31 -04:00
vhost-vsock.h Clean up ill-advised or unusual header guards 2019-05-13 08:58:55 +02:00
vhost.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
virtio-access.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
virtio-balloon.h virtio-balloon: Use temporary PBP only 2019-07-25 07:58:03 -04:00
virtio-blk.h virtio: make seg_max virtqueue size dependent 2020-01-06 12:04:43 -05:00
virtio-bus.h Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
virtio-crypto.h Clean up ill-advised or unusual header guards 2019-05-13 08:58:55 +02:00
virtio-gpu-bswap.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
virtio-gpu-pci.h hw/display: add vhost-user-vga & gpu-pci 2019-05-29 06:30:45 +02:00
virtio-gpu-pixman.h virtio-gpu: add a pixman helper header 2019-05-29 06:29:07 +02:00
virtio-gpu.h edid: flip the default to enabled 2019-06-13 09:34:50 +02:00
virtio-input.h Add vhost-user-input-pci 2019-05-10 14:52:47 +02:00
virtio-mmio.h hw/virtio: Factorize virtio-mmio headers 2019-10-22 09:38:42 +02:00
virtio-net.h net/virtio: add failover support 2019-10-29 18:55:26 -04:00
virtio-pmem.h Include sysemu/hostmem.h less 2019-08-16 13:31:53 +02:00
virtio-rng.h virtio-rng: Keep the default backend out of VirtIORNGConf 2019-09-04 06:32:51 -04:00
virtio-scsi.h virtio: make seg_max virtqueue size dependent 2020-01-06 12:04:43 -05:00
virtio-serial.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
virtio.h virtio: don't enable notifications during polling 2020-01-05 07:03:03 -05:00