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 are merged into a large packet. This patch has deferred > skb allocation in receiving packets for both big packets and mergeable buffers > to reduce skb pre-allocations and skb frees. It frees unused buffers by calling > detach_unused_buf in vring, so recv skb queue is not needed. > > Signed-off-by: Shirley Ma <xma@xxxxxxxxxx> ... > +static void free_unused_bufs(struct virtnet_info *vi) > +{ > + void *buf; > + while (vi->num) { > + buf = vi->rvq->vq_ops->detach_unused_buf(vi->rvq); > + if (!buf) > + continue; Do you mean 'break' here? > + if (vi->mergeable_rx_bufs || vi->big_packets) > + give_pages(vi, buf); > + else > + dev_kfree_skb(buf); > + --vi->num; > + } > +} > + Amit -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html