Use the per-CPU NAPI cache for SKB allocation, leveraging bulk allocation since the batch size is known at submission time. This improves efficiency by reducing allocation overhead, particularly when using IFF_NAPI and GRO, which can replenish the cache in a tight loop. Additionally, utilize napi_build_skb and napi_consume_skb to further benefit from the NAPI cache. Note: This series does not address the large payload path in tun_alloc_skb, which spans sock.c and skbuff.c. A separate series will handle privatizing the allocation code in tun and integrating the NAPI cache for that path. Thanks all, Jon Jon Kohler (4): tun: rcu_deference xdp_prog only once per batch tun: optimize skb allocation in tun_xdp_one tun: use napi_build_skb in __tun_build_skb tun: use napi_consume_skb in tun_do_read drivers/net/tun.c | 60 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 18 deletions(-) -- 2.43.0