Re: [PATCH 2/2] virtio_net: Defer skb allocation in receive path

2010-01-11 Thread Shirley Ma
On Mon, 2010-01-04 at 23:14 +0200, Michael S. Tsirkin wrote: > so it will never return NULL unless no more buffers? breaking here ad > BUG_ON(vi->num) as Amit suggests seems cleaner than looping forever if > there's a bug. Agree. I will change to break as Amit suggested and put BUG_ON and resubm

Re: [PATCH 2/2] virtio_net: Defer skb allocation in receive path

2010-01-04 Thread Michael S. Tsirkin
On Mon, Jan 04, 2010 at 01:25:44PM -0800, Shirley Ma wrote: > Hello Amit, > > Sorry for late response. I am just back from vacation. > > On Thu, 2009-12-24 at 19:07 +0530, Amit Shah wrote: > > > +static void free_unused_bufs(struct virtnet_info *vi) > > > +{ > > > + void *buf; > > > + whi

Re: [PATCH 2/2] virtio_net: Defer skb allocation in receive path

2010-01-04 Thread Shirley Ma
Hello Amit, Sorry for late response. I am just back from vacation. On Thu, 2009-12-24 at 19:07 +0530, Amit Shah wrote: > > +static void free_unused_bufs(struct virtnet_info *vi) > > +{ > > + void *buf; > > + while (vi->num) { > > + buf = vi->rvq->vq_ops->detach_unused_buf(vi->

Re: [PATCH 2/2] virtio_net: Defer skb allocation in receive path

2009-12-24 Thread Amit Shah
On (Thu) Dec 17 2009 [23:44:49], Shirley Ma wrote: > virtio_net receives packets from its pre-allocated vring buffers, then it > delivers these packets to upper layer protocols as skb buffs. So it's not > necessary to pre-allocate skb for each mergable buffer, then frees extra > skbs when buffers

[PATCH 2/2] virtio_net: Defer skb allocation in receive path

2009-12-17 Thread Shirley Ma
virtio_net receives packets from its pre-allocated vring buffers, then it delivers these packets to upper layer protocols as skb buffs. So it's not necessary to pre-allocate skb for each mergable buffer, then frees extra skbs when buffers are merged into a large packet. This patch has deferred s