space when they do not match the expected payload
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
The xdp_features rewrite has been tested in a x86_64 qemu environment on my
machine and in CI. In my environment, the test takes a bit less than 2s to
execute.
# ./test_progs -a xdp_feature
space when they do not match the expected payload
- make sure to perform host <-> network endianness conversion on constants
rather than packet parts
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fix endianness management in userspace packet parsing (call htonl on
("selftests/bpf: Add csum helpers")
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing/selftests/bpf/network_helpers.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf/network_helpers.h
b/tools/testing/selftests/bpf/network_helpe
on veth:OK
#560 xdp_cpumap_attach:OK
Summary: 1/3 PASSED, 0 SKIPPED, 0 FAILED
---
Alexis Lothoré (eBPF Foundation) (3):
selftests/bpf: fix bpf_map_redirect call for cpu map test
selftests/bpf: make xdp_cpumap_attach keep redirect prog attached
selftests/bpf: check program
with some dummy
context
While at it, bring the following minor improvements:
- isolate test interface in its own namespace
- replicate the test on a veth pair
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
This change is based on the similar update brought to xdp_devmap_attach
([1]) and then
program performs the configured redirect
as well. The check is based on a global variable incremented by a
chained program executed only if the redirect program properly executes.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- new patch
---
tools/testing/selftests/bpf
fixed before being able improve the corresponding test (ie,
not only test attach/detach but also the redirect feature)
Fix this XDP program by making it redirect packets based on entry 0 in
cpu_map instead of entry 1.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- new patch
Now that btf_skc_cls_ingress has the same coverage as
test_tcp_check_syncookie, remove the second one and keep the first one
as it is integrated in test_progs
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing/selftests/bpf/.gitignore | 1 -
tools/testing/selftests
One remaining difference between test_tcp_check_syncookie.sh and
btf_skc_cls_ingress is a small test on the mss value embedded in the
cookie generated with the eBPF helper.
Bring the corresponding test in btf_skc_cls_ingress.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing
those two tests by moving the code into a
single runner, parameterized by a "gen_cookies" argument. Split the
performed checks accordingly.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/btf_skc_cls_ingress.c | 106 +++--
1 file c
switch from start_server to start_server_str to allow to check
some socket options
- the introduction of new subtests for ipv4 and ipv4/ipv6
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fix odd indent on switch cases
- add missing return or goto in default cases in switches
of converting the CHECK on skel->bss->linum, just remove it,
since there is already a call to print_err_line after the test to
print the failing line in the bpf program
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/btf_skc_cls_ingress.
namespace
management to netns_{new,free}
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- slightly reword commit message to fix mistake
- remove `ip link set lo up` in dedicated ns, handled by netns_new
---
.../selftests/bpf/prog_tests/btf_skc_cls_ingress.c | 33
btf_skc_cls_ingress/syncookie_ipv4:OK
#38/5btf_skc_cls_ingress/syncookie_ipv6:OK
#38/6btf_skc_cls_ingress/syncookie_dual:OK
#38 btf_skc_cls_ingress:OK
Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fix initial test author
btf_skc_cls_ingress/syncookie_ipv4:OK
#38/5btf_skc_cls_ingress/syncookie_ipv6:OK
#38/6btf_skc_cls_ingress/syncookie_dual:OK
#38 btf_skc_cls_ingress:OK
Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Alexis Lothoré (eBPF Foundation) (6
namespace
management to netns_{new,free}
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/btf_skc_cls_ingress.c | 31 ++
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c
those two tests by moving the code into a
single runner, parameterized by a "gen_cookies" argument. Split the
performed checks accordingly.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/btf_skc_cls_ingress.c | 106 +++--
1 file c
of converting the CHECK on skel->bss->linum, just remove it,
since there is already a call to print_err_line after the test to
print the failing line in the bpf program
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/btf_skc_cls_ingress.
Now that btf_skc_cls_ingress has the same coverage as
test_tcp_check_syncookie, remove the second one and keep the first one
as it is integrated in test_progs
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing/selftests/bpf/.gitignore | 1 -
tools/testing/selftests
switch from start_server to start_server_str to allow to check
some socket options
- the introduction of new subtests for ipv4 and ipv4/ipv6
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
The rework has been tested in a local Qemu environment and in CI:
# ./test_progs -a btf_skc_cls_ingress
One remaining difference between test_tcp_check_syncookie.sh and
btf_skc_cls_ingress is a small test on the mss value embedded in the
cookie generated with the eBPF helper.
Bring the corresponding test in btf_skc_cls_ingress.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing
also run in CI.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
The content of this new test is heavily based on the initial
test_flow_dissector.c. I have kept most of the packet build function
(even if not all packet types are used for the test) to allow extending
the test later if needed
The flow dissector test currently relies on generic CHECK macros to
perform tests. Update those to newer, more-specific ASSERT macros.
This update allows to get rid of the global duration variable, which was
needed by the CHECK macros
Signed-off-by: Alexis Lothoré (eBPF Foundation
sector (eg:
__skb_flow_bpf_to_target)
---
Alexis Lothoré (eBPF Foundation) (10):
selftests/bpf: add a macro to compare raw memory
selftests/bpf: use ASSERT_MEMEQ to compare bpf flow keys
selftests/bpf: replace CHECK calls with ASSERT macros in flow_dissector
test
selftests/bpf
run_tests_skb_less (it was only used by the CHECK macro for its duration
field)
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/flow_dissector.c | 36 --
1 file changed, 6 insertions(+), 30 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests
ssector in root namespace
Since the new test is performing operations in the root net namespace,
make sure to set it as a "serial" test to make sure not to conflict with
any other test.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/flow_d
The bpf_flow program is able to handle GRE headers in IP packets. Add a
few test data input simulating those GRE packets, with 2 different
cases:
- parse GRE and the encapsulated packet
- parse GRE only
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests
Now that test_flow_dissector.sh has been converted to test_progs, remove
the legacy test.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing/selftests/bpf/.gitignore | 1 -
tools/testing/selftests/bpf/Makefile | 3 +-
tools/testing/selftests/bpf
Enable CONFIG_NET_ACT_GACT to allow adding simple actions with tc
filters. This is for example needed to migrate test_flow_dissector into
the automated testing performed in CI.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing/selftests/bpf/config | 1 +
1 file changed, 1
comparision
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
tools/testing/selftests/bpf/test_progs.h | 25 +
1 file changed, 25 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_progs.h
b/tools/testing/selftests/bpf/test_progs.h
index
flow_dissector by using
test__start_subtest().
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
This change resulsts in the exposure of 42 subtests with the current
content from flow_dissector:
# ./test_progs -a flow_dissector
#102/1 flow_dissector/ipv4-skb:OK
#102/2 flow_dissector/ipv6-skb:OK
of being able to run them
separately.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/flow_dissector.c | 92 ++
1 file changed, 57 insertions(+), 35 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c
b
s/bpf: migrate flow_dissector namespace
exclusivity test")
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
This small fix addresses an issue discovered while trying to add a new
test in my recently merged work on flow_dissector migration. This new
test is still only present in bpf-next, henc
ssector in root namespace
Since the new test is performing operations in the root net namespace,
make sure to set it as a "serial" test to make sure not to conflict with
any other test.
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3
network_helpers.h provides helpers to compute checksum for pseudo
headers but no helpers to compute the global checksums.
Before adding those, clarify csum_tcpudp_magic and csum_ipv6_magic
purpose by adding some documentation.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3
also run in CI.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- use updated helpers
- do not cast test structure, propagate it as const
- remove duplicate assert
- remove intermediate function for simple test teardown
Changes in v2:
- use new helpers added to network_helpers
Now that test_flow_dissector.sh has been converted to test_progs, remove
the legacy test.
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- none
Changes in v2:
- fetch Acked-by tag
---
tools/testing/selftests/bpf/.gitignore | 1
(eBPF Foundation)
---
Changes in v3:
-none
Changes in v2:
- fetch acked-by tag
---
.../selftests/bpf/prog_tests/flow_dissector.c | 41 +++---
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c
b/tools
of being able to run them
separately. While at it, make sure that tests attaching the bpf programs
are run in a dedicated ns.
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
-none
Changes in v2:
- fix some error path sequences (eg: closing properly
00 00 00 00 00 00
[...]
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- none
Changes in v2:
- replace DUMP_BUFFER with a real function
- make this function take a prefix
- add formatting example in the commit message
---
tools/testing/selftests
nges in v2:
- allow tests to run in parallel
- move some generic helpers to network_helpers.h
- define proper function for ASSERT_MEMEQ
- fetch acked-by tags
- Link to v1:
https://lore.kernel.org/r/20241113-flow_dissector-v1-0-27c4df059...@bootlin.com
---
Alexis Lothoré (eBPF Foundation) (14):
run_tests_skb_less (it was only used by the CHECK macro for its duration
field)
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- none
Changes in v2:
- fetch acked-by tag
---
.../selftests/bpf/prog_tests/flow_dissector.c | 36 --
1 file
The bpf_flow program is able to handle GRE headers in IP packets. Add a
few test data input simulating those GRE packets, with 2 different
cases:
- parse GRE and the encapsulated packet
- parse GRE only
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in
flow_dissector by using
test__start_subtest().
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
-none
Changes in v2:
- fetch Acked-by tag
This change resulsts in the exposure of 42 subtests with the current
content from flow_dissector:
# ./test_progs -a
error is due to struct udphdr being defined in both
and .
Use only in every test. While at it, perform the same
for tcp.h. For some tests, the change needs to be done in the eBPF
program part as well, because of some headers sharing between both
sides.
Signed-off-by: Alexis Lothoré (eBPF
network_helpers.c provides some helpers to generate ip checksums or ip
pseudo-header checksums, but not for upper layers (eg: udp checksums)
Add helpers for udp checksum to allow manually building udp packets.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- reuse pseudo
Enable CONFIG_NET_ACT_GACT to allow adding simple actions with tc
filters. This is for example needed to migrate test_flow_dissector into
the automated testing performed in CI.
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- none
Changes in v2
xdp_metadata test has a small helper computing ipv4 checksums to allow
manually building packets.
Move this helper to network_helpers to share it with other tests.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v3:
- use csum_partial for intermediate helper name to keep sync
also run in CI.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- use new helpers added to network_helpers
The content of this new test is heavily based on the initial
test_flow_dissector.c. I have kept most of the packet build function
(even if not all packet types are used for
Enable CONFIG_NET_ACT_GACT to allow adding simple actions with tc
filters. This is for example needed to migrate test_flow_dissector into
the automated testing performed in CI.
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fetch Acked-by tag
00 00 00 00 00 00
[...]
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- replace DUMP_BUFFER with a real function
- make this function take a prefix
- add formatting example in the commit message
---
tools/testing/selftests/bpf/test_progs.c | 15 +++
tools/testing
of being able to run them
separately. While at it, make sure that tests attaching the bpf programs
are run in a dedicated ns.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fix some error path sequences (eg: closing properly tap interface)
- isolate tests in dedicated ns
- do
flow_dissector by using
test__start_subtest().
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fetch Acked-by tag
This change resulsts in the exposure of 42 subtests with the current
content from flow_dissector:
# ./test_progs -a flow_dissector
#102/1
ssector in root namespace
Since the new test is performing operations in the root net namespace,
make sure to set it as a "serial" test to make sure not to conflict with
any other test.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
.../selftests/bpf/prog_tests/flow_d
network_helpers.c provides some helpers to generate ip checksums or ip
pseudo-header checksums, but not for upper layers (eg: udp checksums)
Add helpers for udp checksum to allow manually building udp packets.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- new patch
network_helpers.h provides helpers to compute checksum for pseudo
headers but no helpers to compute the global checksums.
Before adding those, rename the pseudo header checksum helper to clarify
their role.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- new patch
xdp_metadata test has a small helper computing ipv checksums to allow
manually building packets.
Move this helper to network_helpers to share it with other tests.
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- new patch
---
tools/testing/selftests/bpf/network_helpers.h
The bpf_flow program is able to handle GRE headers in IP packets. Add a
few test data input simulating those GRE packets, with 2 different
cases:
- parse GRE and the encapsulated packet
- parse GRE only
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in
(eBPF Foundation)
---
Changes in v2:
- fetch acked-by tag
---
.../selftests/bpf/prog_tests/flow_dissector.c | 41 +++---
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/flow_dissector.c
b/tools/testing/selftests/bpf
---
Alexis Lothoré (eBPF Foundation) (13):
selftests/bpf: add a macro to compare raw memory
selftests/bpf: use ASSERT_MEMEQ to compare bpf flow keys
selftests/bpf: replace CHECK calls with ASSERT macros in flow_dissector
test
selftests/bpf: re-split main function into dedic
Now that test_flow_dissector.sh has been converted to test_progs, remove
the legacy test.
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fetch Acked-by tag
---
tools/testing/selftests/bpf/.gitignore | 1 -
tools/testing/selftests
run_tests_skb_less (it was only used by the CHECK macro for its duration
field)
Acked-by: Stanislav Fomichev
Signed-off-by: Alexis Lothoré (eBPF Foundation)
---
Changes in v2:
- fetch acked-by tag
---
.../selftests/bpf/prog_tests/flow_dissector.c | 36 --
1 file changed, 6 insertions
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
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
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/
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
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
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
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
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
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
-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
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
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
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
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
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 --
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 |
[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
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
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
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/
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
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
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
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
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
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
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
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
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
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
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
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
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_
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
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 -
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
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
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
1 - 100 of 199 matches
Mail list logo