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>
(cherry picked from commit 9bd9f72a74344b54cfb6fcabf1173e6c6e5c6952)
BUG=b/452999713
TEST=Tested using devmem TCP all-to-all collective
RELEASE_NOTE=Fixes to TCPX
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/117808
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kevin Berry <kpberry@google.com>
Main-Branch-Verified: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
(cherry picked from commit c562421787408836571b145d5de40235a4a34b79)
Signed-off-by: Robert Kolchmeyer <rkolchmeyer@google.com>
Change-Id: Iffe4ed439ea408fa1e216e112732fbf4d0bfbd68
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/126643
1 file changed