Re: [PATCH 3/3] virtio_ring: unify direct/indirect code paths.

2014-09-08 Thread Andy Lutomirski
On Sep 5, 2014 3:55 AM, "Paolo Bonzini" wrote: > > Il 03/09/2014 06:29, Rusty Russell ha scritto: > > + desc = kmalloc(total_sg * sizeof(struct vring_desc), gfp); > > + if (!desc) > > + return NULL; > > > > - return head; > > + for (i = 0; i < total_sg; i++) > > +

Re: [PATCH 3/3] virtio_ring: unify direct/indirect code paths.

2014-09-05 Thread Paolo Bonzini
Il 03/09/2014 06:29, Rusty Russell ha scritto: > + desc = kmalloc(total_sg * sizeof(struct vring_desc), gfp); > + if (!desc) > + return NULL; > > - return head; > + for (i = 0; i < total_sg; i++) > + desc[i].next = i+1; > + return desc; > } Would it m

Re: [PATCH 3/3] virtio_ring: unify direct/indirect code paths.

2014-09-04 Thread Rusty Russell
Andy Lutomirski writes: > On Tue, Sep 2, 2014 at 9:29 PM, Rusty Russell wrote: >> virtqueue_add() populates the virtqueue descriptor table from the sgs >> given. If it uses an indirect descriptor table, then it puts a single >> descriptor in the descriptor table pointing to the kmalloc'ed indire

Re: [PATCH 3/3] virtio_ring: unify direct/indirect code paths.

2014-09-03 Thread Andy Lutomirski
On Tue, Sep 2, 2014 at 9:29 PM, Rusty Russell wrote: > virtqueue_add() populates the virtqueue descriptor table from the sgs > given. If it uses an indirect descriptor table, then it puts a single > descriptor in the descriptor table pointing to the kmalloc'ed indirect > table where the sg is pop

[PATCH 3/3] virtio_ring: unify direct/indirect code paths.

2014-09-02 Thread Rusty Russell
virtqueue_add() populates the virtqueue descriptor table from the sgs given. If it uses an indirect descriptor table, then it puts a single descriptor in the descriptor table pointing to the kmalloc'ed indirect table where the sg is populated. Previously vring_add_indirect() did the allocation an