summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajkumar Patel <patel.rajkumar@oss.qualcomm.com>2026-06-13 17:40:22 +0530
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-06-14 23:13:33 -0700
commitacc0003239cae3a2610560b5f1f9c8613042fd69 (patch)
tree76d4840dcd8f42fa34706cad0f051abd6cfb5320
parent71b74a4b26eb958e6462f3b8ff7f7b5b253814f5 (diff)
downloadmeta-openembedded-acc0003239cae3a2610560b5f1f9c8613042fd69.tar.gz
xdp-tools: add recipe
Import xdp-tools recipe from meta-dpdk to meta-oe. xdp-tools provides a set of utilities and helpers for working with XDP (eXpress Data Path) and eBPF-based packet processing in the Linux networking stack. Although currently available in meta-dpdk, xdp-tools is a standalone utility with no direct dependency on DPDK, and is generally useful for networking and XDP-based workflows. Adding it to meta-oe makes it available without requiring the meta-dpdk layer. Signed-off-by: Rajkumar Patel <patel.rajkumar@oss.qualcomm.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
-rw-r--r--meta-oe/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch44
-rw-r--r--meta-oe/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch44
-rw-r--r--meta-oe/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch31
-rw-r--r--meta-oe/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch34
-rw-r--r--meta-oe/recipes-support/xdp-tools/xdp-tools_1.2.10.bb36
5 files changed, 189 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch b/meta-oe/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch
new file mode 100644
index 0000000000..0c891528cb
--- /dev/null
+++ b/meta-oe/recipes-support/xdp-tools/xdp-tools/0001-configure-skip-toolchain-checks.patch
@@ -0,0 +1,44 @@
1From 9c9dce2e5f04de65b7b00321f96fff6071546ea1 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 15:44:16 +0800
4Subject: [PATCH] configure: skip toolchain checks
5
6Current logic fetch full command line along with the tool. i.e
7gcc -m64 -march=skylake -mtune=generic ...
8
9Which throws ERROR: Cannot find tool -m64
10
11So need to re-write for loop, so it can work in cross-compilation
12environment too.
13
14Upstream-Status: Inappropriate
15
16Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
17
18---
19 configure | 12 ++++++------
20 1 file changed, 6 insertions(+), 6 deletions(-)
21
22diff --git a/configure b/configure
23index b4e824f..10618fc 100755
24--- a/configure
25+++ b/configure
26@@ -69,12 +69,12 @@ check_toolchain()
27 CLANG=$(find_tool clang "$CLANG")
28 LLC=$(find_tool llc "$LLC")
29
30- for TOOL in $PKG_CONFIG $CC $LD $OBJCOPY $CLANG $LLC $M4; do
31- if [ ! $(command -v ${TOOL} 2>/dev/null) ]; then
32- echo "*** ERROR: Cannot find tool ${TOOL}" ;
33- exit 1;
34- fi;
35- done
36+ #for TOOL in $PKG_CONFIG $CC $LD $OBJCOPY $CLANG $LLC $M4; do
37+ # if [ ! $(command -v ${TOOL} 2>/dev/null) ]; then
38+ # echo "*** ERROR: Cannot find tool ${TOOL}" ;
39+ # exit 1;
40+ # fi;
41+ #done
42
43 clang_version=$($CLANG --version | grep -Po '(?<=clang version )[[:digit:]]+')
44 if [ "$?" -ne "0" ]; then
diff --git a/meta-oe/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch b/meta-oe/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch
new file mode 100644
index 0000000000..2e66783692
--- /dev/null
+++ b/meta-oe/recipes-support/xdp-tools/xdp-tools/0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch
@@ -0,0 +1,44 @@
1From 2840cf0b89497f545fae2eed7ece3f3c5fc558e3 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 15:50:34 +0800
4Subject: [PATCH 2/4] Makefile: It does not detect libbpf header from sysroot
5
6So adding sysroot headers path.
7
8Upstream-Status: OE-Specific
9
10Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
11---
12 lib/common.mk | 2 +-
13 lib/libxdp/Makefile | 2 +-
14 2 files changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/lib/common.mk b/lib/common.mk
17index 56c0406..ab0bad8 100644
18--- a/lib/common.mk
19+++ b/lib/common.mk
20@@ -55,7 +55,7 @@ LIBXDP_SOURCES := $(wildcard $(LIBXDP_DIR)/*.[ch] $(LIBXDP_DIR)/*.in)
21 KERN_USER_H ?= $(wildcard common_kern_user.h)
22
23 CFLAGS += -I$(HEADER_DIR) -I$(LIB_DIR)/util $(ARCH_INCLUDES)
24-BPF_CFLAGS += -I$(HEADER_DIR) $(ARCH_INCLUDES)
25+BPF_CFLAGS += -I$(HEADER_DIR) $(ARCH_INCLUDES) -I${STAGING_INCDIR}/
26
27 BPF_HEADERS := $(wildcard $(HEADER_DIR)/bpf/*.h) $(wildcard $(HEADER_DIR)/xdp/*.h)
28
29diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
30index 358b751..8f459d8 100644
31--- a/lib/libxdp/Makefile
32+++ b/lib/libxdp/Makefile
33@@ -30,7 +30,7 @@ PC_FILE := $(OBJDIR)/libxdp.pc
34 TEMPLATED_SOURCES := xdp-dispatcher.c
35
36 CFLAGS += -I$(HEADER_DIR)
37-BPF_CFLAGS += -I$(HEADER_DIR)
38+BPF_CFLAGS += -I$(HEADER_DIR) -I${STAGING_INCDIR}/
39
40
41 ifndef BUILD_STATIC_ONLY
42--
432.25.1
44
diff --git a/meta-oe/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch b/meta-oe/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch
new file mode 100644
index 0000000000..41c57f6eb2
--- /dev/null
+++ b/meta-oe/recipes-support/xdp-tools/xdp-tools/0003-Makefile-fix-KeyError-failure.patch
@@ -0,0 +1,31 @@
1From 157546fbc4f18751c52b3c8788879c05cf253331 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 16:02:46 +0800
4Subject: [PATCH 3/4] Makefile: fix KeyError failure
5
6Error:
7Exception: KeyError: 'getpwuid(): uid not found: 11857215'
8
9Upstream-Status: Inappropriate
10
11Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
12---
13 lib/libxdp/Makefile | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
17index 8f459d8..9a340a3 100644
18--- a/lib/libxdp/Makefile
19+++ b/lib/libxdp/Makefile
20@@ -55,7 +55,7 @@ install: all
21 $(Q)install -d -m 0755 $(DESTDIR)$(BPF_OBJECT_DIR)
22 $(Q)install -m 0644 $(LIB_HEADERS) $(DESTDIR)$(HDRDIR)/
23 $(Q)install -m 0644 $(PC_FILE) $(DESTDIR)$(LIBDIR)/pkgconfig/
24- $(Q)cp -fpR $(SHARED_LIBS) $(STATIC_LIBS) $(DESTDIR)$(LIBDIR)
25+ $(Q)cp -fpR --no-preserve=ownership $(SHARED_LIBS) $(STATIC_LIBS) $(DESTDIR)$(LIBDIR)
26 $(Q)install -m 0755 $(XDP_OBJS) $(DESTDIR)$(BPF_OBJECT_DIR)
27 $(if $(MAN_FILES),$(Q)install -m 0755 -d $(DESTDIR)$(MANDIR)/man3)
28 $(if $(MAN_FILES),$(Q)install -m 0644 $(MAN_FILES) $(DESTDIR)$(MANDIR)/man3)
29--
302.25.1
31
diff --git a/meta-oe/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch b/meta-oe/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch
new file mode 100644
index 0000000000..b1e15e5216
--- /dev/null
+++ b/meta-oe/recipes-support/xdp-tools/xdp-tools/0004-Makefile-fix-libxdp.pc-error.patch
@@ -0,0 +1,34 @@
1From 46b3ff797135574aa0ee42f633a281d44f48da95 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Mon, 17 Oct 2022 16:05:15 +0800
4Subject: [PATCH 4/4] Makefile: fix libxdp.pc error
5
6Error:
7do_populate_sysroot: QA Issue: libxdp.pc failed sanity test (tmpdir) in
8path ... xdp-tools/1.2.8-r0/sysroot-destdir/usr/lib/pkgconfig [pkgconfig]
9
10Upstream-Status: Inappropriate
11
12Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
13---
14 lib/libxdp/Makefile | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/lib/libxdp/Makefile b/lib/libxdp/Makefile
18index 9a340a3..bc39177 100644
19--- a/lib/libxdp/Makefile
20+++ b/lib/libxdp/Makefile
21@@ -76,8 +76,8 @@ $(OBJDIR)/libxdp.so.$(LIBXDP_VERSION): $(SHARED_OBJS)
22 $^ $(LDFLAGS) $(LDLIBS) -o $@
23
24 $(OBJDIR)/libxdp.pc:
25- $(Q)sed -e "s|@PREFIX@|$(PREFIX)|" \
26- -e "s|@LIBDIR@|$(LIBDIR)|" \
27+ $(Q)sed -e "s|@PREFIX@|$(prefix)|" \
28+ -e "s|@LIBDIR@|$(libdir)|" \
29 -e "s|@VERSION@|$(TOOLS_VERSION)|" \
30 < libxdp.pc.template > $@
31
32--
332.25.1
34
diff --git a/meta-oe/recipes-support/xdp-tools/xdp-tools_1.2.10.bb b/meta-oe/recipes-support/xdp-tools/xdp-tools_1.2.10.bb
new file mode 100644
index 0000000000..4a06124caf
--- /dev/null
+++ b/meta-oe/recipes-support/xdp-tools/xdp-tools_1.2.10.bb
@@ -0,0 +1,36 @@
1SUMMARY = "Utilities and example programs for use with XDP"
2HOMEPAGE = "https://github.com/xdp-project/xdp-tools"
3LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & BSD-2-Clause"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=9ee53f8d06bbdb4c11b1557ecc4f8cd5 \
5 file://LICENSES/GPL-2.0;md5=994331978b428511800bfbd17eea3001 \
6 file://LICENSES/LGPL-2.1;md5=b370887980db5dd40659b50909238dbd \
7 file://LICENSES/BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927"
8
9DEPENDS += " libbpf clang-native zlib elfutils libpcap"
10
11SRC_URI = "git://github.com/xdp-project/xdp-tools.git;branch=v1.2;protocol=https \
12 file://0001-configure-skip-toolchain-checks.patch \
13 file://0002-Makefile-It-does-not-detect-libbpf-header-from-sysro.patch \
14 file://0003-Makefile-fix-KeyError-failure.patch \
15 file://0004-Makefile-fix-libxdp.pc-error.patch \
16 "
17
18SRCREV = "57a139f9bf6ef644f9c1deb4f7df4bb4c76d6179"
19
20
21inherit pkgconfig
22
23EXTRA_OEMAKE += "PREFIX=${D}${prefix} LIBDIR=${D}${libdir} BUILD_STATIC_ONLY=1 PRODUCTION=1"
24
25CFLAGS += "-fPIC"
26
27export STAGING_INCDIR
28
29do_install () {
30 oe_runmake install
31
32 # Remove object files *.o
33 rm -rf ${D}/${libdir}/bpf
34}
35
36RDEPENDS:${PN} += "bash"