From patchwork Wed Jul 18 15:07:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 171734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A9E542C0096 for ; Thu, 19 Jul 2012 02:01:37 +1000 (EST) Received: from localhost ([::1]:37163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrVsn-0007hA-HP for incoming@patchwork.ozlabs.org; Wed, 18 Jul 2012 11:09:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrVrl-0005VD-55 for qemu-devel@nongnu.org; Wed, 18 Jul 2012 11:08:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SrVrk-0000k7-3I for qemu-devel@nongnu.org; Wed, 18 Jul 2012 11:08:41 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:49677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SrVrj-0000jz-QB for qemu-devel@nongnu.org; Wed, 18 Jul 2012 11:08:40 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Jul 2012 16:08:39 +0100 Received: from d06nrmr1507.portsmouth.uk.ibm.com (9.149.38.233) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 18 Jul 2012 16:08:36 +0100 Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6IF8ZFM2412642 for ; Wed, 18 Jul 2012 16:08:35 +0100 Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6IF8Zcu013334 for ; Wed, 18 Jul 2012 09:08:35 -0600 Received: from localhost (sig-9-145-185-169.de.ibm.com [9.145.185.169]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6IF8Yx5013316; Wed, 18 Jul 2012 09:08:34 -0600 From: Stefan Hajnoczi To: Date: Wed, 18 Jul 2012 16:07:40 +0100 Message-Id: <1342624074-24650-14-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1342624074-24650-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1342624074-24650-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12071815-8372-0000-0000-00000339CE0E X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.108 Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , kvm@vger.kernel.org, "Michael S. Tsirkin" , Khoa Huynh , Paolo Bonzini , Asias He Subject: [Qemu-devel] [RFC v9 13/27] virtio-blk: Increase max requests for indirect vring X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org With indirect vring descriptors, one can no longer assume that the maximum number of requests is VRING_MAX / 2 (outhdr and inhdr). Now a single indirect descriptor can contain the outhdr and inhdr so max requests becomes VRING_MAX. Signed-off-by: Stefan Hajnoczi --- hw/virtio-blk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 591eace..7ae3c56 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -26,7 +26,9 @@ enum { SEG_MAX = 126, /* maximum number of I/O segments */ VRING_MAX = SEG_MAX + 2, /* maximum number of vring descriptors */ - REQ_MAX = VRING_MAX / 2, /* maximum number of requests in the vring */ + REQ_MAX = VRING_MAX, /* maximum number of requests in the vring, + * is VRING_MAX / 2 with traditional and + * VRING_MAX with indirect descriptors */ }; typedef struct {