qemu/include
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
..
authz Include generated QAPI headers less 2019-08-16 13:31:51 +02:00
block block/snapshot: rename Error ** parameter to more common errp 2019-12-18 08:43:19 +01:00
chardev Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
crypto crypto: Fix typo in QCryptoTLSSession's <example> comment 2019-12-18 08:36:15 +01:00
disas plugin: add qemu_plugin_insn_disas helper 2019-10-28 15:12:38 +00:00
exec Various testing and logging updates 2019-12-20 14:00:49 +00:00
fpu fpu: make softfloat-macros "self-contained" 2019-08-19 12:07:13 +01:00
hw virtio: make seg_max virtqueue size dependent 2020-01-06 12:04:43 -05:00
io io: Fix Error usage in a comment <example> 2019-12-18 08:36:15 +01:00
libdecnumber include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
migration migration: add new migration state wait-unplug 2019-10-29 18:55:26 -04:00
monitor hmp: drop Error pointer indirection in hmp_handle_error 2019-12-18 08:36:16 +01:00
net Include qemu/queue.h slightly less 2019-08-16 13:31:52 +02:00
qapi error: make Error **errp const where it is appropriate 2019-12-18 08:36:16 +01:00
qemu Various testing and logging updates 2019-12-20 14:00:49 +00:00
qom * More uses of RCU_READ_LOCK_GUARD (Dave, myself) 2019-12-20 11:20:25 +00:00
scsi scsi: explicitly list guest-recoverable sense codes 2019-07-15 11:20:42 +02:00
standard-headers linux-headers: Update 2019-12-17 10:39:48 +11:00
sysemu numa: Extend CLI to provide memory side cache information 2020-01-05 07:03:03 -05:00
ui ui/egl: fix framebuffer reads 2019-09-17 13:42:02 +02:00
user *-user: plugin syscalls 2019-10-28 15:12:38 +00:00
elf.h linux-user: elf: ELF_HWCAP for s390x 2019-06-07 14:53:26 +02:00
glib-compat.h glib: bump min required glib library version to 2.48 2019-08-22 10:46:34 +01:00
qemu-common.h exec: Split out variable page size support to exec-vary.c 2019-10-28 10:26:02 +01:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-tcg.h