diff options
author | Daniel Borkmann | 2019-07-05 22:52:26 +0200 |
---|---|---|
committer | Daniel Borkmann | 2019-07-05 22:52:27 +0200 |
commit | e232cb6ff75bbfdae86e01ada24ead7528dbebe4 (patch) | |
tree | dcb5097948742ffc5be049ae008120ec7a18c522 /tools/testing/selftests/bpf/bpf_helpers.h | |
parent | Merge branch 'bpf-libbpf-link-trace' (diff) | |
parent | selftests/bpf: convert legacy BPF maps to BTF-defined ones (diff) | |
download | kernel-qcow2-linux-e232cb6ff75bbfdae86e01ada24ead7528dbebe4.tar.gz kernel-qcow2-linux-e232cb6ff75bbfdae86e01ada24ead7528dbebe4.tar.xz kernel-qcow2-linux-e232cb6ff75bbfdae86e01ada24ead7528dbebe4.zip |
Merge branch 'bpf-libbpf-int-btf-map'
Andrii Nakryiko says:
====================
This patch set implements an update to how BTF-defined maps are specified. The
change is in how integer attributes, e.g., type, max_entries, map_flags, are
specified: now they are captured as part of map definition struct's BTF type
information (using array dimension), eliminating the need for compile-time
data initialization and keeping all the metadata in one place.
All existing selftests that were using BTF-defined maps are updated, along
with some other selftests, that were switched to new syntax.
v4->v5:
- revert sample_map_ret0.c, which is loaded with iproute2 (kernel test robot);
v3->v4:
- add acks;
- fix int -> uint type in commit message;
v2->v3:
- rename __int into __uint (Yonghong);
v1->v2:
- split bpf_helpers.h change from libbpf change (Song).
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_helpers.h')
-rw-r--r-- | tools/testing/selftests/bpf/bpf_helpers.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h index 1a5b1accf091..5a3d92c8bec8 100644 --- a/tools/testing/selftests/bpf/bpf_helpers.h +++ b/tools/testing/selftests/bpf/bpf_helpers.h @@ -8,6 +8,9 @@ */ #define SEC(NAME) __attribute__((section(NAME), used)) +#define __uint(name, val) int (*name)[val] +#define __type(name, val) val *name + /* helper macro to print out debug messages */ #define bpf_printk(fmt, ...) \ ({ \ |