]> git.baikalelectronics.ru Git - kernel.git/commit
tun: use netdev_alloc_frag() in tun_napi_alloc_frags()
authorEric Dumazet <edumazet@google.com>
Sun, 18 Nov 2018 15:37:33 +0000 (07:37 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Nov 2018 03:01:11 +0000 (19:01 -0800)
commit0918d2bf4deef4460877ea2acfff2c780f00e3ef
treed685971689336d09beeedd37662ca44f0f038a86
parent509aed10b88d65f2e3a8207abdb5e60cfe9fc5c5
tun: use netdev_alloc_frag() in tun_napi_alloc_frags()

In order to cook skbs in the same way than Ethernet drivers,
it is probably better to not use GFP_KERNEL, but rather
use the GFP_ATOMIC and PFMEMALLOC mechanisms provided by
netdev_alloc_frag().

This would allow to use tun driver even in memory stress
situations, especially if swap is used over this tun channel.

Fixes: 12d2dcce0caa ("tun: enable napi_gro_frags() for TUN/TAP driver")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Petar Penkov <peterpenkov96@gmail.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c