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

2024-12-06 Thread Bastien Curutchet
SEC("t") and SEC("x") can't be loaded by the __load() helper. Rename these sections SEC("tc") and SEC("xdp") so they can be interpreted by the __load() helper in upcoming patch. Update the test_xdp_meta.sh to fit these new names. Signed-off-by: Bas

[PATCH bpf-next 0/2] selftests: bpf: Migrate test_xdp_meta.sh to test_progs

2024-12-06 Thread Bastien Curutchet
test_xdp_meta.sh also verifies that the meta-data initialized in the struct xdp_md is forwarded to the struct __sk_buff used by BPF programs at 'TC level'. To cover this, I add a test case in xdp_context_test_run.c that uses the same BPF programs from progs/test_xdp_meta.c. --- Bastien Cu

[PATCH bpf-next 2/2] selftests/bpf: Migrate test_xdp_meta.sh into xdp_context_test_run.c

2024-12-06 Thread Bastien Curutchet
test_xdp_meta.sh can't be used by the BPF CI. Migrate test_xdp_meta.sh in a new test case in xdp_context_test_run.c. It uses the same BPF programs located in progs/test_xdp_meta.c and the same network topology. Remove test_xdp_meta.sh and its Makefile entry. Signed-off-by: Bastien Curu

Re: [PATCH 2/3] selftests/bpf: Migrate test_xdp_redirect.sh to xdp_do_redirect.c

2025-01-05 Thread Bastien Curutchet
Hi Alexis, On 1/3/25 1:54 PM, Alexis Lothoré wrote: Hi Bastien, On 1/3/25 11:10, Bastien Curutchet (eBPF Foundation) wrote: [...] + SYS(fail, "ip link add veth%d index %d%d%d type veth peer name veth0 netns %s", + i, i, i, i, ns_name); nit: sinc

Re: [PATCH 2/3] selftests/bpf: Migrate test_xdp_redirect.sh to xdp_do_redirect.c

2025-01-06 Thread Bastien Curutchet
Hi again, On 1/3/25 2:17 PM, Alexis Lothoré wrote: On 1/3/25 11:10, Bastien Curutchet (eBPF Foundation) wrote: test_xdp_redirect.sh can't be used by the BPF CI. + dummy_prog = bpf_object__find_program_by_name(skel_dummy->obj, "xdp_dummy_prog"); Also missed this

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

2025-02-03 Thread Bastien Curutchet
Hi Martin, On 2/1/25 2:33 AM, Martin KaFai Lau wrote: On 1/30/25 11:21 PM, Bastien Curutchet (eBPF Foundation) wrote: +#define BROADCAST_REDIRECT_SKEL_NB    2 +static void xdp_veth_broadcast_redirect(u32 attach_flags, u64 [...] + +    group_map = bpf_map__fd(xdp_redirect_multi_kern

[PATCH bpf-next v2 0/2] selftests: bpf: Migrate test_xdp_meta.sh to test_progs

2024-12-13 Thread Bastien Curutchet
dd missing close_netns() - Use a unique 'close' label - Link to v1: https://lore.kernel.org/r/20241206-xdp_meta-v1-0-5c150618f...@bootlin.com --- Bastien Curutchet (2): selftests/bpf: test_xdp_meta: Rename BPF sections selftests/bpf: Migrate test_xdp_meta.sh into xdp_contex

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

2024-12-13 Thread Bastien Curutchet
SEC("t") and SEC("x") can't be loaded by the __load() helper. Rename these sections SEC("tc") and SEC("xdp") so they can be interpreted by the __load() helper in upcoming patch. Update the test_xdp_meta.sh to fit these new names. Signed-off-by: Bas

[PATCH bpf-next v2 2/2] selftests/bpf: Migrate test_xdp_meta.sh into xdp_context_test_run.c

2024-12-13 Thread Bastien Curutchet
test_xdp_meta.sh can't be used by the BPF CI. Migrate test_xdp_meta.sh in a new test case in xdp_context_test_run.c. It uses the same BPF programs located in progs/test_xdp_meta.c and the same network topology. Remove test_xdp_meta.sh and its Makefile entry. Signed-off-by: Bastien Curu

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

2025-01-24 Thread Bastien Curutchet
Hi Stanislav On 1/23/25 8:45 PM, Stanislav Fomichev wrote: On 01/21, Bastien Curutchet (eBPF Foundation) wrote: Hi all, This patch series continues the work to migrate the *.sh tests into prog_tests framework. test_xdp_redirect_multi.sh tests the XDP redirections done through

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

2025-01-28 Thread Bastien Curutchet
Hi Martin, On 1/28/25 11:49 PM, Martin KaFai Lau wrote: On 1/28/25 1:57 AM, Bastien Curutchet (eBPF Foundation) wrote: 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

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

2025-01-28 Thread Bastien Curutchet
Hi Martin, On 1/29/25 12:03 AM, Martin KaFai Lau wrote: On 1/28/25 1:57 AM, Bastien Curutchet (eBPF Foundation) wrote: Set the tests to run serially to avoid conflicts with test_xdp_veth_redirect I think this has been fixed in v3? Indeed, I forgot to update the commit log ... Others

Re: [PATCH 0/3] selftests: bpf: Migrate test_xdp_redirect.sh to test_progs

2025-01-03 Thread Bastien Curutchet
Hi all, On 1/3/25 11:10 AM, Bastien Curutchet (eBPF Foundation) wrote: Hi all, This patch series continues the work to migrate the *.sh tests into prog_tests. test_xdp_redirect.sh tests the XDP redirections done through bpf_redirect(). These XDP redirections are already tested by prog_tests

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

2025-02-24 Thread Bastien Curutchet
Hi Stanislav, On 2/21/25 5:14 PM, Stanislav Fomichev wrote: On 02/21, Bastien Curutchet (eBPF Foundation) wrote: 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 ne

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

2025-02-18 Thread Bastien Curutchet
Hi, On 2/19/25 4:40 AM, Alexei Starovoitov wrote: On Tue, Feb 18, 2025 at 1:22 PM Stanislav Fomichev wrote: On 02/17, Bastien Curutchet (eBPF Foundation) wrote: Hi all, Both tc_links.c and tc_opts.c do their tests on the loopback interface. It prevents from parallelizing their executions

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

2025-02-28 Thread Bastien Curutchet
Hi Stanislav, On 2/27/25 11:08 PM, Stanislav Fomichev wrote: On 02/27, Bastien Curutchet (eBPF Foundation) wrote: A fair amount of code duplication is present among tests to attach BPF programs. Create generic_attach* helpers that attach BPF programs to a given interface. Use ASSERT_OK_FD

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

2025-02-28 Thread Bastien Curutchet
Hi Stanislav On 2/27/25 11:18 PM, Stanislav Fomichev wrote: On 02/27, Bastien Curutchet (eBPF Foundation) wrote: ip6gre tunnels are tested in the test_tunnel.sh but not in the test_progs framework. Add a new test in test_progs to test ip6gre tunnels. It uses the same network topology and the

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

2025-03-13 Thread Bastien Curutchet
Hi all, On 3/13/25 11:47 AM, Bastien Curutchet (eBPF Foundation) wrote: Hi all, This patch series continues the work to migrate the script tests into prog_tests. The test_xsk.sh script tests lots of AF_XDP use cases. The tests it uses are defined in xksxceiver.c. As this script is used to

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

2025-03-14 Thread Bastien Curutchet
Hi Maciej On 3/14/25 4:45 PM, Maciej Fijalkowski wrote: On Thu, Mar 13, 2025 at 11:47:58AM +0100, Bastien Curutchet (eBPF Foundation) wrote: Hi all, This patch series continues the work to migrate the script tests into prog_tests. Hi Bastien, the sole purpose of this is a cleanup of some

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

2025-03-18 Thread Bastien Curutchet
Hi all, On 2/24/25 5:10 PM, Stanislav Fomichev wrote: On 02/21, Bastien Curutchet (eBPF Foundation) wrote: Hi all, This patch series continues the work to migrate the script tests into prog_tests. test_xdp_vlan.sh tests the ability of an XDP program to modify the VLAN ids on the fly. This

Re: [PATCH 10/13] selftests/bpf: test_xsk: Split xskxceiver

2025-03-18 Thread Bastien Curutchet
Hi Maciej, On 3/18/25 2:16 PM, Maciej Fijalkowski wrote: On Thu, Mar 13, 2025 at 11:48:08AM +0100, Bastien Curutchet (eBPF Foundation) wrote: AF_XDP features are tested by the test_xsk.sh script but not by the test_progs framework. The tests used by the script are defined in xksxceiver.c

[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 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 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 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 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 07/14] selftests/bpf: test_xdp_veth: Add prog_config[] table

2025-01-30 Thread Bastien Curutchet (eBPF Foundation)
given veth pair. Use bpf_object__find_program_by_name() / bpf_xdp_attach() API instead of bpf_program__attach_xdp() to retrieve the BPF programs from their names. Detach BPF progs in the cleanup() as it's not automatically done by this API. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curu

[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 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 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 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 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 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 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 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] 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 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 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 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 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 v2 1/3] selftests/bpf: test_xdp_redirect: Rename BPF sections

2025-01-10 Thread Bastien Curutchet (eBPF Foundation)
ection name to load the BPF program. Reviewed-by: Alexis Lothoré (eBPF Foundation) Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/progs/test_xdp_redirect.c | 4 ++-- tools/testing/selftests/bpf/test_xdp_redirect.sh | 4 ++-- 2 files changed, 4 insertio

[PATCH bpf-next v2 2/3] selftests/bpf: Migrate test_xdp_redirect.sh to xdp_do_redirect.c

2025-01-10 Thread Bastien Curutchet (eBPF Foundation)
entry. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 1 - .../selftests/bpf/prog_tests/xdp_do_redirect.c | 165 + tools/testing/selftests/bpf/test_xdp_redirect.sh | 79 -- 3 files changed, 165 inser

[PATCH bpf-next v2 0/3] selftests: bpf: Migrate test_xdp_redirect.sh to test_progs

2025-01-10 Thread Bastien Curutchet (eBPF Foundation)
ts the DRV mode. The patch series adds two new test cases in prog_tests/xdp_do_redirect.c to replace the test_xdp_redirect.sh script. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Changes in v2: - Use directly skel->progs instead of 'bpf_object__find_program_by_name()' -

[PATCH bpf-next v2 3/3] selftests/bpf: Migrate test_xdp_redirect.c to test_xdp_do_redirect.c

2025-01-10 Thread Bastien Curutchet (eBPF Foundation)
Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/xdp_do_redirect.c | 7 +++--- .../selftests/bpf/progs/test_xdp_do_redirect.c | 12 ++ .../selftests/bpf/progs/test_xdp_redirect.c| 26 -- 3 files changed, 15 insertions

[PATCH bpf-next 07/10] selftests/bpf: Optionally select broadcasting flags

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
d-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/testing/selftests/bpf/

[PATCH bpf-next 05/10] selftests/bpf: test_xdp_veth: Add XDP flags to prog_configuration

2025-01-21 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. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c | 14 -- 1 file changed

[PATCH bpf-next 04/10] selftests/bpf: test_xdp_veth: Add prog_config[] table

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
given veth pair. Use bpf_object__find_program_by_name() / bpf_xdp_attach() API instead of bpf_program__attach_xdp() to retrieve the BPF programs from their names. Detach BPF progs in the cleanup() as it's not automatically done by this API. Signed-off-by: Bastien Curutchet (eBPF Found

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

2025-01-21 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 Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 27

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

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
The tests done by test_xdp_redirect_multi.sh are now fully covered by the CI through test_xdp_veth.c. Remove test_xdp_redirect_multi.sh Remove xdp_redirect_multi.c that was used by the script to load and attach the BPF programs. Remove their entries in the Makefile Signed-off-by: Bastien

[PATCH bpf-next 08/10] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests

2025-01-21 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 Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 149 + .../testing/selftests/bpf/progs

[PATCH bpf-next 09/10] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-21 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. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 123 + .../testing/selftests/bpf/progs/xdp_redirect_map.c

[PATCH bpf-next v2 08/10] selftests/bpf: test_xdp_veth: Add XDP broadcast redirection tests

2025-01-21 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 Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c

[PATCH bpf-next v2 07/10] selftests/bpf: Optionally select broadcasting flags

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
d-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/testing/selftests/bpf/

[PATCH bpf-next v2 09/10] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-01-21 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. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 123 + .../testing/selftests/bpf/progs/xdp_redirect_map.c

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

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
The tests done by test_xdp_redirect_multi.sh are now fully covered by the CI through test_xdp_veth.c. Remove test_xdp_redirect_multi.sh Remove xdp_redirect_multi.c that was used by the script to load and attach the BPF programs. Remove their entries in the Makefile Signed-off-by: Bastien

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

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
neric and allow to configure different test cases - PATCH 6 adds test cases for 'classic' bpf_redirect_map() - PATCH 7 & 8 covers the broadcast flags - PATCH 9 covers the XDP egress programs - PATCH 10 removes test_xdp_redirect_multi.sh Signed-off-by: Bastien Curutch

[PATCH bpf-next 01/10] selftests/bpf: test_xdp_veth: Split network configuration

2025-01-21 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 Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftest

[PATCH bpf-next 03/10] selftests/bpf: test_xdp_veth: Rename config[]

2025-01-21 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 variable. Rename config[] to net_config[]. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c

[PATCH bpf-next 02/10] selftests/bpf: Remove unused argument

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
check_ping() doesn't use the struct skeletons it has as input. Remove the unused input. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/self

[PATCH bpf-next v2 01/10] selftests/bpf: test_xdp_veth: Split network configuration

2025-01-21 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 Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftest

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

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
neric and allow to configure different test cases - PATCH 6 adds test cases for 'classic' bpf_redirect_map() - PATCH 7 & 8 covers the broadcast flags - PATCH 9 covers the XDP egress programs - PATCH 10 removes test_xdp_redirect_multi.sh Signed-off-by: Bastien Curutch

[PATCH bpf-next v2 02/10] selftests/bpf: Remove unused argument

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
check_ping() doesn't use the struct skeletons it has as input. Remove the unused input. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/self

[PATCH bpf-next v2 03/10] selftests/bpf: test_xdp_veth: Rename config[]

2025-01-21 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 variable. Rename config[] to net_config[]. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c

[PATCH bpf-next v2 04/10] selftests/bpf: test_xdp_veth: Add prog_config[] table

2025-01-21 Thread Bastien Curutchet (eBPF Foundation)
given veth pair. Use bpf_object__find_program_by_name() / bpf_xdp_attach() API instead of bpf_program__attach_xdp() to retrieve the BPF programs from their names. Detach BPF progs in the cleanup() as it's not automatically done by this API. Signed-off-by: Bastien Curutchet (eBPF Found

[PATCH bpf-next v2 05/10] selftests/bpf: test_xdp_veth: Add XDP flags to prog_configuration

2025-01-21 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. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c | 14 -- 1 file changed

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

2025-01-21 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 Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/test_xdp_veth.c | 27

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

2025-01-28 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 v3 01/14] selftests/bpf: helpers: Add append_tid()

2025-01-28 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 v3 00/14] selftests/bpf: Migrate test_xdp_redirect_multi.sh to test_progs

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
ulti.sh Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Changes in v3: - Add append_tid() helper and use unique names to allow parallel testing - Check create_network()'s return value through ASSERT_OK() - Remove check_ping() and unused defines - Change next_veth type (from string

[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/

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

2025-01-28 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 v3 07/14] selftests/bpf: test_xdp_veth: Add prog_config[] table

2025-01-28 Thread Bastien Curutchet (eBPF Foundation)
given veth pair. Use bpf_object__find_program_by_name() / bpf_xdp_attach() API instead of bpf_program__attach_xdp() to retrieve the BPF programs from their names. Detach BPF progs in the cleanup() as it's not automatically done by this API. Acked-by: Stanislav Fomichev Signed-off-by: Bastien Curu

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

2025-01-28 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 v3 04/14] selftests/bpf: test_xdp_veth: Use int to describe next veth

2025-01-28 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 v3 03/14] selftests/bpf: test_xdp_veth: Remove unecessarry check_ping()

2025-01-28 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 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 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 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 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 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 1/3] selftests/bpf: test_xdp_redirect: Rename BPF sections

2025-01-03 Thread Bastien Curutchet (eBPF Foundation)
ection name to load the BPF program. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/progs/test_xdp_redirect.c | 4 ++-- tools/testing/selftests/bpf/test_xdp_redirect.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 0/3] selftests: bpf: Migrate test_xdp_redirect.sh to test_progs

2025-01-03 Thread Bastien Curutchet (eBPF Foundation)
ts the DRV mode. The patch series adds two new test cases in prog_tests/xdp_do_redirect.c to replace the test_xdp_redirect.sh script. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- Bastien Curutchet (eBPF Foundation) (3): selftests/bpf: test_xdp_redirect: Rename BPF sections

[PATCH 3/3] selftests/bpf: Migrate test_xdp_redirect.c to test_xdp_do_redirect.c

2025-01-03 Thread Bastien Curutchet (eBPF Foundation)
Signed-off-by: Bastien Curutchet (eBPF Foundation) --- .../selftests/bpf/prog_tests/xdp_do_redirect.c | 7 +++--- .../selftests/bpf/progs/test_xdp_do_redirect.c | 12 ++ .../selftests/bpf/progs/test_xdp_redirect.c| 26 -- 3 files changed, 15 insertions

[PATCH 2/3] selftests/bpf: Migrate test_xdp_redirect.sh to xdp_do_redirect.c

2025-01-03 Thread Bastien Curutchet (eBPF Foundation)
entry. Signed-off-by: Bastien Curutchet (eBPF Foundation) --- tools/testing/selftests/bpf/Makefile | 1 - .../selftests/bpf/prog_tests/xdp_do_redirect.c | 193 + tools/testing/selftests/bpf/test_xdp_redirect.sh | 79 - 3 files changed, 193 inser

[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 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 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 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 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 01/10] selftests/bpf: test_tunnel: Add generic_attach* helpers

2025-02-27 Thread Bastien Curutchet (eBPF Foundation)
A fair amount of code duplication is present among tests to attach BPF programs. Create generic_attach* helpers that attach BPF programs to a given interface. Use ASSERT_OK_FD() instead of ASSERT_GE() to check fd's validity. Use these helpers in all the available tests. Signed-off-by: Ba

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

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

[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 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 06/10] selftests/bpf: test_tunnel: Move ip6erspan tunnel test to test_progs

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

  1   2   >