selftests/bpf: introduce bpf_cpu_to_be64 and bpf_be64_to_cpu
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 30 Aug 2019 11:07:29 +0000 (13:07 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 3 Sep 2019 19:01:52 +0000 (21:01 +0200)
commitb9632679944307f3caab183fa69a4d79ffeb40ce
treeb77888de194fbd005964c463913ca970ac18bcc5
parent504792e07a44844f24e9d79913e4a2f8373cd332
selftests/bpf: introduce bpf_cpu_to_be64 and bpf_be64_to_cpu

test_lwt_seg6local and test_seg6_loop use custom 64-bit endianness
conversion macros. Centralize their definitions in bpf_endian.h in order
to reduce code duplication. This will also be useful when bpf_endian.h
is promoted to an offical libbpf header.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/bpf_endian.h
tools/testing/selftests/bpf/progs/test_lwt_seg6local.c
tools/testing/selftests/bpf/progs/test_seg6_loop.c