diff options
| author | Daniel Borkmann <[email protected]> | 2019-07-05 22:52:26 +0200 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2019-07-05 22:52:27 +0200 |
| commit | e232cb6ff75bbfdae86e01ada24ead7528dbebe4 (patch) | |
| tree | dcb5097948742ffc5be049ae008120ec7a18c522 /tools/testing/selftests/bpf/test_queue_stack_map.h | |
| parent | c5f48c92760115282c80136839eabdbf3183f0b9 (diff) | |
| parent | 1639b17c72fa7ad977ccd0ad6c673e3f7048723b (diff) | |
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 <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/test_queue_stack_map.h')
| -rw-r--r-- | tools/testing/selftests/bpf/test_queue_stack_map.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/testing/selftests/bpf/test_queue_stack_map.h b/tools/testing/selftests/bpf/test_queue_stack_map.h index 295b9b3bc5c7..0e014d3b2b36 100644 --- a/tools/testing/selftests/bpf/test_queue_stack_map.h +++ b/tools/testing/selftests/bpf/test_queue_stack_map.h @@ -10,21 +10,21 @@ int _version SEC("version") = 1; -struct bpf_map_def __attribute__ ((section("maps"), used)) map_in = { - .type = MAP_TYPE, - .key_size = 0, - .value_size = sizeof(__u32), - .max_entries = 32, - .map_flags = 0, -}; - -struct bpf_map_def __attribute__ ((section("maps"), used)) map_out = { - .type = MAP_TYPE, - .key_size = 0, - .value_size = sizeof(__u32), - .max_entries = 32, - .map_flags = 0, -}; +struct { + __uint(type, MAP_TYPE); + __uint(max_entries, 32); + __uint(map_flags, 0); + __uint(key_size, 0); + __uint(value_size, sizeof(__u32)); +} map_in SEC(".maps"); + +struct { + __uint(type, MAP_TYPE); + __uint(max_entries, 32); + __uint(map_flags, 0); + __uint(key_size, 0); + __uint(value_size, sizeof(__u32)); +} map_out SEC(".maps"); SEC("test") int _test(struct __sk_buff *skb) |