From patchwork Mon Oct 4 19:38:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Schoenebeck X-Patchwork-Id: 12534735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AD54C433F5 for ; Mon, 4 Oct 2021 20:12:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4629F61409 for ; Mon, 4 Oct 2021 20:12:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4629F61409 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=crudebyte.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:43892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXUKI-0003uC-DG for qemu-devel@archiver.kernel.org; Mon, 04 Oct 2021 16:12:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXUFz-0005fe-Oa; Mon, 04 Oct 2021 16:08:15 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:47225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXUFx-00019T-8v; Mon, 04 Oct 2021 16:08:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Content-ID: Content-Description; bh=WLafEToa0pRZAOaZ33ttmtTNXix/ukq0+Ud6g4Kwog8=; b=Y8g39 FcwlCG0LAADLEUoQanvWxbFJ7uPsVT9VHZiIf3kTyVgYkbJOS+vBuJKg1o6HQOpfzTYIqaY90/f7E 1ELsGqE8AD9LJmE/p6k6lyTNHzF0mOhT8Dsvjp9tSGJiQcNfTbGU2GO6EwJrcpZUD8oMhsI3BNPTm HAXHWZ7q2IJvT7mk8R5WJWdrcvqoMjE4cdPAarE+Hg9hnvpU5KkxM8Khs+UDa91Qrn07JkLogqjFe FwPiBBHzFwcJllzK/g3DkkvVhZMGh6oCf0GQXHt9llvPdrvQiTzgX89NwcSif4qr7g6p+2OJLRjtx uFajbQQGhLGu4eeyzvJ6H2KQxhTNQ==; Message-Id: From: Christian Schoenebeck Date: Mon, 4 Oct 2021 21:38:00 +0200 Subject: [PATCH v2 0/3] virtio: increase VIRTQUEUE_MAX_SIZE to 32k To: qemu-devel@nongnu.org Cc: =?unknown-8bit?b?Ik1pY2hhZWwgUy4gVHNpcmtpbiIgPG1zdEByZWRoYXQuY29tPiw=?= =?unknown-8bit?q?_Greg_Kurz_=3Cgroug=40kaod=2Eorg=3E=2C?= =?unknown-8bit?q?_Raphael_Norwitz_=3Craphael=2Enorwitz=40nutanix=2Ecom=3E=2C?= =?unknown-8bit?q?_Kevin_Wolf_=3Ckwolf=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_Hanna_Reitz_=3Chreitz=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_Stefan_Hajnoczi_=3Cstefanha=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_Laurent_Vivier_=3Clvivier=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_Amit_Shah_=3Camit=40kernel=2Eorg=3E=2C?= =?unknown-8bit?q?_=22Marc-Andr=C3=A9_Lureau=22_=3Cmarcandre=2Elureau=40redha?= =?unknown-8bit?q?t=2Ecom=3E=2C?= =?unknown-8bit?q?_Paolo_Bonzini_=3Cpbonzini=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_Gerd_Hoffmann_=3Ckraxel=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_Jason_Wang_=3Cjasowang=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_Fam_Zheng_=3Cfam=40euphon=2Enet=3E=2C?= =?unknown-8bit?q?_=22Dr=2E_David_Alan_Gilbert=22_=3Cdgilbert=40redhat=2Ecom?= =?unknown-8bit?q?=3E=2C?= =?unknown-8bit?q?_David_Hildenbrand_=3Cdavid=40redhat=2Ecom=3E=2C?= =?unknown-8bit?b?ICJHb25nbGVpIChBcmVpKSIgPGFyZWkuZ29uZ2xlaUBodWF3ZWkuY29t?= =?unknown-8bit?b?Piw=?= =?unknown-8bit?q?_Eric_Auger_=3Ceric=2Eauger=40redhat=2Ecom=3E=2C?= =?unknown-8bit?q?_qemu-block=40nongnu=2Eorg=2C?= =?unknown-8bit?q?_virtio-fs=40redhat=2Ecom?= Received-SPF: none client-ip=91.194.90.13; envelope-from=ae0464f653ef20292e335ba3de0d62ab3ce8c72c@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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(-)