[PATCH 0/2] bpf, arm64: relax constraint in BPF JIT compiler

2025-07-09 Thread eBPF Foundation
Lothoré (eBPF Foundation) --- Alexis Lothoré (eBPF Foundation) (2): bpf, arm64: remove structs on stack constraint selftests/bpf: enable tracing_struct tests for arm64 arch/arm64/net/bpf_jit_comp.c| 5 - tools/testing/selftests/bpf/DENYLIST.aarch64 | 1 - 2 files

[PATCH 2/2] selftests/bpf: enable tracing_struct tests for arm64

2025-07-09 Thread eBPF Foundation
Now that the constraint preventing attachment to functions consuming struct on stack has been removed from the kernel (and moved to pahole, with a slightly smarter detection, to prevent only those that are packed), re-enable the tracing_struct tests for arm64. Signed-off-by: Alexis Lothoré (eBPF

[PATCH 1/2] bpf, arm64: remove structs on stack constraint

2025-07-09 Thread eBPF Foundation
[3] https://lore.kernel.org/bpf/20250707-btf_skip_structs_on_stack-v3-0-29569e086...@bootlin.com/ Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/arm64/net/bpf_jit_comp.c | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_co

[PATCH bpf 7/7] selftests/bpf: ensure that functions passing structs on stack can not be hooked

2025-06-13 Thread eBPF Foundation
arguments on stack (-> more than 8 args) Signed-off-by: Alexis Lothoré (eBPF Foundation) --- .../selftests/bpf/prog_tests/tracing_struct.c | 37 +--- .../selftests/bpf/progs/tracing_struct_many_args.c | 70 -- .../testing/selftests/bpf/test_kmods/bpf_testmod.c |

[PATCH bpf 6/7] bpf/powerpc64: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
max bpf args check in the new function. Fixes: d243b62b7bd3 ("powerpc64/bpf: Add support for bpf trampolines") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/powerpc/net/bpf_jit_comp.c | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --

[PATCH bpf 5/7] bpf/powerpc64: use define for max regs count used for arguments

2025-06-13 Thread eBPF Foundation
powerpc allows using up to 8 registers to pass arguments between function calls. This value is hardcoded in multiple places, use a define for this value. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/powerpc/net/bpf_jit_comp.c | 10 +++--- 1 file changed, 7 insertions(+), 3

[PATCH bpf 1/7] bpf/x86: use define for max regs count used for arguments

2025-06-13 Thread eBPF Foundation
x86 allows using up to 6 registers to pass arguments between function calls. This value is hardcoded in multiple places, use a define for this value. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/x86/net/bpf_jit_comp.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions

[PATCH bpf 0/7] bpf: deny trampoline attachment if args can not be located exactly on stack

2025-06-13 Thread eBPF Foundation
-many_args_arm64-v1-0-0a32fe723...@bootlin.com/ [2] https://lore.kernel.org/bpf/caadnvqkr3ftnt1uqvrxbe0a2o37zyro2phqcohunw6pe5t2...@mail.gmail.com/ Signed-off-by: Alexis Lothoré (eBPF Foundation) --- Alexis Lothoré (eBPF Foundation) (7): bpf/x86: use define for max regs count used for

[PATCH bpf 4/7] bpf/s390: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
the existing check (ensuring that the number of args passed on stack is not higher than MAX_NR_STACK_ARGS) into the newly created check function. Fixes: 528eb2cb87bc ("s390/bpf: Implement arch_prepare_bpf_trampoline()") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arc

[PATCH bpf 3/7] bpf/riscv: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
max bpf args check in the new function. Fixes: 6801b0aef79d ("riscv, bpf: Add 12-argument support for RV64 bpf trampoline") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/riscv/net/bpf_jit_comp64.c | 26 -- 1 file changed, 24 insertions(+), 2 deletion

[PATCH bpf 2/7] bpf/x86: prevent trampoline attachment when args location on stack is uncertain

2025-06-13 Thread eBPF Foundation
max bpf args check in the new function. Fixes: 473e3150e30a ("bpf, x86: allow function arguments up to 12 for TRACING") Signed-off-by: Alexis Lothoré (eBPF Foundation) --- arch/x86/net/bpf_jit_comp.c | 36 ++-- 1 file changed, 30 insertions(+), 6 deletion

[PATCH bpf-next v3 2/2] selftests/bpf: enable many-args tests for arm64

2025-05-27 Thread eBPF Foundation
Now that support for up to 12 args is enabled for tracing programs on ARM64, enable the existing tests for this feature on this architecture. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- Changes in v2: - keep tracing struct tests disabled, as structs passed on stack are not handled by

[PATCH bpf-next v2 2/2] selftests/bpf: enable many-args tests for arm64

2025-05-22 Thread eBPF Foundation
Now that support for up to 12 args is enabled for tracing programs on ARM64, enable the existing tests for this feature on this architecture. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- Changes in v2: - keep tracing struct tests disabled, as structs passed on stack are not handled by

[PATCH RFC bpf-next 3/4] bpf/selftests: add tests to validate proper arguments alignment on ARM64

2025-04-11 Thread eBPF Foundation
ame arguments, except that the second one requires a more specific alignment to be set by the trampoline when preparing arguments before calling the the target function. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- .../selftests/bpf/prog_tests/tracing_struct.c | 23 to

[PATCH RFC bpf-next 1/4] bpf: add struct largest member size in func model

2025-04-11 Thread eBPF Foundation
arch-specific concerns (ie: guessing the final needed alignment for an argument) isolated in each JIT compiler. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- include/linux/bpf.h | 1 + kernel/bpf/btf.c| 25 + 2 files changed, 26 insertions(+) diff --git a/include/

[PATCH RFC bpf-next 4/4] bpf/selftests: enable tracing tests for ARM64

2025-04-11 Thread eBPF Foundation
The fentry_many_args, fexit_many_args and struct_many_args tests were disabled on ARM64 due to the lack of many args support. With the previous commits bringing in this missing support, drop the last denied tests. Signed-off-by: Alexis Lothoré (eBPF Foundation) --- tools/testing/selftests/bpf

[PATCH RFC bpf-next 0/4] bpf, arm64: support up to 12 arguments

2025-04-11 Thread eBPF Foundation
s64/aapcs64.rst#id82 [3] https://lore.kernel.org/bpf/20240705125336.46820-1-puran...@kernel.org/ [4] https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf Signed-off-by: Alexis Lothoré (eBPF Foundation) --- Alexis Lothoré (eBPF Foundation) (3): bpf: add struct largest member size in func model

[PATCH 02/13] selftests/bpf: test_xsk: Fix memory leaks

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
Some tests introduce memory leaks by not freeing all the pkt_stream objects they're creating. Fix these memory leaks. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/xskxceiver.c | 32 +++- 1 file changed, 31 insertions(

[PATCH 08/13] selftests/bpf: test_xsk: Don't exit immediately if validate_traffic fails

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
__testapp_validate_traffic() calls exit_on_error() on failures. This exits the program immediately and can lead to memory leaks. Return TEST_FAILURE instead of calling exit_on_error(). Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/xskxceiver.c | 6

[PATCH 01/13] selftests/bpf: test_xsk: Initialize bitmap before use

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
bitmap is used before being initialized. Initialize it to zero before using it. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/xskxceiver.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing

[PATCH 07/13] selftests/bpf: test_xsk: Don't exit immediately when workers fail

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
TX and RX workers can fail in many places. These failures trigger a call to exit_on_error() which exits the program immediately and can lead to memory leak. Add return value to functions that can fail. Handle failures more smoothly through report_failure(). Signed-off-by: Bastien Curutchet (eBPF

[PATCH 13/13] selftests/bpf: test_xsk: Integrate test_xsk.c to test_progs framework

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
_bit library to test_progs sources in the Makefile as it is is used by test_xsk.c Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 13 +- .../selftests/bpf/{ => prog_tests}/test_xsk.c | 0 .../selftests/bpf/{ => prog_tests}/

[PATCH 00/13] selftests/bpf: Integrate test_xsk.c to test_progs framework

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
ests available to test_progs PATCH 11 enables kselftest de-activation PATCH 12 isolates the flaky tests PATCH 13 integrate the non-flaky tests to the test_progs framework Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Bastien Curutchet (eBPF Foundation) (13): selftests/bpf: test_x

[PATCH 12/13] selftests/bpf: test_xsk: Isolate flaky tests

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
est_xsk.sh. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/test_xsk.h | 12 tools/testing/selftests/bpf/xskxceiver.c | 16 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/bpf/test_xsk.h b/too

[PATCH 11/13] selftests/bpf: test_xsk: Make kselftest dependency optional

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
test_xsk.c uses the kselftest framework. This isn't compatible with the test_progs framework. Add a XSK_SELTFEST define that allows to enable/disable the kselftest usage. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 2 +- tools/te

[PATCH 09/13] selftests/bpf: test_xsk: Don't exit immediately on allocation failures

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/xskxceiver.c | 97 +++- 1 file changed, 71 insertions(+), 26 deletions(-) diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c index

[PATCH 03/13] selftests/bpf: test_xsk: Wrap ksft_*() behind macros

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
xskxceiver depends on kselftests which prevent from integrating it into the test_progs framework. Wrap the ksft_*() calls behind macros to ease the future integration into test_progs. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/xskxceiver.c | 109

[PATCH 04/13] selftests/bpf: test_xsk: Add return value to init_iface()

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
init_iface() doesn't have any return value while it can fail. In case of failure it calls exit_on_error() which will terminate the test immediately. Add a return value to init_iface() so errors can be handled more smoothly. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/te

[PATCH 05/13] selftests/bpf: test_xsk: Don't exit immediately when xsk_attach fails

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
xsk_reattach_xdp calls exit_on_error() on failures. This exits the program immediately and can lead to memory leaks. Add a return value to the functions handling XDP attachments to handle errors more smoothly. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf

[PATCH 06/13] selftests/bpf: test_xsk: Don't exit immediately when gettimeofday fails

2025-03-13 Thread Bastien Curutchet (eBPF Foundation)
exit_on_error() is called when gettimeofday() fails. This exits the program immediately and can lead to memory leaks. Return TEST_FAILURE instead of calling exit_on_error() Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/xskxceiver.c | 8 1 file

[PATCH bpf-next 0/2] selftests/bpf: Move test_lwt_seg6local to test_progs

2025-03-07 Thread Bastien Curutchet (eBPF Foundation)
prog_tests/lwt_seg6local.c file. While working on the migration I noticed that some routes present in the script weren't needed so PATCH 1 deletes them and then PATCH 2 migrates the test into the test_progs framework. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Bastien Curutchet

[PATCH bpf-next 1/2] selftests/bpf: lwt_seg6local: Remove unused routes

2025-03-07 Thread Bastien Curutchet (eBPF Foundation)
Some routes in fb00:: are initialized during setup, even though they aren't needed by the test as the UDP packets will travel through the lightweight tunnels. Remove these unnecessary routes. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftest

[PATCH bpf-next 2/2] selftests/bpf: lwt_seg6local: Move test to test_progs

2025-03-07 Thread Bastien Curutchet (eBPF Foundation)
e the final packet. Remove test_lwt_seg6local.sh and its Makefile entry. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 1 - .../selftests/bpf/prog_tests/lwt_seg6local.c | 176 + tools/testing/selftest

[PATCH] selftests/bpf: Move test_lwt_ip_encap to test_progs

2025-03-04 Thread Bastien Curutchet (eBPF Foundation)
emove test_lwt_ip_encap.sh and its Makefile entry. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 3 +- .../selftests/bpf/prog_tests/lwt_ip_encap.c| 540 + tools/testing/selftests/bpf/test_lwt_ip_encap.sh

[PATCH bpf-next v2 04/10] selftests/bpf: test_tunnel: Move ip6gre tunnel test to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
to fail depending on the environment they're run on. Remove test_ip6gre() and test_ip6gretap() from the script. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Changes in v2: - Disable DAD through `ip addr` instead of using `sysctl` --- .../testing/selftests/bpf/prog_tests/test_tun

[PATCH bpf-next v2 05/10] selftests/bpf: test_tunnel: Move erspan tunnel tests to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 46 +++ tools/testing/selftests/bpf/test_tunnel.sh | 52 -- 2 files changed, 46 insertions(+), 52 deletions(-) diff --git a/tools/testing/selftests/bpf

[PATCH bpf-next v2 08/10] selftests/bpf: test_tunnel: Move ip6geneve tunnel test to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 48 + tools/testing/selftests/bpf/test_tunnel.sh | 49 -- 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/tools/testing

[PATCH bpf-next v2 02/10] selftests/bpf: test_tunnel: Add ping helpers

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
emove the unnecessary ASSERT_OK() from the tests. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 53 ++ 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/tools/testing/self

[PATCH bpf-next v2 09/10] selftests/bpf: test_tunnel: Move ip6tnl tunnel tests to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 59 +++ tools/testing/selftests/bpf/test_tunnel.sh | 88 -- 2 files changed, 59 insertions(+), 88 deletions(-) diff --git a/tools/testing

[PATCH bpf-next v2 10/10] selftests/bpf: test_tunnel: Remove test_tunnel.sh

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 1 - tools/testing/selftests/bpf/test_tunnel.sh | 179 - 2 files changed, 180 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing

[PATCH bpf-next v2 07/10] selftests/bpf: test_tunnel: Move geneve tunnel test to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 45 ++ tools/testing/selftests/bpf/test_tunnel.sh | 45 -- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/tools/testing/selftests/bpf

[PATCH bpf-next v2 06/10] selftests/bpf: test_tunnel: Move ip6erspan tunnel test to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 41 +++ tools/testing/selftests/bpf/test_tunnel.sh | 58 -- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/tools/testing/selftests/bpf

[PATCH bpf-next v2 03/10] selftests/bpf: test_tunnel: Move gre tunnel test to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 97 ++ tools/testing/selftests/bpf/test_tunnel.sh | 79 -- 2 files changed, 97 insertions(+), 79 deletions(-) diff --git a/tools/testing

[PATCH bpf-next v2 01/10] selftests/bpf: test_tunnel: Add generic_attach* helpers

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
stien Curutchet (eBPF Foundation) --- Changes in v2: - Move tc_hook definition to attach_tc_prog() --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 140 ++--- 1 file changed, 66 insertions(+), 74 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tunnel

[PATCH bpf-next v2 00/10] selftests/bpf: Migrate test_tunnel.sh to test_progs

2025-03-03 Thread Bastien Curutchet (eBPF Foundation)
the migration in the following patches. PATCH 3 to 9 migrate the tests of gre, ip6gre, erspan, ip6erspan, geneve, ip6geneve and ip6tnl tunnels. PATCH 10 removes test_tunnel.sh Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Changes in v2: - PATCH 1: Move tc_hook definition to attatch_tc_

[PATCH] bpf/selftests: test_select_reuseport_kern: remove unused header

2025-02-27 Thread eBPF Foundation
test_select_reuseport_kern.c is currently including , but it does not use any definition from there. Remove stdlib.h inclusion from test_select_reuseport_kern.c Signed-off-by: Alexis Lothoré (eBPF Foundation) --- I stumbled upon this specific header include while trying to build selftests on

[PATCH bpf-next 10/10] selftests/bpf: test_tunnel: Remove test_tunnel.sh

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 1 - tools/testing/selftests/bpf/test_tunnel.sh | 179 - 2 files changed, 180 deletions(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index

[PATCH bpf-next 08/10] selftests/bpf: test_tunnel: Move ip6geneve tunnel test to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
(eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 48 + tools/testing/selftests/bpf/test_tunnel.sh | 49 -- 2 files changed, 48 insertions(+), 49 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c

[PATCH bpf-next 07/10] selftests/bpf: test_tunnel: Move geneve tunnel test to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
geneve tunnels are tested in the test_tunnel.sh but not in the test_progs framework. Add a new test in test_progs to test geneve tunnels. It uses the same network topology and the same BPF programs than the script. Remove test_geneve() from the script. Signed-off-by: Bastien Curutchet (eBPF

[PATCH bpf-next 06/10] selftests/bpf: test_tunnel: Move ip6erspan tunnel test to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
(eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 41 +++ tools/testing/selftests/bpf/test_tunnel.sh | 58 -- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c b

[PATCH bpf-next 09/10] selftests/bpf: test_tunnel: Move ip6tnl tunnel tests to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 59 +++ tools/testing/selftests/bpf/test_tunnel.sh | 88 -- 2 files changed, 59 insertions(+), 88 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests

[PATCH bpf-next 05/10] selftests/bpf: test_tunnel: Move erspan tunnel tests to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
erspan tunnels are tested in the test_tunnel.sh but not in the test_progs framework. Add a new test in test_progs to test erspan tunnels. It uses the same network topology and the same BPF programs than the script. Remove test_erspan() from the script. Signed-off-by: Bastien Curutchet (eBPF

[PATCH bpf-next 04/10] selftests/bpf: test_tunnel: Move ip6gre tunnel test to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
to fail depending on the environment they're run on. Remove test_ip6gre() and test_ip6gretap() from the script. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 110 + tools/testing/selftests/bpf/test_tunn

[PATCH bpf-next 03/10] selftests/bpf: test_tunnel: Move gre tunnel test to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 97 ++ tools/testing/selftests/bpf/test_tunnel.sh | 79 -- 2 files changed, 97 insertions(+), 79 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests

[PATCH bpf-next 02/10] selftests/bpf: test_tunnel: Add ping helpers

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
emove the unnecessary ASSERT_OK() from the tests. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 53 ++ 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tun

[PATCH bpf-next 01/10] selftests/bpf: test_tunnel: Add generic_attach* helpers

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
stien Curutchet (eBPF Foundation) --- .../testing/selftests/bpf/prog_tests/test_tunnel.c | 128 ++--- 1 file changed, 62 insertions(+), 66 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c b/tools/testing/selftests/bpf/prog_tests/test_tunnel.c

[PATCH bpf-next 00/10] selftests/bpf: Migrate test_tunnel.sh to test_progs

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
the migration in the following patches. PATCH 3 to 9 migrate the tests of gre, ip6gre, erspan, ip6erspan, geneve, ip6geneve and ip6tnl tunnels. PATCH 10 removes test_tunnel.sh Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Bastien Curutchet (eBPF Foundation) (10): selftests

[PATCH bpf-next 2/2] selftests/bpf: Migrate test_xdp_vlan.sh into test_progs

2025-02-21 Thread Bastien Curutchet (eBPF Foundation)
test_xdp_vlan.sh isn't used by the BPF CI. Migrate test_xdp_vlan.sh in prog_tests/xdp_vlan.c. It uses the same BPF programs located in progs/test_xdp_vlan.c and the same network topology. Remove test_xdp_vlan*.sh and their Makefile entries. Signed-off-by: Bastien Curutchet (eBPF Found

[PATCH bpf-next 1/2] selftests/bpf: test_xdp_vlan: Rename BPF sections

2025-02-21 Thread Bastien Curutchet (eBPF Foundation)
use the program name instead of the section name to load the BPF program. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/progs/test_xdp_vlan.c | 20 ++-- tools/testing/selftests/bpf/test_xdp_vlan.sh | 6 +++--- 2 files changed, 13 inserti

[PATCH] selftests/bpf: DENYLIST.aarch64: enable kprobe_multi tests for ARM64

2025-02-19 Thread eBPF Foundation
architecture. Remove the tests depending on kprobe_multi from DENYLIST.aarch64 to allow those to run in CI. CONFIG_FPROBE is already correctly set in tools/testing/selftests/bpf/config Signed-off-by: Alexis Lothoré (eBPF Foundation) --- The tests being enabled with this series have been run locally

[PATCH bpf-next v2 1/4] selftests/bpf: ns_current_pid_tgid: Rename the test function

2025-02-19 Thread Bastien Curutchet (eBPF Foundation)
lict. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c b/tools/testing/selftests/bpf/prog_tests/ns_curr

[PATCH bpf-next v2 3/4] selftests/bpf: tc_links/tc_opts: Unserialize tests

2025-02-19 Thread Bastien Curutchet (eBPF Foundation)
Tests are serialized because they all use the loopback interface. Replace the 'serial_test_' prefixes with 'test_ns_' to benefit from the new test_prog feature which creates a dedicated namespace for each test, allowing them to run in parallel. Signed-off-by: Bastien Curutc

[PATCH bpf-next v2 4/4] selftests/bpf: ns_current_pid_tgid: Use test_progs's ns_ feature

2025-02-19 Thread Bastien Curutchet (eBPF Foundation)
Two subtests use the test_in_netns() function to run the test in a dedicated network namespace. This can now be done directly through the test_progs framework with a test name starting with 'ns_'. Replace the use of test_in_netns() by test_ns_* calls. Signed-off-by: Bastien Curut

[PATCH bpf-next v2 2/4] selftests/bpf: Optionally open a dedicated namespace to run test in it

2025-02-19 Thread Bastien Curutchet (eBPF Foundation)
Some tests are serialized to prevent interference with others. Open a dedicated network namespace when a test name starts with 'ns_' to allow more test parallelization. Use the test name as namespace name to avoid conflict between namespaces. Signed-off-by: Bastien Curutchet (eBPF

[PATCH bpf-next v2 0/4] selftests/bpf: tc_links/tc_opts: Unserialize tests

2025-02-19 Thread Bastien Curutchet (eBPF Foundation)
start with 'ns_'. One test already has a name starting with 'ns_', so PATCH 1 renames it to avoid conflicts. PATCH 2 introduces the test_progs 'feature'. PATCH 3 & 4 convert some tests to use these dedicated namespaces. Signed-off-by: Bastien Curutchet (eBPF Foundati

[PATCH bpf-next 2/3] selftests/bpf: tc_link/tc_opts: Use unique namespace

2025-02-17 Thread Bastien Curutchet (eBPF Foundation)
All the tests use the loopback interface. It prevents from running them in parallel. Use the create_and_open_tid_ns() helper to run each test in its own network namespace. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/tc_links.c | 124

[PATCH bpf-next 3/3] selftests/bpf: tc_links/tc_opts: Serialize tests

2025-02-17 Thread Bastien Curutchet (eBPF Foundation)
The tests aren't allowed to be run in parallel while they could be. Replace serial_test_*() calls by test_*() ones to allow parallelization of these tests. Rename some 'subtests' functions to avoid name conflicts with the actual tests. Signed-off-by: Bastien Curutchet (

[PATCH bpf-next 1/3] selftests/bpf: tc_helpers: Add create_and_open_tid_ns()

2025-02-17 Thread Bastien Curutchet (eBPF Foundation)
Add a create_and_open_tid_ns() helper that creates a new network namespace and open it. Use the append_tid() helper to ensure the uniqueness of the namespace name. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/tc_helpers.h | 12 1

[PATCH bpf-next 0/3] selftests/bpf: tc_links/tc_opts: Unserialize tests

2025-02-17 Thread Bastien Curutchet (eBPF Foundation)
Hi all, Both tc_links.c and tc_opts.c do their tests on the loopback interface. It prevents from parallelizing their executions. Use namespaces and the new append_tid() helper to allow this parallelization. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Bastien Curutchet (eBPF

[PATCH bpf-next v5 6/6] selftests/bpf: Remove test_xdp_redirect_multi.sh

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 2 - .../selftests/bpf/test_xdp_redirect_multi.sh | 214 --- tools/testing/selftests/bpf/xdp_redirect_multi.c | 226 - 3 files changed, 442

[PATCH bpf-next v5 4/6] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
map to select the broadcast flags. Use a BPF map with an entry per veth to check whether packets are received or not Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 157 + .../testing

[PATCH bpf-next v5 5/6] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
BPF map. Use a BPF program that stores the source MAC of received packets in a map to check the test results. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 132 + .../testing/selftests

[PATCH bpf-next v5 3/6] selftests/bpf: Optionally select broadcasting flags

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
ed-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/progs/xdp_redirect_multi_kern.c | 41 +++--- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/xdp_redirect_multi_kern.c b/tools/te

[PATCH bpf-next v5 2/6] selftests/bpf: test_xdp_veth: Use a dedicated namespace

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
er to ensure the uniqueness of this namespace's name during parallel runs. Remove the use of the append_tid() on the veth names as they now belong to an already unique namespace. Simplify cleanup_network() by directly deleting the namespaces Signed-off-by: Bastien Curutchet (eBPF

[PATCH bpf-next v5 1/6] selftests/bpf: test_xdp_veth: Create struct net_configuration

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
ributes in upcoming patch. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 108 +++-- 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c b/tools/testing

[PATCH bpf-next v5 0/6] selftests/bpf: Migrate test_xdp_redirect_multi.sh to test_progs

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
8f5d07b9a ("rtnetlink: fix netns leak with rtnl_setlink()") in the net tree. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Changes in v5: - Remove the patches that were applied from previous iteration - Add PATCH 1 & 2 to avoid using the root namespace so the veth indexes don

[PATCH bpf-next] selftests/bpf: Remove with_addr.sh and with_tunnels.sh

2025-02-04 Thread Bastien Curutchet (eBPF Foundation)
sed scripts and their Makefile entries. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile| 4 +-- tools/testing/selftests/bpf/with_addr.sh| 54 - tools/testing/selftests/bpf/with_tunnels.sh | 36 -

[PATCH bpf-next v4 13/14] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
BPF map. Use a BPF program that stores the source MAC of received packets in a map to check the test results. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 125 + .../testing/selftests

[PATCH bpf-next v4 14/14] selftests/bpf: Remove test_xdp_redirect_multi.sh

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 2 - .../selftests/bpf/test_xdp_redirect_multi.sh | 214 --- tools/testing/selftests/bpf/xdp_redirect_multi.c | 226 - 3 files changed, 442

[PATCH bpf-next v4 12/14] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
map to select the broadcast flags. Use a BPF map with an entry per veth to check whether packets are received or not Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 150 + .../testing

[PATCH bpf-next v4 11/14] selftests/bpf: Optionally select broadcasting flags

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
ed-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/progs/xdp_redirect_multi_kern.c | 41 +++--- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/xdp_redirect_multi_kern.c b/tools/te

[PATCH bpf-next v4 10/14] selftests/bpf: test_xdp_veth: Add new test cases for XDP flags

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
The XDP redirection is tested without any flag provided to the xdp_attach() function. Add two subtests that check the correct behaviour with XDP_FLAGS_{DRV/SKB}_MODE flags Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests

[PATCH bpf-next v4 09/14] selftests/bpf: test_xdp_veth: Use unique names

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
each test. Set a fixed size to remote_addr field so the struct veth_configuration can also have a fixed size. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 51 ++ 1 file changed, 33 insertions(+), 18 deletions

[PATCH bpf-next v4 07/14] selftests/bpf: test_xdp_veth: Add prog_config[] table

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
tchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 133 + 1 file changed, 80 insertions(+), 53 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c b/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c

[PATCH bpf-next v4 08/14] selftests/bpf: test_xdp_veth: Add XDP flags to prog_configuration

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
XDP flags are hardcoded to 0 at attachment. Add flags attributes to the struct prog_configuration to allow flag modifications for each test case. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c | 14

[PATCH bpf-next v4 05/14] selftests/bpf: test_xdp_veth: Split network configuration

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
e BPF configuration to the test itself. Split the test description in two parts, first the description of the network topology, then the description of the test case. Remove the veth indexes from the ASCII art as dynamic ones are used Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Found

[PATCH bpf-next v4 04/14] selftests/bpf: test_xdp_veth: Use int to describe next veth

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
used as an offset in the network configuration table. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests

[PATCH bpf-next v4 06/14] selftests/bpf: test_xdp_veth: Rename config[]

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
The network topology is held by the config[] table. This 'config' name is a bit too generic if we want to add other configuration variables. Rename config[] to net_config[]. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/

[PATCH bpf-next v4 03/14] selftests/bpf: test_xdp_veth: Remove unecessarry check_ping()

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
check_ping() directly returns a SYS_NOFAIL without any previous treatment. It's called only once in the file and hardcodes the used namespace and ip address. Replace check_ping() with a direct call of SYS_NOFAIL in the test. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/te

[PATCH bpf-next v4 02/14] selftests/bpf: test_xdp_veth: Remove unused defines

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
IP_CMD_MAX_LEN and NS_SUFFIX_LEN aren't used anywhere. Remove these unused defines Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_

[PATCH bpf-next v4 01/14] selftests/bpf: helpers: Add append_tid()

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
Some tests can't be run in parallel because they use same namespace names or veth names. Create an helper that appends the thread ID to a given string. 8 characters are used for it (7 digits + '\0') Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testin

[PATCH bpf-next v4 00/14] selftests/bpf: Migrate test_xdp_redirect_multi.sh to test_progs

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
ulti.sh Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Changes in v4: - Remove the NO_IP #define - append_tid() takes string's size as input to ensure there is enough space to fit the thread ID at the end - Fix PATCH 12's commit log - Link to v3: https://lore.kernel.org/r/202

[PATCH bpf-next v3 12/14] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
map to select the broadcast flags. Use a BPF map with an entry per veth to check whether packets are received or not Set the tests to run serially to avoid conflicts with test_xdp_veth_redirect Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf

[PATCH bpf-next v3 14/14] selftests/bpf: Remove test_xdp_redirect_multi.sh

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 2 - .../selftests/bpf/test_xdp_redirect_multi.sh | 214 --- tools/testing/selftests/bpf/xdp_redirect_multi.c | 226 - 3 files changed, 442

[PATCH bpf-next v3 13/14] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
BPF map. Use a BPF program that stores the source MAC of received packets in a map to check the test results. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 125 + .../testing/selftests

[PATCH bpf-next v3 10/14] selftests/bpf: test_xdp_veth: Add new test cases for XDP flags

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
The XDP redirection is tested without any flag provided to the xdp_attach() function. Add two subtests that check the correct behaviour with XDP_FLAGS_{DRV/SKB}_MODE flags Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests

[PATCH bpf-next v3 11/14] selftests/bpf: Optionally select broadcasting flags

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
ed-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/progs/xdp_redirect_multi_kern.c | 41 +++--- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/bpf/progs/xdp_redirect_multi_kern.c b/tools/te

[PATCH bpf-next v3 09/14] selftests/bpf: test_xdp_veth: Use unique names

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
each test. Set a fixed size to remote_addr field so the struct veth_configuration can also have a fixed size. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 52 ++ 1 file changed, 34 insertions(+), 18 deletions

[PATCH bpf-next v3 07/14] selftests/bpf: test_xdp_veth: Add prog_config[] table

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
tchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 133 + 1 file changed, 80 insertions(+), 53 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c b/tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c

[PATCH bpf-next v3 06/14] selftests/bpf: test_xdp_veth: Rename config[]

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
The network topology is held by the config[] table. This 'config' name is a bit too generic if we want to add other configuration variables. Rename config[] to net_config[]. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/

  1   2   >