aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/net/netmem.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linuxkpi/common/include/net/netmem.h')
-rw-r--r--sys/compat/linuxkpi/common/include/net/netmem.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/net/netmem.h b/sys/compat/linuxkpi/common/include/net/netmem.h
new file mode 100644
index 000000000000..c8de09a2e8c2
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/net/netmem.h
@@ -0,0 +1,21 @@
+/*-
+ * Copyright (c) 2023-2025 Bjoern A. Zeeb
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#ifndef _LINUXKPI_NET_NETMEM_H
+#define _LINUXKPI_NET_NETMEM_H
+
+struct page_pool;
+
+struct netmem_desc {
+ struct page_pool *pp;
+};
+
+#define pp_page_to_nmdesc(page) \
+ (_Generic((page), \
+ const struct page *: (const struct netmem_desc *)(page), \
+ struct page *: (struct netmem_desc *)(page)))
+
+#endif /* _LINUXKPI_NET_NETMEM_H */