summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/xdping_kern.c
diff options
context:
space:
mode:
authorDaniel Borkmann2019-07-05 22:52:26 +0200
committerDaniel Borkmann2019-07-05 22:52:27 +0200
commite232cb6ff75bbfdae86e01ada24ead7528dbebe4 (patch)
treedcb5097948742ffc5be049ae008120ec7a18c522 /tools/testing/selftests/bpf/progs/xdping_kern.c
parentMerge branch 'bpf-libbpf-link-trace' (diff)
parentselftests/bpf: convert legacy BPF maps to BTF-defined ones (diff)
downloadkernel-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/progs/xdping_kern.c')
-rw-r--r--tools/testing/selftests/bpf/progs/xdping_kern.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/testing/selftests/bpf/progs/xdping_kern.c b/tools/testing/selftests/bpf/progs/xdping_kern.c
index 87393e7c667c..112a2857f4e2 100644
--- a/tools/testing/selftests/bpf/progs/xdping_kern.c
+++ b/tools/testing/selftests/bpf/progs/xdping_kern.c
@@ -17,12 +17,12 @@
#include "xdping.h"
-struct bpf_map_def SEC("maps") ping_map = {
- .type = BPF_MAP_TYPE_HASH,
- .key_size = sizeof(__u32),
- .value_size = sizeof(struct pinginfo),
- .max_entries = 256,
-};
+struct {
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __uint(max_entries, 256);
+ __type(key, __u32);
+ __type(value, struct pinginfo);
+} ping_map SEC(".maps");
static __always_inline void swap_src_dst_mac(void *data)
{