xp_raw_get_ctx(9)
π 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
- 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