tuntap: free XDP dropped packets in a batch
authorJason Wang <jasowang@redhat.com>
Thu, 15 Nov 2018 09:43:10 +0000 (17:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 17 Nov 2018 20:00:42 +0000 (12:00 -0800)
commitf9e06c45cb28beb30a6a474952ead7da2b8940f3
tree79fab6c861635c5e1ce325de2e867481ad83a61c
parente4dab1e6ea64376ebd3b59281ecaaeb788116be3
tuntap: free XDP dropped packets in a batch

Thanks to the batched XDP buffs through msg_control. Instead of
calling put_page() for each page which involves a atomic operation,
let's batch them by record the last page that needs to be freed and
its refcnt count and free them in a batch.

Testpmd(virtio-user + vhost_net) + XDP_DROP shows 3.8% improvement.

Before: 4.71Mpps
After : 4.89Mpps

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c