aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-07-17 11:02:45 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-07-17 15:48:54 +0000
commite4795d3dbee71c463429e2901dad111fbc2d08fc (patch)
treec8e03e30be43d84c7115660f99f032b0e7e0aa17
parentcb13e826ec45e11e964e1921d281e0a06ca5e152 (diff)
-rw-r--r--sys/compat/linuxkpi/common/include/linux/skbuff.h5
-rw-r--r--sys/compat/linuxkpi/common/src/linux_skbuff.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h
index 9434655fc9f4..77ef47064fa5 100644
--- a/sys/compat/linuxkpi/common/include/linux/skbuff.h
+++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h
@@ -182,6 +182,7 @@ struct sk_buff {
uint16_t qmap; /* queue mapping */
uint16_t _flags; /* Internal flags. */
#define _SKB_FLAGS_SKBEXTFRAG 0x0001
+#define _SKB_PP_RECYCLE 0x0010
uint16_t l3hdroff; /* network header offset from *head */
uint16_t l4hdroff; /* transport header offset from *head */
uint16_t mac_header; /* offset of mac_header */
@@ -263,6 +264,7 @@ static inline void
dev_kfree_skb(struct sk_buff *skb)
{
SKB_TRACE(skb);
+ SKB_IMPROVE("Need to be able to deal with page_pool");
kfree_skb(skb);
}
@@ -1166,8 +1168,7 @@ static inline void
skb_mark_for_recycle(struct sk_buff *skb)
{
SKB_TRACE(skb);
- /* page_pool */
- SKB_TODO();
+ skb->_flags |= _SKB_PP_RECYCLE;
}
static inline int
diff --git a/sys/compat/linuxkpi/common/src/linux_skbuff.c b/sys/compat/linuxkpi/common/src/linux_skbuff.c
index d57c277c3267..6908101f25af 100644
--- a/sys/compat/linuxkpi/common/src/linux_skbuff.c
+++ b/sys/compat/linuxkpi/common/src/linux_skbuff.c
@@ -55,6 +55,8 @@
#include <linux/log2.h>
#endif
+#include <net/page_pool/helpers.h>
+
SYSCTL_DECL(_compat_linuxkpi);
SYSCTL_NODE(_compat_linuxkpi, OID_AUTO, skb, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"LinuxKPI skbuff");
@@ -349,7 +351,12 @@ linuxkpi_kfree_skb(struct sk_buff *skb)
shinfo->frags[fragno].size = 0;
shinfo->frags[fragno].offset = 0;
shinfo->frags[fragno].page = NULL;
- __free_page(p);
+#ifdef PAGE_IS_LKPI_PAGE
+ if ((skb->_flags & _SKB_PP_RECYCLE) != 0)
+ page_pool_put_full_page(p->pp, p, false);
+ else
+#endif
+ __free_page(p);
count++;
}
}