From patchwork Wed Jul 18 15:07:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,v9,13/27] virtio-blk: Increase max requests for indirect vring Date: Wed, 18 Jul 2012 05:07:40 -0000 From: Stefan Hajnoczi X-Patchwork-Id: 171734 Message-Id: <1342624074-24650-14-git-send-email-stefanha@linux.vnet.ibm.com> To: Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , kvm@vger.kernel.org, "Michael S. Tsirkin" , Khoa Huynh , Paolo Bonzini , Asias He 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 {