__netmem_to_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __netmem_to_page(9) β€” brought to you by the Kernel API Manual ✨

okay so bestie, this page is literally called __netmem_to_page(9), and it is giving β€œI know exactly what I’m doing, so I’m skipping the safety check” energy πŸ’…πŸ”₯ no cap.


🌸 NAME 🌸

__netmem_to_page β€” unsafely get pointer to the &page backing @netmem 🫢


✨ SYNOPSIS ✨

struct page * __netmem_to_page (netmem_ref netmem );

πŸŽ€ ARGUMENTS πŸŽ€

  • netmem β€” the netmem reference to convert, periodt πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

It’s the unsafe version of netmem_to_page πŸ˜­πŸ’€. When netmem is always page-backed β€” like, for example, when it’s a header buffer β€” this one performs faster and generates smaller object code (no check for the LSB, no WARN). Slay for speed βœ¨πŸ‘‘

🚨 But when netmem points to IOV, it provokes undefined behaviour. Not a cute vibe. Not iconic. Do not do this unless you know exactly what you’re doing, bestie πŸ˜­πŸ’…

πŸ‘‘ RETURN πŸ‘‘

pointer to the page (garbage if netmem is not page-backed) πŸ™ˆβœ¨


🌈 SEE ALSO 🌈


mwah πŸ’‹ this whole thing comes from the ./include/net source tree, October 2026 edition, and it’s still out here repping __netmem_to_page(9) in the Kernel API Manual πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from