Skip to content

Commit 8f5f66c

Browse files
xdp-tools: update to 1.5.8
Release Notes: - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.8 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.7 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.6 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.5 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.4 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.3 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.2 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.1 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.5.0 - https://github.com/xdp-project/xdp-tools/releases/tag/v1.4.3 Remove upstreamed: - 010-configure-respect-LDFLAGS.patch - 020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch - 024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch - 025-Add-BPF_LDFLAGS-to-allow-overwriting-llc-s-march-arg.patch Remove unnecessary patch: - 022-xdp-dump-add-missing-perf_event-include-for-bpf-and-.patch (The included headers were incorrect. Some musl toolchain headers appeared in the BPF bytecode generation path, which should not happen. This issue is resolved by overriding CFLAGS and LDFLAGS.) Remove `PKG_FLAGS:=nonshared`. With this flag enabled, the package is compiled separately for every target. Removing it limits compilation to each CPU architecture instead, significantly reducing unnecessary build overhead. Add new tools: - xdp-bench: XDP-bench is a benchmarking utility for exercising the different operation modes of XDP. It is intended to be a simple program demonstrating the various operating modes; these include dropping packets, hairpin forwarding (using the XDP_TX return code), and redirection using the various in-kernel packet redirection facilities. - xdp-forward: xdp-forward is an XDP forwarding plane, which will accelerate packet forwarding using XDP. To use it, simply load it on the set of interfaces to accelerate forwarding between. - xdp-monitor: XDP-monitor is a tool that monitors various XDP related statistics and events using BPF tracepoints infrastructure, trying to be as low overhead as possible. - xdp-trafficgen: XDP-trafficgen is a packet generator utilising the XDP kernel subsystem to generate packets transmit them through a network interface. Packets are dynamically generated and transmitted in the kernel, allowing for high performance (millions of packets per second per core). Co-Developed-by: Til Kaiser <mail@tk154.de> Link: openwrt#20903 Signed-off-by: Nick Hainke <vincent@systemli.org>
1 parent 4359177 commit 8f5f66c

6 files changed

Lines changed: 97 additions & 230 deletions

package/network/utils/xdp-tools/Makefile

Lines changed: 97 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=xdp-tools
44
PKG_RELEASE:=1
5-
PKG_VERSION:=1.4.3
6-
PKG_HASH:=6e727e2c7c079dec86575c5d0e7aac7ecd582aabe04b3b176d7ef50e653b60c0
5+
PKG_VERSION:=1.5.8
6+
PKG_HASH:=e7b9717074c511fef34aab6e22b16af55fb33307505a5785d25a82b542e596ae
77

88
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
99
PKG_SOURCE_URL:=https://codeload.github.com/xdp-project/xdp-tools/tar.gz/v$(PKG_VERSION)?
1010
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_VERSION))
1111

1212
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
1313

14-
PKG_BUILD_DEPENDS:=bpf-headers
15-
PKG_FLAGS:=nonshared
14+
PKG_BUILD_DEPENDS:=bpf-headers bpftool/host
1615

1716
include $(INCLUDE_DIR)/package.mk
1817
include $(INCLUDE_DIR)/bpf.mk
@@ -43,6 +42,21 @@ define Package/xdp-tools/Default
4342
DEPENDS:=+libxdp
4443
endef
4544

45+
46+
define Package/xdp-bench
47+
$(call Package/xdp-tools/Default)
48+
TITLE:=xdp-bench - an XDP benchmarking tool
49+
DEPENDS+=@KERNEL_DEBUG_INFO_BTF @KERNEL_KPROBES
50+
endef
51+
52+
define Package/xdp-bench/description
53+
XDP-bench is a benchmarking utility for exercising the different operation modes
54+
of XDP. It is intended to be a simple program demonstrating the various operating
55+
modes; these include dropping packets, hairpin forwarding (using the XDP_TX return
56+
code), and redirection using the various in-kernel packet redirection facilities.
57+
endef
58+
59+
4660
define Package/xdp-filter
4761
$(call Package/xdp-tools/Default)
4862
TITLE:=xdp-filter - a simple XDP-powered packet filter
@@ -56,6 +70,24 @@ tens of millions of packets per second on a single CPU core.
5670
endef
5771

5872

73+
define Package/xdp-forward
74+
$(call Package/xdp-tools/Default)
75+
TITLE:=xdp-forward - the XDP forwarding plane
76+
DEPENDS+=@KERNEL_DEBUG_INFO_BTF
77+
endef
78+
79+
define Package/xdp-forward/description
80+
xdp-forward is an XDP forwarding plane, which will accelerate
81+
packet forwarding using XDP. To use it, simply load it on
82+
the set of interfaces to accelerate forwarding between.
83+
84+
The userspace component of xdp-forward will then configure and
85+
load XDP programs on those interfaces, and forward packets between
86+
them using XDP_REDIRECT, using the kernel routing table or
87+
netfilter flowtable to determine the destination for each packet.
88+
endef
89+
90+
5991
define Package/xdp-loader
6092
$(call Package/xdp-tools/Default)
6193
TITLE:=xdp-loader - an XDP program loader
@@ -67,6 +99,38 @@ multiple programs to the same interface. To achieve this it exposes the same
6799
load and unload semantics exposed by the libxdp library.
68100
endef
69101

102+
103+
define Package/xdp-monitor
104+
$(call Package/xdp-tools/Default)
105+
TITLE:=xdp-monitor - a simple XDP tracepoint monitoring tool
106+
DEPENDS+=@KERNEL_DEBUG_INFO_BTF @KERNEL_KPROBES
107+
endef
108+
109+
define Package/xdp-monitor/description
110+
XDP-monitor is a tool that monitors various XDP related statistics and
111+
events using BPF tracepoints infrastructure, trying to be as low overhead
112+
as possible.
113+
endef
114+
115+
116+
define Package/xdp-trafficgen
117+
$(call Package/xdp-tools/Default)
118+
TITLE:=xdp-trafficgen - an XDP-based packet generator
119+
DEPENDS+=@KERNEL_DEBUG_INFO_BTF @KERNEL_KPROBES
120+
endef
121+
122+
define Package/xdp-trafficgen/description
123+
XDP-trafficgen is a packet generator utilising the XDP kernel subsystem
124+
to generate packets transmit them through a network interface.
125+
Packets are dynamically generated and transmitted in the kernel,
126+
allowing for high performance (millions of packets per second per core).
127+
128+
XDP-trafficgen supports generating UDP traffic with fixed or dynamic
129+
destination ports, and also has basic support for generating dummy
130+
TCP traffic on a single flow.
131+
endef
132+
133+
70134
define Package/xdpdump
71135
$(call Package/xdp-tools/Default)
72136
TITLE:=xdpdump - tool for capturing packets at the XDP layer
@@ -77,6 +141,7 @@ define Package/xdpdump/description
77141
xdpdump - a simple tcpdump like tool for capturing packets at the XDP layer
78142
endef
79143

144+
80145
TARGET_LDFLAGS += $(INTL_LDFLAGS)
81146

82147
CONFIGURE_VARS += \
@@ -85,23 +150,17 @@ CONFIGURE_VARS += \
85150
CFLAGS="$(TARGET_CFLAGS)" \
86151
LDFLAGS="$(TARGET_LDFLAGS)" \
87152
CLANG="$(CLANG)" \
88-
BPF_TARGET="$(BPF_ARCH)-linux-gnu" \
89-
LLC="$(LLVM_LLC)" \
90-
BPF_LDFLAGS="-march=$(BPF_TARGET) -mcpu=v3" \
91-
BPFTOOL=""
153+
BPFTOOL="$(STAGING_DIR_HOST)/usr/sbin/bpftool"
92154

93155
ifneq ($(findstring s,$(OPENWRT_VERBOSE)),)
94156
MAKE_FLAGS+=V=1
95157
endif
96158

97159
MAKE_VARS += \
98160
PREFIX=/usr \
99-
RUNDIR=/tmp/run
100-
101-
define Build/Configure
102-
$(call Build/Configure/Default)
103-
echo "BPF_CFLAGS += $(BPF_CFLAGS) -Wno-error -fno-stack-protector" >> $(PKG_BUILD_DIR)/config.mk
104-
endef
161+
RUNDIR=/tmp/run \
162+
CFLAGS="$(TARGET_CFLAGS)" \
163+
LDFLAGS="$(TARGET_LDFLAGS)"
105164

106165
define Build/InstallDev
107166
$(INSTALL_DIR) $(1)/usr/include/xdp
@@ -118,16 +177,36 @@ define Build/InstallDev
118177
$(1)/usr/lib/pkgconfig/libxdp.pc
119178
endef
120179

180+
define Package/xdp-bench/install
181+
$(INSTALL_DIR) $(1)/usr/sbin
182+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xdp-bench $(1)/usr/sbin
183+
endef
184+
121185
define Package/xdp-filter/install
122186
$(INSTALL_DIR) $(1)/usr/sbin
123187
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xdp-filter $(1)/usr/sbin
124188
endef
125189

190+
define Package/xdp-forward/install
191+
$(INSTALL_DIR) $(1)/usr/sbin
192+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xdp-forward $(1)/usr/sbin
193+
endef
194+
126195
define Package/xdp-loader/install
127196
$(INSTALL_DIR) $(1)/usr/sbin
128197
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xdp-loader $(1)/usr/sbin
129198
endef
130199

200+
define Package/xdp-monitor/install
201+
$(INSTALL_DIR) $(1)/usr/sbin
202+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xdp-monitor $(1)/usr/sbin
203+
endef
204+
205+
define Package/xdp-trafficgen/install
206+
$(INSTALL_DIR) $(1)/usr/sbin
207+
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xdp-trafficgen $(1)/usr/sbin
208+
endef
209+
131210
define Package/xdpdump/install
132211
$(INSTALL_DIR) $(1)/usr/sbin
133212
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/xdpdump $(1)/usr/sbin
@@ -140,6 +219,10 @@ define Package/libxdp/install
140219
endef
141220

142221
$(eval $(call BuildPackage,libxdp))
222+
$(eval $(call BuildPackage,xdp-bench))
143223
$(eval $(call BuildPackage,xdp-filter))
224+
$(eval $(call BuildPackage,xdp-forward))
144225
$(eval $(call BuildPackage,xdp-loader))
226+
$(eval $(call BuildPackage,xdp-monitor))
227+
$(eval $(call BuildPackage,xdp-trafficgen))
145228
$(eval $(call BuildPackage,xdpdump))

package/network/utils/xdp-tools/patches/010-configure-respect-LDFLAGS.patch

Lines changed: 0 additions & 29 deletions
This file was deleted.

package/network/utils/xdp-tools/patches/020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch

Lines changed: 0 additions & 49 deletions
This file was deleted.

package/network/utils/xdp-tools/patches/022-xdp-dump-add-missing-perf_event-include-for-bpf-and-.patch

Lines changed: 0 additions & 34 deletions
This file was deleted.

package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)