#
a2cb20de |
| 10-Jul-2024 |
Geliang Tang <tanggeliang@kylinos.cn> |
selftests/bpf: Close obj in error path in xdp_adjust_tail
[ Upstream commit 52b49ec1b2c78deb258596c3b231201445ef5380 ]
If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj" opened
selftests/bpf: Close obj in error path in xdp_adjust_tail
[ Upstream commit 52b49ec1b2c78deb258596c3b231201445ef5380 ]
If bpf_object__load() fails in test_xdp_adjust_frags_tail_grow(), "obj" opened before this should be closed. So use "goto out" to close it instead of using "return" here.
Fixes: 110221081aac ("bpf: selftests: update xdp_adjust_tail selftest to include xdp frags") Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn> Link: https://lore.kernel.org/r/f282a1ed2d0e3fb38cceefec8e81cabb69cab260.1720615848.git.tanggeliang@kylinos.cn Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
26e8a014 |
| 27-Jan-2023 |
Ilya Leoshkevich <iii@linux.ibm.com> |
selftests/bpf: Fix test_xdp_adjust_tail_grow2 on s390x
s390x cache line size is 256 bytes, so skb_shared_info must be aligned on a much larger boundary than for x86.
Signed-off-by: Ilya Leoshkevich
selftests/bpf: Fix test_xdp_adjust_tail_grow2 on s390x
s390x cache line size is 256 bytes, so skb_shared_info must be aligned on a much larger boundary than for x86.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Link: https://lore.kernel.org/r/20230128000650.1516334-17-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
show more ...
|
#
cbc1c998 |
| 11-Oct-2022 |
Xu Kuohai <xukuohai@huawei.com> |
selftest/bpf: Fix error usage of ASSERT_OK in xdp_adjust_tail.c
xdp_adjust_tail.c calls ASSERT_OK() to check the return value of bpf_prog_test_load(), but the condition is not correct. Fix it.
Fixe
selftest/bpf: Fix error usage of ASSERT_OK in xdp_adjust_tail.c
xdp_adjust_tail.c calls ASSERT_OK() to check the return value of bpf_prog_test_load(), but the condition is not correct. Fix it.
Fixes: 791cad025051 ("bpf: selftests: Get rid of CHECK macro in xdp_adjust_tail.c") Signed-off-by: Xu Kuohai <xukuohai@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://lore.kernel.org/bpf/20221011120108.782373-7-xukuohai@huaweicloud.com
show more ...
|
#
4abdb1d5 |
| 11-Oct-2022 |
Xu Kuohai <xukuohai@huawei.com> |
selftests/bpf: Fix error failure of case test_xdp_adjust_tail_grow
test_xdp_adjust_tail_grow failed with ipv6: test_xdp_adjust_tail_grow:FAIL:ipv6 unexpected error: -28 (errno 28)
The reason is t
selftests/bpf: Fix error failure of case test_xdp_adjust_tail_grow
test_xdp_adjust_tail_grow failed with ipv6: test_xdp_adjust_tail_grow:FAIL:ipv6 unexpected error: -28 (errno 28)
The reason is that this test case tests ipv4 before ipv6, and when ipv4 test finished, topts.data_size_out was set to 54, which is smaller than the ipv6 output data size 114, so ipv6 test fails with NOSPC error.
Fix it by reset topts.data_size_out to sizeof(buf) before testing ipv6.
Fixes: 04fcb5f9a104 ("selftests/bpf: Migrate from bpf_prog_test_run") Signed-off-by: Xu Kuohai <xukuohai@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://lore.kernel.org/bpf/20221011120108.782373-6-xukuohai@huaweicloud.com
show more ...
|
#
afef88e6 |
| 01-Sep-2022 |
Daniel Müller <deso@posteo.net> |
selftests/bpf: Store BPF object files with .bpf.o extension
BPF object files are, in a way, the final artifact produced as part of the ahead-of-time compilation process. That makes them somewhat spe
selftests/bpf: Store BPF object files with .bpf.o extension
BPF object files are, in a way, the final artifact produced as part of the ahead-of-time compilation process. That makes them somewhat special compared to "regular" object files, which are a intermediate build artifacts that can typically be removed safely. As such, it can make sense to name them differently to make it easier to spot this difference at a glance.
Among others, libbpf-bootstrap [0] has established the extension .bpf.o for BPF object files. It seems reasonable to follow this example and establish the same denomination for selftest build artifacts. To that end, this change adjusts the corresponding part of the build system and the test programs loading BPF object files to work with .bpf.o files.
[0] https://github.com/libbpf/libbpf-bootstrap
Suggested-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Müller <deso@posteo.net> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20220901222253.1199242-1-deso@posteo.net
show more ...
|
#
5912fcb4 |
| 08-Feb-2022 |
Hou Tao <houtao1@huawei.com> |
selftests/bpf: Do not export subtest as standalone test
Two subtests in ksyms_module.c are not qualified as static, so these subtests are exported as standalone tests in tests.h and lead to confusio
selftests/bpf: Do not export subtest as standalone test
Two subtests in ksyms_module.c are not qualified as static, so these subtests are exported as standalone tests in tests.h and lead to confusion for the output of "./test_progs -t ksyms_module".
By using the following command ...
grep "^void \(serial_\)\?test_[a-zA-Z0-9_]\+(\(void\)\?)" \ tools/testing/selftests/bpf/prog_tests/*.c | \ awk -F : '{print $1}' | sort | uniq -c | awk '$1 != 1'
... one finds out that other tests also have a similar problem, so fix these tests by marking subtests in these tests as static.
Signed-off-by: Hou Tao <houtao1@huawei.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20220208065444.648778-1-houtao1@huawei.com
show more ...
|
#
39316183 |
| 02-Feb-2022 |
Delyan Kratunov <delyank@fb.com> |
selftests/bpf: Migrate from bpf_prog_test_run_xattr
bpf_prog_test_run_xattr is being deprecated in favor of the OPTS-based bpf_prog_test_run_opts. We end up unable to use CHECK_ATTR so replace usage
selftests/bpf: Migrate from bpf_prog_test_run_xattr
bpf_prog_test_run_xattr is being deprecated in favor of the OPTS-based bpf_prog_test_run_opts. We end up unable to use CHECK_ATTR so replace usages with ASSERT_* calls. Also, prog_run_xattr is now prog_run_opts.
Signed-off-by: Delyan Kratunov <delyank@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220202235423.1097270-3-delyank@fb.com
show more ...
|
#
04fcb5f9 |
| 02-Feb-2022 |
Delyan Kratunov <delyank@fb.com> |
selftests/bpf: Migrate from bpf_prog_test_run
bpf_prog_test_run is being deprecated in favor of the OPTS-based bpf_prog_test_run_opts. We end up unable to use CHECK in most cases, so replace usages
selftests/bpf: Migrate from bpf_prog_test_run
bpf_prog_test_run is being deprecated in favor of the OPTS-based bpf_prog_test_run_opts. We end up unable to use CHECK in most cases, so replace usages with ASSERT_* calls.
Signed-off-by: Delyan Kratunov <delyank@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220202235423.1097270-2-delyank@fb.com
show more ...
|
#
11022108 |
| 21-Jan-2022 |
Eelco Chaudron <echaudro@redhat.com> |
bpf: selftests: update xdp_adjust_tail selftest to include xdp frags
This change adds test cases for the xdp frags scenarios when shrinking and growing.
Acked-by: Toke Hoiland-Jorgensen <toke@redha
bpf: selftests: update xdp_adjust_tail selftest to include xdp frags
This change adds test cases for the xdp frags scenarios when shrinking and growing.
Acked-by: Toke Hoiland-Jorgensen <toke@redhat.com> Acked-by: John Fastabend <john.fastabend@gmail.com> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Eelco Chaudron <echaudro@redhat.com> Link: https://lore.kernel.org/r/d2e6a0ebc52db6f89e62b9befe045032e5e0a5fe.1642758637.git.lorenzo@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
show more ...
|
#
791cad02 |
| 20-Jan-2022 |
Lorenzo Bianconi <lorenzo@kernel.org> |
bpf: selftests: Get rid of CHECK macro in xdp_adjust_tail.c
Rely on ASSERT* macros and get rid of deprecated CHECK ones in xdp_adjust_tail bpf selftest.
Signed-off-by: Lorenzo Bianconi <lorenzo@ker
bpf: selftests: Get rid of CHECK macro in xdp_adjust_tail.c
Rely on ASSERT* macros and get rid of deprecated CHECK ones in xdp_adjust_tail bpf selftest.
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/c0ab002ffa647a20ec9e584214bf0d4373142b54.1642679130.git.lorenzo@kernel.org
show more ...
|
#
cbdb1461 |
| 03-Nov-2021 |
Andrii Nakryiko <andrii@kernel.org> |
selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere
-Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and breaks when deprecation goes into effect due to macro magic. Co
selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere
-Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and breaks when deprecation goes into effect due to macro magic. Convert all the uses to explicit bpf_prog_test_load() calls which avoid deprecation errors and makes everything less magical.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Dave Marchevsky <davemarchevsky@fb.com> Link: https://lore.kernel.org/bpf/20211103220845.2676888-12-andrii@kernel.org
show more ...
|
#
6972dc3b |
| 22-Oct-2021 |
Andrii Nakryiko <andrii@kernel.org> |
selftests/bpf: Normalize selftest entry points
Ensure that all test entry points are global void functions with no input arguments. Mark few subtest entry points as static.
Signed-off-by: Andrii Na
selftests/bpf: Normalize selftest entry points
Ensure that all test entry points are global void functions with no input arguments. Mark few subtest entry points as static.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20211022223228.99920-2-andrii@kernel.org
show more ...
|
#
7ae2e00e |
| 14-May-2020 |
Jesper Dangaard Brouer <brouer@redhat.com> |
selftests/bpf: Xdp_adjust_tail add grow tail tests
Extend BPF selftest xdp_adjust_tail with grow tail tests, which is added as subtest's. The first grow test stays in same form as original shrink te
selftests/bpf: Xdp_adjust_tail add grow tail tests
Extend BPF selftest xdp_adjust_tail with grow tail tests, which is added as subtest's. The first grow test stays in same form as original shrink test. The second grow test use the newer bpf_prog_test_run_xattr() calls, and does extra checking of data contents.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/158945350567.97035.9632611946765811876.stgit@firesoul
show more ...
|
#
68545fb6 |
| 14-May-2020 |
Jesper Dangaard Brouer <brouer@redhat.com> |
selftests/bpf: Adjust BPF selftest for xdp_adjust_tail
Current selftest for BPF-helper xdp_adjust_tail only shrink tail. Make it more clear that this is a shrink test case.
Signed-off-by: Jesper Da
selftests/bpf: Adjust BPF selftest for xdp_adjust_tail
Current selftest for BPF-helper xdp_adjust_tail only shrink tail. Make it more clear that this is a shrink test case.
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/158945350058.97035.17280775016196207372.stgit@firesoul
show more ...
|
#
488a23b8 |
| 08-May-2020 |
Stanislav Fomichev <sdf@google.com> |
selftests/bpf: Move existing common networking parts into network_helpers
1. Move pkt_v4 and pkt_v6 into network_helpers and adjust the users. 2. Copy-paste spin_lock_thread into two tests that use
selftests/bpf: Move existing common networking parts into network_helpers
1. Move pkt_v4 and pkt_v6 into network_helpers and adjust the users. 2. Copy-paste spin_lock_thread into two tests that use it.
Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Andrey Ignatov <rdna@fb.com> Link: https://lore.kernel.org/bpf/20200508174611.228805-3-sdf@google.com
show more ...
|
#
d38835b7 |
| 21-Aug-2019 |
Stanislav Fomichev <sdf@google.com> |
selftests/bpf: test_progs: remove global fail/success counts
Now that we have a global per-test/per-environment state, there is no longer need to have global fail/success counters (and there is no n
selftests/bpf: test_progs: remove global fail/success counts
Now that we have a global per-test/per-environment state, there is no longer need to have global fail/success counters (and there is no need to save/get the diff before/after the test).
Introduce CHECK_FAIL macro (suggested by Andrii) and covert existing tests to it. CHECK_FAIL uses new test__fail() to record the failure.
Cc: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
show more ...
|
#
eaf90740 |
| 01-Mar-2019 |
Stanislav Fomichev <sdf@google.com> |
selftests: bpf: break up test_progs - xdp
Move xdp prog tests into separate files.
Signed-off-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
|