hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/samples/bpf/xdp2_kern.c
....@@ -12,14 +12,14 @@
1212 #include <linux/if_vlan.h>
1313 #include <linux/ip.h>
1414 #include <linux/ipv6.h>
15
-#include "bpf_helpers.h"
15
+#include <bpf/bpf_helpers.h>
1616
17
-struct bpf_map_def SEC("maps") rxcnt = {
18
- .type = BPF_MAP_TYPE_PERCPU_ARRAY,
19
- .key_size = sizeof(u32),
20
- .value_size = sizeof(long),
21
- .max_entries = 256,
22
-};
17
+struct {
18
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
19
+ __type(key, u32);
20
+ __type(value, long);
21
+ __uint(max_entries, 256);
22
+} rxcnt SEC(".maps");
2323
2424 static void swap_src_dst_mac(void *data)
2525 {