]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/net/virtio_net.c
virtio-net: use per-receive queue page frag alloc for mergeable bufs
authorMichael Dalton <mwdalton@google.com>
Fri, 17 Jan 2014 06:23:26 +0000 (22:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jan 2014 07:46:06 +0000 (23:46 -0800)
commitfb51879dbceab9c40a39018d5322451691909e15
tree918a386730836c9704728b05cee5b8b10764a335
parent097b4f19e508015ca65a28ea4876740d35a19eea
virtio-net: use per-receive queue page frag alloc for mergeable bufs

The virtio-net driver currently uses netdev_alloc_frag() for GFP_ATOMIC
mergeable rx buffer allocations. This commit migrates virtio-net to use
per-receive queue page frags for GFP_ATOMIC allocation. This change unifies
mergeable rx buffer memory allocation, which now will use skb_refill_frag()
for both atomic and GFP-WAIT buffer allocations.

To address fragmentation concerns, if after buffer allocation there
is too little space left in the page frag to allocate a subsequent
buffer, the remaining space is added to the current allocated buffer
so that the remaining space can be used to store packet data.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael Dalton <mwdalton@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c