From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsD1P-0000CW-EQ for qemu-devel@nongnu.org; Fri, 30 Oct 2015 12:59:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsD1M-0003Uz-7R for qemu-devel@nongnu.org; Fri, 30 Oct 2015 12:59:23 -0400 Date: Fri, 30 Oct 2015 16:59:17 +0000 From: Stefan Hajnoczi Message-ID: <20151030165917.GA19817@stefanha-x1.localdomain> References: <1446047243-3221-1-git-send-email-mst@redhat.com> <20151029112805.2bd08e0f@igors-macbook-pro.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <20151029112805.2bd08e0f@igors-macbook-pro.local> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] dataplane: simplify indirect descriptor read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi , "Michael S. Tsirkin" --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 29, 2015 at 11:28:05AM +0100, Igor Mammedov wrote: > On Wed, 28 Oct 2015 17:48:02 +0200 > "Michael S. Tsirkin" wrote: > > - struct vring_desc *desc_ptr; > > - MemoryRegion *mr; > > - > > /* Translate indirect descriptor */ > > - desc_ptr =3D vring_map(&mr, > > - indirect->addr + found * sizeof(desc), > Is it correct to use 'found' as iterator here vs using desc.next > as is done when translating direct descriptors? That is how Linux drivers/vhost/vhost.c:get_indirect() does it. QEMU hw/virtio/virtio.c honors desc.next. The VIRTIO 1.0 specification says: The =EF=AC=81rst indirect descriptor is located at start of the indirect descriptor table (index 0), additional indirect descriptors are chained by next =EF=AC=81eld. I think vhost and dataplane do not follow the specification here. Fixing it is for a separate patch series. Stefan --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJWM6HlAAoJEJykq7OBq3PIX+cIAKHOQSUghXdo3Fn8UaJfNXYQ fy+vBnDjhtRIP01igtIZ7h+AJeZeipny1viV4BpLUYVvT9vnPm5yZBZPxOCEPZvD laPrbhJ8NV6tyvsq3NSBlKennl72l8FwseyRVa8Gw+zu7zgI+jyWfphOw6HAXqUP ua02J47ZL+VbhcmmSXqsSWkJ6B1h/GMSP5jp37aMlElWsvj5PeWDb/SqXr0Dc7yv onbAluBN2jk/8ZZg8rMY2rozLJH46YW1b0chorM4We+UmpiV5cuUwekKQJBZosT0 Nv4tEVF64u5LixMRFBkENdZ5wKLOYzx93D/N9F3AJxS/KhH0ytYNTpDyrtV5eYc= =HMXn -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn--