xdp_build_skb_from_buff(9)
π 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β thexdp_buffwe'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_buffon success π NULLon error π
π SEE ALSO π
kernel file ./net/core/xdp.c, plus these besties:
xdp_reg_page_pool(9)xdp_unreg_page_pool(9)xdp_rxq_info_attach_page_pool(9)xdp_return_frag(9)xdp_copy_frags_from_zc(9)xdp_build_skb_from_zc(9)bpf_xdp_metadata_rx_timestamp(9)bpf_xdp_metadata_rx_hash(9)bpf_xdp_metadata_rx_vlan_tag(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms