virtio_net: Recycle some more rx buffer pages
authorMark McLoughlin <markmc@redhat.com>
Mon, 17 Nov 2008 06:39:18 +0000 (22:39 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Nov 2008 06:39:18 +0000 (22:39 -0800)
commit0a888fd1f6320d1d9318c58de9bca3cef41546d6
treee1ff542e6c8acba415d67a3764e4124849801805
parent908cd2dabbfbbefb02f6b908a1188a62e685136a
virtio_net: Recycle some more rx buffer pages

Each time we re-fill the recv queue with buffers, we allocate
one too many skbs and free it again when adding fails. We should
recycle the pages allocated in this case.

A previous version of this patch made trim_pages() trim trailing
unused pages from skbs with some paged data, but this actually
caused a barely measurable slowdown.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (use netdev_priv)
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c