summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_pkt_access.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-05-08 17:41:46 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2022-05-09 17:15:32 +0200
commitf760d0537925e2973ed3adc2e590aa2968d0e8dc (patch)
treea19c4f25b7f75e27bf680927ff6e28efe5f1f60b /tools/testing/selftests/bpf/progs/test_pkt_access.c
parent785c3342cf6c520250258d8d7bc0cae1d4461dc8 (diff)
libbpf: Provide barrier() and barrier_var() in bpf_helpers.h
Add barrier() and barrier_var() macros into bpf_helpers.h to be used by end users. While a bit advanced and specialized instruments, they are sometimes indispensable. Instead of requiring each user to figure out exact asm volatile incantations for themselves, provide them from bpf_helpers.h. Also remove conflicting definitions from selftests. Some tests rely on barrier_var() definition being nothing, those will still work as libbpf does the #ifndef/#endif guarding for barrier() and barrier_var(), allowing users to redefine them, if necessary. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20220509004148.1801791-8-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_pkt_access.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_pkt_access.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_pkt_access.c b/tools/testing/selftests/bpf/progs/test_pkt_access.c
index 0558544e1ff0..5cd7c096f62d 100644
--- a/tools/testing/selftests/bpf/progs/test_pkt_access.c
+++ b/tools/testing/selftests/bpf/progs/test_pkt_access.c
@@ -14,8 +14,6 @@
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>
-#define barrier() __asm__ __volatile__("": : :"memory")
-
/* llvm will optimize both subprograms into exactly the same BPF assembly
*
* Disassembly of section .text: