xdp_copy_frags_from_zc(9)
π xdp_copy_frags_from_zc(9) π
okay so bestie, welcome to the Kernel API Manual β this one's a function page, it's giving "quiet but essential", and honestly? we're obsessed π«Ά
β¨ NAME β¨
xdp_copy_frags_from_zc β literally copies frags from an XSk buff over to an skb π
β¨ SYNOPSIS β¨
bool xdp_copy_frags_from_zc (struct sk_buff *skb , const struct xdp_buff
*xdp , struct page_pool *pp );
like yes, that's the whole vibe check: it takes an skb, an xdp_buff, and a page_pool, and it hands you back a bool πΈ
β¨ ARGUMENTS β¨
skbβ the skb that the frags get copied into, bestie. it's the destination, the main character of this operation πxdpβ the XSkxdp_buffwhere the frags are coming from. the source, the origin story πppβ the page_pool backing the page allocation, if available. (key words: "if available", don't forget it π)
β¨ DESCRIPTION β¨
So here's what's going down: this function copies all the frags from the XSk xdp_buff into the skb, so the skb can be passed up the stack π₯
And how does it do that, you ask? For each frag, it allocates a brand-new buffer, copies the frag in, and attaches it to the skb. one frag at a time, no shortcuts, no cap β¨
β¨ RETURN β¨
true on success π β and false on netmem allocation fail π (that's the one and only failure case listed here, so clock it).
π SEE ALSO π
- Kernel file
./net/core/xdp.cβ yes, the source file itself is in the list, love that for us π¦ xdp_reg_page_pool(9)xdp_unreg_page_pool(9)xdp_rxq_info_attach_page_pool(9)xdp_return_frag(9)xdp_build_skb_from_buff(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)
like, read them, they're the whole friend group π«Ά
π ngl, if literally any of this involves handing frags up the stack, pls double-check your allocation situation first β false means the netmem allocation failed, and that's a whole mood nobody wants π
so that's the page, bestie π this little cutie lives in ./net/core, the manual's stamped October 2026, and the whole thing is filed under xdp_copy_frags_from_zc(9) β slay, periodt, go read the kernel source π
π¦ 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