summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajkumar Patel <patel.rajkumar@oss.qualcomm.com>2026-06-13 17:40:24 +0530
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-06-14 23:13:33 -0700
commit97372b7fe7810c7b110ffe199dae1d78fc343725 (patch)
tree79e89076181a2e1bc335384828091c79f3d58139
parentd21805a31cad9405a7bae24f4594e861d660f5ca (diff)
downloadmeta-openembedded-97372b7fe7810c7b110ffe199dae1d78fc343725.tar.gz
rtc-testbench: add recipe
Add recipe for rtc-testbench v5.4, a real-time and non-real-time traffic validation tool for converged TSN networks from Linutronix. It validates real-time performance and robustness of hardware, drivers, and the Linux network stack on TSN-enabled Ethernet networks using AF_PACKET or AF_XDP with eBPF, supporting protocols like PROFINET and OPC UA PubSub. rtc-testbench depends on libxdp provided by xdp-tools. Depends-on: xdp-tools: upgrade 1.2.10 -> 1.6.3 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-test/rtc-testbench/files/0001-CMakeLists.txt-make-BPF-clang-and-include-paths-conf.patch54
-rw-r--r--meta-oe/recipes-test/rtc-testbench/rtc-testbench_5.4.bb40
2 files changed, 94 insertions, 0 deletions
diff --git a/meta-oe/recipes-test/rtc-testbench/files/0001-CMakeLists.txt-make-BPF-clang-and-include-paths-conf.patch b/meta-oe/recipes-test/rtc-testbench/files/0001-CMakeLists.txt-make-BPF-clang-and-include-paths-conf.patch
new file mode 100644
index 0000000000..da1ea3bb33
--- /dev/null
+++ b/meta-oe/recipes-test/rtc-testbench/files/0001-CMakeLists.txt-make-BPF-clang-and-include-paths-conf.patch
@@ -0,0 +1,54 @@
1From 53c57b337a51a47b0edca64d88ef9aaacce90044 Mon Sep 17 00:00:00 2001
2From: Rajkumar Patel <patel.rajkumar@oss.qualcomm.com>
3Date: Wed, 10 Jun 2026 11:39:40 +0530
4Subject: [PATCH] CMakeLists.txt: make BPF clang and include paths configurable
5 for cross-builds
6
7The upstream CMakeLists.txt hardcodes the clang binary name and
8derives the BPF include path from CMAKE_C_LIBRARY_ARCHITECTURE,
9which is empty in a cross-compilation environment. This causes
10the BPF kernel programs to be compiled with the host clang and
11-I /usr/include/ (the build host include path), which fails with:
12
13 fatal error: 'asm/types.h' file not found
14
15Fix by converting the hardcoded values to CMake CACHE variables
16so they can be overridden from the recipe via -DCLANG=,
17-DBPF_INCLUDE_DIRS=, and -DBPF_EXTRA_FLAGS=.
18
19Upstream-Status: Inappropriate [OE cross-compilation specific]
20
21Signed-off-by: Rajkumar Patel <patel.rajkumar@oss.qualcomm.com>
22---
23 CMakeLists.txt | 12 +++++++++---
24 1 file changed, 9 insertions(+), 3 deletions(-)
25
26diff --git a/CMakeLists.txt b/CMakeLists.txt
27index f782304..7f284f9 100644
28--- a/CMakeLists.txt
29+++ b/CMakeLists.txt
30@@ -174,15 +174,21 @@ include_directories("${PROJECT_BINARY_DIR}")
31 #
32 # Add code for compiling XDP eBPF programes.
33 #
34-set(ASM_INCLUDE "/usr/include/${CMAKE_C_LIBRARY_ARCHITECTURE}")
35+set(CLANG "clang" CACHE STRING "Clang binary used for BPF compilation")
36+set(BPF_INCLUDE_DIRS "" CACHE STRING "Sysroot include path for BPF compilation")
37+set(BPF_EXTRA_FLAGS "" CACHE STRING "Extra flags for BPF clang compilation (space-separated)")
38+
39+separate_arguments(BPF_EXTRA_FLAGS_LIST UNIX_COMMAND "${BPF_EXTRA_FLAGS}")
40+
41 set(CLANG_FLAGS -Wall -O2 -fno-stack-protector
42- -I ${ASM_INCLUDE}
43+ ${BPF_EXTRA_FLAGS_LIST}
44+ -I ${BPF_INCLUDE_DIRS}
45 -I ${PROJECT_BINARY_DIR} # required for app_config.h
46 )
47
48 function(add_xdp_prog name)
49 add_custom_target(${name} ALL
50- COMMAND clang ${CLANG_FLAGS} -target bpf -c -g -o ${CMAKE_BINARY_DIR}/${name}.o ${name}.c
51+ COMMAND ${CLANG} ${CLANG_FLAGS} -target bpf -c -g -o ${CMAKE_BINARY_DIR}/${name}.o ${name}.c
52 DEPENDS reference
53 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src
54 SOURCES src/${name}.c
diff --git a/meta-oe/recipes-test/rtc-testbench/rtc-testbench_5.4.bb b/meta-oe/recipes-test/rtc-testbench/rtc-testbench_5.4.bb
new file mode 100644
index 0000000000..81a4d9d01b
--- /dev/null
+++ b/meta-oe/recipes-test/rtc-testbench/rtc-testbench_5.4.bb
@@ -0,0 +1,40 @@
1SUMMARY = "Real-time and non-real-time traffic validation tool for converged TSN networks"
2
3DESCRIPTION = "The Linux RealTime Communication Testbench validates real-time \
4performance and robustness of hardware, drivers, and the Linux network stack on \
5TSN-enabled Ethernet networks. It generates and mirrors cyclic traffic using \
6AF_PACKET or AF_XDP with eBPF, supporting protocols like PROFINET and OPC UA PubSub."
7
8HOMEPAGE = "https://github.com/Linutronix/RTC-Testbench"
9LICENSE = "BSD-2-Clause & (GPL-2.0-only | BSD-2-Clause)"
10LIC_FILES_CHKSUM = " \
11 file://LICENSE;md5=f39e57686080f8752e19c4cd3e04e351 \
12 file://LICENSES/BSD-2-Clause.txt;md5=9e16594a228301089d759b4f178db91f \
13 file://LICENSES/GPL-2.0-only.txt;md5=3d26203303a722dedc6bf909d95ba815 \
14"
15SRC_URI = " \
16 git://github.com/Linutronix/RTC-Testbench.git;tag=v${PV};nobranch=1;protocol=https \
17 file://0001-CMakeLists.txt-make-BPF-clang-and-include-paths-conf.patch \
18"
19SRCREV = "bf016fdf422094f1ef65c0d88f148f46663ebbd8"
20
21DEPENDS += " \
22 libyaml \
23 libbpf \
24 xdp-tools \
25 openssl \
26 clang-native \
27"
28
29inherit cmake pkgconfig
30
31EXTRA_OECMAKE += " \
32 -DRX_TIMESTAMP=ON \
33 -DTX_TIMESTAMP=ON \
34 -DCLANG=${STAGING_BINDIR_NATIVE}/clang \
35 -DBPF_INCLUDE_DIRS=${STAGING_INCDIR} \
36 -DBPF_EXTRA_FLAGS='-D__${TARGET_ARCH}__ -ffile-prefix-map=${S}=${TARGET_DBGSRC_DIR} -ffile-prefix-map=${STAGING_DIR_HOST}=' \
37"
38
39# Require bash since installed scripts use /bin/bash shebang
40RDEPENDS:${PN} += "bash"