]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Make test_varlen work with 32-bit user-space arch
authorAndrii Nakryiko <andriin@fb.com>
Thu, 13 Aug 2020 20:49:45 +0000 (13:49 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 13 Aug 2020 23:45:41 +0000 (16:45 -0700)
commit7c0f98aafc74caf743cdb7eae9a09b6b5b9b20c3
tree29871d1e9eaaf2461ebc6e47b21b2587a1e0e1ea
parent8e7f589ce0ccfdd9709d09c4aca3dd7ae6862739
selftests/bpf: Make test_varlen work with 32-bit user-space arch

Despite bpftool generating data section memory layout that will work for
32-bit architectures on user-space side, BPF programs should be careful to not
use ambiguous types like `long`, which have different size in 32-bit and
64-bit environments. Fix that in test by using __u64 explicitly, which is
a recommended approach anyway.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200813204945.1020225-10-andriin@fb.com
tools/testing/selftests/bpf/prog_tests/varlen.c
tools/testing/selftests/bpf/progs/test_varlen.c