xdp_copy_frags_from_zc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 XSk xdp_buff where 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 🌈

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