selftests/bpf: Fix endianness issues in sk_lookup/ctx_narrow_access
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 29 Sep 2020 20:18:14 +0000 (22:18 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Sep 2020 23:28:34 +0000 (16:28 -0700)
commit6458bde368cee77e798d05cccd2316db4d748c41
treebd5993944069c840f8d1af6cf230c3d1101b9745
parentc810b31ecb036b94629726d6219ad21b0c7a64a2
selftests/bpf: Fix endianness issues in sk_lookup/ctx_narrow_access

This test makes a lot of narrow load checks while assuming little
endian architecture, and therefore fails on s390.

Fix by introducing LSB and LSW macros and using them to perform narrow
loads.

Fixes: 0ab5539f8584 ("selftests/bpf: Tests for BPF_SK_LOOKUP attach point")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200929201814.44360-1-iii@linux.ibm.com
tools/testing/selftests/bpf/progs/test_sk_lookup.c