summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_xdp_loop.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-07-05 08:50:12 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2019-07-05 22:52:25 +0200
commit1639b17c72fa7ad977ccd0ad6c673e3f7048723b (patch)
treedcb5097948742ffc5be049ae008120ec7a18c522 /tools/testing/selftests/bpf/progs/test_xdp_loop.c
parentbc7430cc8bfb51577e466a8ca02ad87375a70bde (diff)
downloadlinux-1639b17c72fa7ad977ccd0ad6c673e3f7048723b.tar.bz2
selftests/bpf: convert legacy BPF maps to BTF-defined ones
Convert selftests that were originally left out and new ones added recently to consistently use BTF-defined maps. Reported-by: kernel test robot <rong.a.chen@intel.com> Signed-off-by: Andrii Nakryiko <andriin@fb.com> Acked-by: Song Liu <songliubraving@fb.com> Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_xdp_loop.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_xdp_loop.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_xdp_loop.c b/tools/testing/selftests/bpf/progs/test_xdp_loop.c
index 7fa4677df22e..97175f73c3fe 100644
--- a/tools/testing/selftests/bpf/progs/test_xdp_loop.c
+++ b/tools/testing/selftests/bpf/progs/test_xdp_loop.c
@@ -18,19 +18,19 @@
int _version SEC("version") = 1;
-struct bpf_map_def SEC("maps") rxcnt = {
- .type = BPF_MAP_TYPE_PERCPU_ARRAY,
- .key_size = sizeof(__u32),
- .value_size = sizeof(__u64),
- .max_entries = 256,
-};
-
-struct bpf_map_def SEC("maps") vip2tnl = {
- .type = BPF_MAP_TYPE_HASH,
- .key_size = sizeof(struct vip),
- .value_size = sizeof(struct iptnl_info),
- .max_entries = MAX_IPTNL_ENTRIES,
-};
+struct {
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
+ __uint(max_entries, 256);
+ __type(key, __u32);
+ __type(value, __u64);
+} rxcnt SEC(".maps");
+
+struct {
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __uint(max_entries, MAX_IPTNL_ENTRIES);
+ __type(key, struct vip);
+ __type(value, struct iptnl_info);
+} vip2tnl SEC(".maps");
static __always_inline void count_tx(__u32 protocol)
{