Commit Graph

5 Commits

Author SHA1 Message Date
Menglong Dong 8b37a36bb9 bpf: Add selftests for BPF_MODIFY_RETURN
Test for two scenarios:

* When the fmod_ret program returns 0, the original function should
be called along with fentry and fexit programs.
* When the fmod_ret program returns a non-zero value, the original
function should not be called, no side effect should be observed and
fentry and fexit programs should be called.

The result from the kernel function call and whether a side-effect is
observed is returned via the retval attr of the BPF_PROG_TEST_RUN (bpf)
syscall.

Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200304191853.1529-8-kpsingh@chromium.org

Signed-off-by: Menglong Dong <imagedong@tencent.com>
2022-06-21 10:27:18 +08:00
Menglong Dong 8a58c81476 selftests/bpf: sync fentry/fexit test from upstream
Signed-off-by: Menglong Dong <imagedong@tencent.com>
2022-06-21 10:27:18 +08:00
Alexei Starovoitov e72275bb50 bpf: Add kernel test functions for fentry testing
[upstream commit faeb2dce084aff92d466c6ce68481989b815435b]

Add few kernel functions with various number of arguments,
their types and sizes for BPF trampoline testing to cover
different calling conventions.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20191114185720.1641606-9-ast@kernel.org
2022-06-21 10:27:18 +08:00
Björn Töpel 731b7811cd bpf: Start using the BPF dispatcher in BPF_TEST_RUN
[upstream commit f23c4b3924d2e9382820ee677b68d42d5dd7b08b]

In order to properly exercise the BPF dispatcher, this commit adds BPF
dispatcher usage to BPF_TEST_RUN when executing XDP programs.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191213175112.30208-5-bjorn.topel@gmail.com
2022-06-21 10:27:06 +08:00
Kaixu Xia 590eaf1fec Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
2021-03-16 11:01:34 +08:00