diff options
| author | Alexander Lobakin <[email protected]> | 2024-12-03 17:37:30 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-12-06 02:41:07 +0000 |
| commit | 9bd9f72a74344b54cfb6fcabf1173e6c6e5c6952 (patch) | |
| tree | ee14b293c360a8ff8079975820905e63ac83ddec /net/core/page_pool.c | |
| parent | xdp: register system page pool as an XDP memory model (diff) | |
| download | kernel-9bd9f72a74344b54cfb6fcabf1173e6c6e5c6952.tar.gz kernel-9bd9f72a74344b54cfb6fcabf1173e6c6e5c6952.zip | |
netmem: add a couple of page helper wrappers
Add the following netmem counterparts:
* virt_to_netmem() -- simple page_to_netmem(virt_to_page()) wrapper;
* netmem_is_pfmemalloc() -- page_is_pfmemalloc() for page-backed
netmems, false otherwise;
and the following "unsafe" versions:
* __netmem_to_page()
* __netmem_get_pp()
* __netmem_address()
They do the same as their non-underscored buddies, but assume the netmem
is always page-backed. When working with header &page_pools, you don't
need to check whether netmem belongs to the host memory and you can
never get NULL instead of &page. Checks for the LSB, clearing the LSB,
branches take cycles and increase object code size, sometimes
significantly. When you're sure your PP is always host, you can avoid
this by using the underscored counterparts.
Signed-off-by: Alexander Lobakin <[email protected]>
Reviewed-by: Toke Høiland-Jørgensen <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/page_pool.c')
0 files changed, 0 insertions, 0 deletions
