aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/test_tc_edt.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-01-19 22:05:27 -0800
committerAlexei Starovoitov <ast@kernel.org>2022-01-20 21:19:05 -0800
commitccc3f56918f670ccb5b8df2c6a15cbd083a4dd03 (patch)
treeef41b0e3950e32a62974dc7aa77c68283be3d4c2 /tools/testing/selftests/bpf/progs/test_tc_edt.c
parentselftests/bpf: fail build on compilation warning (diff)
downloadlinux-ccc3f56918f670ccb5b8df2c6a15cbd083a4dd03.tar.xz
linux-ccc3f56918f670ccb5b8df2c6a15cbd083a4dd03.zip
selftests/bpf: convert remaining legacy map definitions
Converted few remaining legacy BPF map definition to BTF-defined ones. For the remaining two bpf_map_def-based legacy definitions that we want to keep for testing purposes until libbpf 1.0 release, guard them in pragma to suppres deprecation warnings which will be added in libbpf in the next commit. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20220120060529.1890907-3-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_tc_edt.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_tc_edt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_tc_edt.c b/tools/testing/selftests/bpf/progs/test_tc_edt.c
index bf28814bfde5..950a70b61e74 100644
--- a/tools/testing/selftests/bpf/progs/test_tc_edt.c
+++ b/tools/testing/selftests/bpf/progs/test_tc_edt.c
@@ -17,12 +17,12 @@
#define THROTTLE_RATE_BPS (5 * 1000 * 1000)
/* flow_key => last_tstamp timestamp used */
-struct bpf_map_def SEC("maps") flow_map = {
- .type = BPF_MAP_TYPE_HASH,
- .key_size = sizeof(uint32_t),
- .value_size = sizeof(uint64_t),
- .max_entries = 1,
-};
+struct {
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __type(key, uint32_t);
+ __type(value, uint64_t);
+ __uint(max_entries, 1);
+} flow_map SEC(".maps");
static inline int throttle_flow(struct __sk_buff *skb)
{