Skip to content
  • Eric Dumazet's avatar
    tun: use netdev_alloc_frag() in tun_napi_alloc_frags() · aa6daaca
    Eric Dumazet authored
    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: 90e33d45
    
     ("tun: enable napi_gro_frags() for TUN/TAP driver")
    Signed-off-by: default avatarEric 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: default avatarDavid S. Miller <davem@davemloft.net>
    aa6daaca