At the moment the maximum transfer size with virtio is limited to 4M (1024 * PAGE_SIZE). This series raises this limit to its maximum theoretical possible transfer size of 128M (32k pages) according to the virtio specs:
https://docs.oasis-open.org/virtio/virtio/v1.1/cs01/virtio-v1.1-cs01.html#x1-240006 Maintainers: if you don't care about allowing users to go beyond 4M then no action is required on your side for now. This series preserves the old value of 1k for now by using VIRTQUEUE_LEGACY_MAX_SIZE on your end. If you do want to support 128M however, then replace VIRTQUEUE_LEGACY_MAX_SIZE by VIRTQUEUE_MAX_SIZE on your end (see patch 3 as example for 9pfs being the first virtio user supporting it) and make sure that this new transfer size limit is actually supported by you. Changes v1 -> v2: * Instead of simply raising VIRTQUEUE_MAX_SIZE to 32k for all virtio users, preserve the old value of 1k for all virtio users unless they explicitly opted in: https://lists.gnu.org/archive/html/qemu-devel/2021-10/msg00056.html Christian Schoenebeck (3): virtio: turn VIRTQUEUE_MAX_SIZE into a variable virtio: increase VIRTQUEUE_MAX_SIZE to 32k virtio-9p-device: switch to 32k max. transfer size hw/9pfs/virtio-9p-device.c | 3 ++- hw/block/vhost-user-blk.c | 6 +++--- hw/block/virtio-blk.c | 7 ++++--- hw/char/virtio-serial-bus.c | 2 +- hw/display/virtio-gpu-base.c | 2 +- hw/input/virtio-input.c | 2 +- hw/net/virtio-net.c | 25 ++++++++++++------------ hw/scsi/virtio-scsi.c | 2 +- hw/virtio/vhost-user-fs.c | 6 +++--- hw/virtio/vhost-user-i2c.c | 3 ++- hw/virtio/vhost-vsock-common.c | 2 +- hw/virtio/virtio-balloon.c | 4 ++-- hw/virtio/virtio-crypto.c | 3 ++- hw/virtio/virtio-iommu.c | 2 +- hw/virtio/virtio-mem.c | 2 +- hw/virtio/virtio-mmio.c | 4 ++-- hw/virtio/virtio-pmem.c | 2 +- hw/virtio/virtio-rng.c | 3 ++- hw/virtio/virtio.c | 35 +++++++++++++++++++++++----------- include/hw/virtio/virtio.h | 25 ++++++++++++++++++++++-- 20 files changed, 90 insertions(+), 50 deletions(-) -- 2.20.1