xdp_build_skb_from_buff(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… xdp_build_skb_from_buff(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this page is literally all about xdp_build_skb_from_buff, and it's giving "glow-up from raw XDP buff to full skb" energy. come learn with me 🫢


✨ NAME ✨

xdp_build_skb_from_buff β€” create an skb from &xdp_buff πŸ’–

like, that's the whole gig. buff goes in, skb comes out. iconic.


🌸 SYNOPSIS 🌸

struct sk_buff * xdp_build_skb_from_buff (const struct xdp_buff *xdp );

πŸŽ€ ARGUMENTS πŸŽ€

  • xdp β€” the xdp_buff we're converting into an skb. that's the one, that's our main character πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

so what this does is perform all the common operations you need to create a new skb to pass up the stack from an xdp_buff β€” no cap, it's the whole pipeline:

  • allocate an skb head from the NAPI percpu cache ✨
  • initialize the skb data pointers and offsets
  • set the recycle bit if the buff is PP-backed πŸ‘‘
  • set the Rx queue index
  • set the protocol
  • update frags info

basically it does all the boring-but-essential setup so your skb is ready to head upstairs to the stack. slay πŸ’…


πŸ”₯ RETURN πŸ”₯

  • new sk_buff on success πŸ’–
  • NULL on error 😭

🌈 SEE ALSO 🌈

kernel file ./net/core/xdp.c, plus these besties:


and that's the page, periodt 🧚 this little gem lives in ./net/core and dropped in October 2026, filed under xdp_build_skb_from_buff(9) β€” go read it again whenever you need a vibe check, bestie πŸ’€πŸ’–

πŸ“¦ where this page comes from