__netmem_to_nmdesc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __netmem_to_nmdesc(9)

okay so real talk, bestie β€” this one lives in the Kernel API Manual, and it's the unsafe speedrun version of the netmem-to-desc glow-up ✨ read the warnings, i'm literally begging 🫢


🌸 NAME

__netmem_to_nmdesc β€” unsafely get pointer to the &netmem_desc backing @netmem πŸ’€

like yeah it gives you the pointer, but it does it unsafely, and the man page said what it said, so don't come crying to me 😭


✨ SYNOPSIS

struct netmem_desc * __netmem_to_nmdesc (netmem_ref netmem );

one function, one argument, no thoughts head empty, straight in and straight out πŸ’–


πŸŽ€ ARGUMENTS

  • netmem β€” the netmem reference you want to convert, bestie. that's it. that's the whole input 🌸

πŸ¦‹ DESCRIPTION

okay so this is the unsafe version πŸ‘€ and it can be used only when netmem is always backed by system memory. say it with me: only when it's always backed by system memory. πŸ”₯

the tradeoff is iconic honestly β€” it performs faster and generates smaller object code. the way it does that? no check for the LSB, no WARN πŸ’… so it's just vibes and raw speed, no safety net, no little warning sign, nothing 🧚

⚠️ and here's the part where you gotta pay attention: when netmem points to IOV, this provokes undefined behaviour. not "maybe", not "kinda", provokes undefined behaviour. main character energy of the worst kind πŸ’€πŸ™ˆ

🌈 RETURN

pointer to the netmem_desc β€” but fr fr, it's garbage if netmem is not backed by system memory πŸ—‘οΈβœ¨ it does not check. it does not warn. it just hands you a pointer and wishes you the best 🫢


πŸ‘‘ SEE ALSO

like the whole netmem friend group, go say hi πŸ¦‹πŸ’œ


mwah πŸ’– that's the whole page! this lil icon ships out of ./include/net and the version vibes are stamped October 2026 β€” so yeah, that's the tea, go forth and please only call this when you actually know it's system memory, i believe in you πŸŽ€β­πŸ“

πŸ“¦ where this page comes from