xp_raw_get_ctx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

hiii bestie πŸ’– this little page comes from the Kernel API Manual, and the function we're obsessing over is xp_raw_get_ctx(9).

xp_raw_get_ctx β€” get &xdp_desc context ✨


πŸŽ€ SYNOPSIS πŸŽ€

struct xdp_desc_ctx xp_raw_get_ctx (const struct xsk_buff_pool *pool ,
u64 addr , u32 options );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • pool β€” the XSk buff pool desc address belongs to, periodt πŸ’…
  • addr β€” the desc address (from userspace) ✨
  • options β€” the desc options (from userspace) πŸŽ€

🌸 DESCRIPTION 🌸

Okay so this is the helper for getting the desc's DMA address and metadata pointer, if present. It saves one call on the hotpath and also saves double calculation of the actual address. No cap, that's the whole vibe 🫢

The metadata gets validated later by xsk_tx_metadata_request πŸ’œ


⭐ RETURN ⭐

It returns a new xdp_desc_ctx struct containing the desc's DMA address and metadata pointer, if it is present β€” and that pointer is initialized to NULL otherwise 🌈


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./net/xdp/xsk_buff_pool.c β€” go read it, iykyk πŸ‘‘


bestie reminder πŸŽ€: this page is from source/version ./net/xdp, dated October 2026. slay, that's the sign-off πŸ’…βœ¨
πŸ“¦ where this page comes from