[PATCH net-next v2 6/9] tun: use napi_build_skb in __tun_build_skb

From: Jon Kohler
Date: Tue Nov 25 2025 - 14:19:05 EST


Use napi_build_skb for small payload SKBs that end up using the
tun_build_skb path.

Signed-off-by: Jon Kohler <jon@xxxxxxxxxxx>
---
drivers/net/tun.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 64f944cce517..27c502786a04 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1538,7 +1538,11 @@ static struct sk_buff *__tun_build_skb(struct tun_file *tfile,
int buflen, int len, int pad,
int metasize)
{
- struct sk_buff *skb = build_skb(buf, buflen);
+ struct sk_buff *skb;
+
+ local_bh_disable();
+ skb = napi_build_skb(buf, buflen);
+ local_bh_enable();

if (!skb)
return ERR_PTR(-ENOMEM);
--
2.43.0