On Tue, 27 May 2025 20:49:33 -0700 Mina Almasry wrote:
quoted
If you don't want to have to validate the low bit during netmem -> page
conversions - you need to clearly maintain the separation between
the two in the driver. These __netmem_to_page() calls are too much of
a liability.
Would it make sense to add a DEBUG_NET_WARN_ON_ONCE to
__netmem_to_page to catch misuse in a driver independent way? Or is
that not good enough because there may be latent issues only hit in
production where the debug is disabled.
Yes, DEBUG_NET_WARN_ON_ONCE() is not ideal. The condition may trigger
pretty rarely, and what are we saving? A single branch per packet on
a HW-GRO capable device?
Isn't the netmem vs page confusion here primarily because we want to
use the same struct to hold head and payload pages?