diff options
author | Alexander Lobakin <aleksander.lobakin@intel.com> | 2024-12-03 18:37:30 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-12-05 18:41:07 -0800 |
commit | 9bd9f72a74344b54cfb6fcabf1173e6c6e5c6952 (patch) | |
tree | ee14b293c360a8ff8079975820905e63ac83ddec /net/core/page_pool.c | |
parent | e77d9aee951341119be16a991fcfc76d1154d22a (diff) |
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 <aleksander.lobakin@intel.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20241203173733.3181246-8-aleksander.lobakin@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/page_pool.c')
0 files changed, 0 insertions, 0 deletions