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>
Showing
- tools/testing/selftests/bpf/bpf_endian.h 14 additions, 0 deletionstools/testing/selftests/bpf/bpf_endian.h
- tools/testing/selftests/bpf/progs/test_lwt_seg6local.c 6 additions, 10 deletionstools/testing/selftests/bpf/progs/test_lwt_seg6local.c
- tools/testing/selftests/bpf/progs/test_seg6_loop.c 2 additions, 6 deletionstools/testing/selftests/bpf/progs/test_seg6_loop.c
Loading
Please register or sign in to comment