samples: bpf: update map definition to new syntax BTF-defined map
[linux-2.6-block.git] / samples / bpf / xdp_adjust_tail_kern.c
index c616508befb98ba83ae2e9cc6b3063e1c5f2f7bf..0f707e0fb37558a0c73ec49e137f8d9a98317088 100644 (file)
 /* volatile to prevent compiler optimizations */
 static volatile __u32 max_pcktsz = MAX_PCKT_SIZE;
 
-struct bpf_map_def SEC("maps") icmpcnt = {
-       .type = BPF_MAP_TYPE_ARRAY,
-       .key_size = sizeof(__u32),
-       .value_size = sizeof(__u64),
-       .max_entries = 1,
-};
+struct {
+       __uint(type, BPF_MAP_TYPE_ARRAY);
+       __type(key, __u32);
+       __type(value, __u64);
+       __uint(max_entries, 1);
+} icmpcnt SEC(".maps");
 
 static __always_inline void count_icmp(void)
 {