[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALCETrUY1=jkJTQvCLSSOYw5O9M2N3o1AiT9AnzYE3zQU319TQ@mail.gmail.com>
Date: Mon, 8 Sep 2014 10:32:07 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: "Michael S. Tsirkin" <mst@...hat.com>,
Linux Virtualization <virtualization@...ts.linux-foundation.org>,
netdev <netdev@...r.kernel.org>,
Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH 3/3] virtio_ring: unify direct/indirect code paths.
On Sep 5, 2014 3:55 AM, "Paolo Bonzini" <pbonzini@...hat.com> 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++)
> > + desc[i].next = i+1;
> > + return desc;
> > }
>
> Would it make sense to keep a cache of a few (say) 8- or 16-element
> indirect descriptors? You'd only have to do this ugly (and slowish) for
> loop on the first allocation.
>
> Also, since this is mostly an aesthetic patch,
>
> > + if (indirect)
> > + vq->free_head = vq->vring.desc[head].next;
> > + else
> > + vq->free_head = i;
>
> I'd move the indirect case above, where the vring.desc[head] is actually
> allocated.
>
Please don't: I'll just have to undo it for the DMA API stuff, since
descriptor setup will be able to fail.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists