selftests/bpf: Fix test_core_autosize on big-endian machines
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 12 Aug 2021 22:48:14 +0000 (00:48 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 13 Aug 2021 23:40:40 +0000 (16:40 -0700)
commitd164dd9a5c08c16a883b3de97d13948c7be7fa4d
treece9b46806c3ff1adca32beafc3e3d10773fe52a1
parent2211c825e7b6b99bbcabab4e0130a2779275dcc3
selftests/bpf: Fix test_core_autosize on big-endian machines

The "probed" part of test_core_autosize copies an integer using
bpf_core_read() into an integer of a potentially different size.
On big-endian machines a destination offset is required for this to
produce a sensible result.

Fixes: 888d83b961f6 ("selftests/bpf: Validate libbpf's auto-sizing of LD/ST/STX instructions")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210812224814.187460-1-iii@linux.ibm.com
tools/testing/selftests/bpf/progs/test_core_autosize.c