__xdp_buff_add_frag(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so you’re in the Kernel API Manual, bestie, and today’s absolute main character is __xdp_buff_add_frag(9) πŸ’…βœ¨

🌸 NAME 🌸

__xdp_buff_add_frag β€” attach frag to &xdp_buff πŸŽ€

✨ SYNOPSIS ✨

bool __xdp_buff_add_frag (struct xdp_buff *xdp , netmem_ref netmem , u32 offset , u32 size , u32 truesize , bool try_coalesce );

πŸŽ€ ARGUMENTS πŸŽ€

  • xdp β€” the XDP buffer to attach the frag to 🫢
  • netmem β€” network memory containing the frag
  • offset β€” offset at which the frag starts
  • size β€” size of the frag
  • truesize β€” total memory size occupied by the frag
  • try_coalesce β€” whether to try coalescing the frags (not valid for XSk) 🚫

πŸ’– DESCRIPTION πŸ’–

okay so here’s the tea: attach the frag to the XDP buffer. If it currently has no frags attached, initialize the related fields; otherwise check that the frag number didn’t reach the limit of MAX_SKB_FRAGS. If possible, try coalescing the frag with the previous one. πŸ”₯

The function doesn’t check/update the pfmemalloc bit. Please use the non-underscored wrapper in drivers. πŸ™ˆ

bestie, for real, please use the non-underscored wrapper in drivers πŸ’–

πŸ”₯ RETURN πŸ”₯

true on success, false if there’s no space for the frag in the shared info struct. periodt. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹


xoxo, your girl from ./include/net β€” October 2026 β€” signing off for __xdp_buff_add_frag(9) πŸ’‹πŸŽ€

πŸ“¦ where this page comes from