With build_skb paths now utilizing the local NAPI SKB cache, switch to using napi_consume_skb() in tun_put_user. This ensures the local SKB cache is refilled on read, improving memory locality and performance, especially when RX and TX run on the same worker thread (e.g., vhost workers). As napi_consume_skb() also performs deferred SKB freeing, SKBs allocated on different CPUs benefit as well. Cc: Eric Dumazet Cc: Nick Hudson Signed-off-by: Jon Kohler --- drivers/net/tun.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 27c502786a04..b48a66b39e0a 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -2155,7 +2155,9 @@ static ssize_t tun_put_user(struct tun_struct *tun, dev_sw_netstats_tx_add(tun->dev, 1, skb->len + vlan_hlen); preempt_enable(); - consume_skb(skb); + local_bh_disable(); + napi_consume_skb(skb, 1); + local_bh_enable(); return total; -- 2.43.0