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" <m...@redhat.com> wrote: > > - struct vring_desc *desc_ptr; > > - MemoryRegion *mr; > > - > > /* Translate indirect descriptor */ > > - desc_ptr = 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 first indirect descriptor is located at start of the indirect descriptor table (index 0), additional indirect descriptors are chained by next field. I think vhost and dataplane do not follow the specification here. Fixing it is for a separate patch series. Stefan
signature.asc
Description: PGP signature