summaryrefslogtreecommitdiff
path: root/include/net/netmem.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-07-03 04:59:33 +0300
committerJakub Kicinski <kuba@kernel.org>2024-07-03 04:59:33 +0300
commitdf18948d331eacc213cfc9e8ffc84a07dfd4dcd1 (patch)
tree79e9ad9c5d7d6b20615bd7c36719a96c0e9de179 /include/net/netmem.h
parentac26327635d643efe173e7460fa09eb39f0e5c54 (diff)
parent07c3cc51a0853986af0fc52d0544b1b67b391ea8 (diff)
downloadlinux-df18948d331eacc213cfc9e8ffc84a07dfd4dcd1.tar.xz
Merge branch 'device-memory-tcp'
Prep patches for Device Memory TCP Pick up a couple of prep patches for Device Memory TCP which stand on their own. Link: https://patch.msgid.link/20240628003253.1694510-1-almasrymina@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/netmem.h')
-rw-r--r--include/net/netmem.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/netmem.h b/include/net/netmem.h
index d8b810245c1d..46cc9b89ac79 100644
--- a/include/net/netmem.h
+++ b/include/net/netmem.h
@@ -38,4 +38,19 @@ static inline netmem_ref page_to_netmem(struct page *page)
return (__force netmem_ref)page;
}
+static inline int netmem_ref_count(netmem_ref netmem)
+{
+ return page_ref_count(netmem_to_page(netmem));
+}
+
+static inline unsigned long netmem_to_pfn(netmem_ref netmem)
+{
+ return page_to_pfn(netmem_to_page(netmem));
+}
+
+static inline netmem_ref netmem_compound_head(netmem_ref netmem)
+{
+ return page_to_netmem(compound_head(netmem_to_page(netmem)));
+}
+
#endif /* _NET_NETMEM_H */