virtio-net: fix page miscount during XDP linearizing
authorJason Wang <jasowang@redhat.com>
Fri, 23 Dec 2016 14:37:26 +0000 (22:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Dec 2016 18:48:54 +0000 (13:48 -0500)
commit56a86f84b8332afe8c6fcb4b09d09d9bf094e2db
treeae161601bc78368c4dcbc2adc6c9d45932f33c1b
parent275be061b33b945cfb120ee8a570f78c3ccafe56
virtio-net: fix page miscount during XDP linearizing

We don't put page during linearizing, the would cause leaking when
xmit through XDP_TX or the packet exceeds PAGE_SIZE. Fix them by
put page accordingly. Also decrease the number of buffers during
linearizing to make sure caller can free buffers correctly when packet
exceeds PAGE_SIZE. With this patch, we won't get OOM after linearize
huge number of packets.

Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c