[openwrt/openwrt] kernel: modules: add xdp-sockets-diag support

LEDE Commits lede-commits at lists.infradead.org
Sat Aug 19 06:08:12 PDT 2023


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/6eb6a75b8d78ae70b3c9f2de70a38352c5de3714

commit 6eb6a75b8d78ae70b3c9f2de70a38352c5de3714
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Tue May 23 15:43:14 2023 +0800

    kernel: modules: add xdp-sockets-diag support
    
    Support for PF_XDP sockets monitoring interface used by the ss tool.
    
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
    (cherry picked from commit 06e64f9b364abe15c27bf0a7225fcac740819668)
---
 config/Config-kernel.in                                  |  6 ++++++
 package/kernel/linux/modules/netsupport.mk               | 16 ++++++++++++++++
 .../linux/generic/hack-5.15/901-debloat_sock_diag.patch  | 10 ++++++++++
 3 files changed, 32 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 32524f5aed..fbcd008f2f 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -1097,6 +1097,12 @@ config KERNEL_NET_L3_MASTER_DEV
 	  This module provides glue between core networking code and device
 	  drivers to support L3 master devices like VRF.
 
+config KERNEL_XDP_SOCKETS
+	bool "XDP sockets support"
+	help
+	  XDP sockets allows a channel between XDP programs and
+	  userspace applications.
+
 config KERNEL_WIRELESS_EXT
 	def_bool n
 
diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk
index 97556e459d..27268ee043 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -1443,6 +1443,22 @@ endef
 $(eval $(call KernelPackage,inet-diag))
 
 
+define KernelPackage/xdp-sockets-diag
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=PF_XDP sockets monitoring interface support for ss utility
+  DEPENDS:=@KERNEL_XDP_SOCKETS
+  KCONFIG:=CONFIG_XDP_SOCKETS_DIAG
+  FILES:=$(LINUX_DIR)/net/xdp/xsk_diag.ko
+  AUTOLOAD:=$(call AutoLoad,31,xsk_diag)
+endef
+
+define KernelPackage/xdp-sockets-diag/description
+ Support for PF_XDP sockets monitoring interface used by the ss tool
+endef
+
+$(eval $(call KernelPackage,xdp-sockets-diag))
+
+
 define KernelPackage/wireguard
   SUBMENU:=$(NETWORK_SUPPORT_MENU)
   TITLE:=WireGuard secure network tunnel
diff --git a/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch b/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch
index ac53bd0281..5c1ce01a2c 100644
--- a/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch
+++ b/target/linux/generic/hack-5.15/901-debloat_sock_diag.patch
@@ -160,3 +160,13 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	default n
  	help
  	  Support for UNIX socket monitoring interface used by the ss tool.
+--- a/net/xdp/Kconfig
++++ b/net/xdp/Kconfig
+@@ -10,6 +10,7 @@ config XDP_SOCKETS
+ config XDP_SOCKETS_DIAG
+ 	tristate "XDP sockets: monitoring interface"
+ 	depends on XDP_SOCKETS
++	select SOCK_DIAG
+ 	default n
+ 	help
+ 	  Support for PF_XDP sockets monitoring interface used by the ss tool.




More information about the lede-commits mailing list