Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: fix lots of silly mistakes pointed out by compiler

Once we enable -Wall for BPF sources, compiler will complain about lots
of unused variables, variables that are set but never read, etc.

Fix all these issues first before enabling -Wall in Makefile.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230309054015.4068562-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Andrii Nakryiko and committed by
Alexei Starovoitov
c8ed6685 713461b8

+90 -187
-1
tools/testing/selftests/bpf/progs/bpf_iter_ksym.c
··· 33 33 __u32 seq_num = ctx->meta->seq_num; 34 34 unsigned long value; 35 35 char type; 36 - int ret; 37 36 38 37 if (!iter) 39 38 return 0;
-1
tools/testing/selftests/bpf/progs/bpf_iter_setsockopt.c
··· 42 42 char cur_cc[TCP_CA_NAME_MAX]; 43 43 struct tcp_sock *tp; 44 44 struct sock *sk; 45 - int ret; 46 45 47 46 if (!bpf_tcp_sk(ctx->sk_common)) 48 47 return 0;
-2
tools/testing/selftests/bpf/progs/bpf_loop.c
··· 138 138 SEC("fentry/" SYS_PREFIX "sys_nanosleep") 139 139 int prog_non_constant_callback(void *ctx) 140 140 { 141 - struct callback_ctx data = {}; 142 - 143 141 if (bpf_get_current_pid_tgid() >> 32 != pid) 144 142 return 0; 145 143
-1
tools/testing/selftests/bpf/progs/cb_refs.c
··· 52 52 { 53 53 struct prog_test_ref_kfunc *p; 54 54 struct map_value *v; 55 - unsigned long sl; 56 55 57 56 v = bpf_map_lookup_elem(&array_map, &(int){0}); 58 57 if (!v)
-1
tools/testing/selftests/bpf/progs/cgroup_skb_sk_lookup_kern.c
··· 66 66 SEC("cgroup_skb/ingress") 67 67 int ingress_lookup(struct __sk_buff *skb) 68 68 { 69 - __u32 serv_port_key = 0; 70 69 struct ipv6hdr ip6h; 71 70 struct tcphdr tcph; 72 71
+1
tools/testing/selftests/bpf/progs/cgrp_kfunc_failure.c
··· 109 109 acquired = bpf_cgroup_acquire(cgrp); 110 110 111 111 /* Acquired cgroup is never released. */ 112 + __sink(acquired); 112 113 113 114 return 0; 114 115 }
-1
tools/testing/selftests/bpf/progs/cgrp_ls_attach_cgroup.c
··· 84 84 struct sockaddr *uaddr, int addr_len, int flags) 85 85 { 86 86 struct socket_cookie *p; 87 - struct tcp_sock *tcp_sk; 88 87 89 88 if (uaddr->sa_family != AF_INET6) 90 89 return 0;
-1
tools/testing/selftests/bpf/progs/cgrp_ls_sleepable.c
··· 24 24 SEC("?iter.s/cgroup") 25 25 int cgroup_iter(struct bpf_iter__cgroup *ctx) 26 26 { 27 - struct seq_file *seq = ctx->meta->seq; 28 27 struct cgroup *cgrp = ctx->cgroup; 29 28 long *ptr; 30 29
+1 -1
tools/testing/selftests/bpf/progs/core_kern.c
··· 77 77 void *data_end = (void *)(long)ctx->data_end; 78 78 void *data = (void *)(long)ctx->data; 79 79 void *ptr; 80 - int ret = 0, nh_off, i = 0; 80 + int nh_off, i = 0; 81 81 82 82 nh_off = 14; 83 83
+3
tools/testing/selftests/bpf/progs/cpumask_failure.c
··· 23 23 struct bpf_cpumask *cpumask; 24 24 25 25 cpumask = create_cpumask(); 26 + __sink(cpumask); 26 27 27 28 /* cpumask is never released. */ 28 29 return 0; ··· 52 51 53 52 /* Can't acquire a non-struct bpf_cpumask. */ 54 53 cpumask = bpf_cpumask_acquire((struct bpf_cpumask *)task->cpus_ptr); 54 + __sink(cpumask); 55 55 56 56 return 0; 57 57 } ··· 65 63 66 64 /* Can't set the CPU of a non-struct bpf_cpumask. */ 67 65 bpf_cpumask_set_cpu(0, (struct bpf_cpumask *)task->cpus_ptr); 66 + __sink(cpumask); 68 67 69 68 return 0; 70 69 }
-1
tools/testing/selftests/bpf/progs/cpumask_success.c
··· 353 353 int BPF_PROG(test_insert_leave, struct task_struct *task, u64 clone_flags) 354 354 { 355 355 struct bpf_cpumask *cpumask; 356 - struct __cpumask_map_value *v; 357 356 358 357 cpumask = create_cpumask(); 359 358 if (!cpumask)
+3 -2
tools/testing/selftests/bpf/progs/dynptr_fail.c
··· 271 271 __failure __msg("value is outside of the allowed memory range") 272 272 int data_slice_out_of_bounds_map_value(void *ctx) 273 273 { 274 - __u32 key = 0, map_val; 274 + __u32 map_val; 275 275 struct bpf_dynptr ptr; 276 276 void *data; 277 277 ··· 388 388 /* this should fail */ 389 389 *data2 = 3; 390 390 391 - done: 392 391 bpf_ringbuf_discard_dynptr(&ptr, 0); 393 392 return 0; 394 393 } ··· 439 440 440 441 /* this should fail */ 441 442 data = bpf_dynptr_data(&ptr, 0, 1); 443 + __sink(data); 442 444 443 445 return 0; 444 446 } ··· 1374 1374 * changing packet data 1375 1375 */ 1376 1376 hdr = bpf_dynptr_slice_rdwr(&ptr, 0, buffer, sizeof(buffer)); 1377 + __sink(hdr); 1377 1378 1378 1379 return 0; 1379 1380 }
+1 -4
tools/testing/selftests/bpf/progs/dynptr_success.c
··· 35 35 int test_read_write(void *ctx) 36 36 { 37 37 char write_data[64] = "hello there, world!!"; 38 - char read_data[64] = {}, buf[64] = {}; 38 + char read_data[64] = {}; 39 39 struct bpf_dynptr ptr; 40 40 int i; 41 41 ··· 170 170 { 171 171 __u8 write_data[2] = {1, 2}; 172 172 struct bpf_dynptr ptr; 173 - __u64 *data; 174 173 int ret; 175 174 176 175 if (bpf_dynptr_from_skb(skb, 0, &ptr)) { ··· 190 191 SEC("?cgroup_skb/egress") 191 192 int test_dynptr_skb_data(struct __sk_buff *skb) 192 193 { 193 - __u8 write_data[2] = {1, 2}; 194 194 struct bpf_dynptr ptr; 195 195 __u64 *data; 196 - int ret; 197 196 198 197 if (bpf_dynptr_from_skb(skb, 0, &ptr)) { 199 198 err = 1;
-2
tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c
··· 120 120 void *data = (void *)(long)skb->data; 121 121 struct ipv6hdr ip6, *ip6p; 122 122 int ifindex = skb->ifindex; 123 - __u32 eth_proto; 124 - __u32 nh_off; 125 123 126 124 /* check that BPF extension can read packet via direct packet access */ 127 125 if (data + 14 + sizeof(ip6) > data_end)
+1 -1
tools/testing/selftests/bpf/progs/freplace_attach_probe.c
··· 23 23 SEC("freplace/handle_kprobe") 24 24 int new_handle_kprobe(struct pt_regs *ctx) 25 25 { 26 - struct hmap_elem zero = {}, *val; 26 + struct hmap_elem *val; 27 27 int key = 0; 28 28 29 29 val = bpf_map_lookup_elem(&hash_map, &key);
+5 -6
tools/testing/selftests/bpf/progs/iters.c
··· 45 45 int iter_err_unsafe_asm_loop(const void *ctx) 46 46 { 47 47 struct bpf_iter_num it; 48 - int *v, i = 0; 49 48 50 49 MY_PID_GUARD(); 51 50 ··· 87 88 int iter_while_loop(const void *ctx) 88 89 { 89 90 struct bpf_iter_num it; 90 - int *v, i; 91 + int *v; 91 92 92 93 MY_PID_GUARD(); 93 94 ··· 105 106 int iter_while_loop_auto_cleanup(const void *ctx) 106 107 { 107 108 __attribute__((cleanup(bpf_iter_num_destroy))) struct bpf_iter_num it; 108 - int *v, i; 109 + int *v; 109 110 110 111 MY_PID_GUARD(); 111 112 ··· 123 124 int iter_for_loop(const void *ctx) 124 125 { 125 126 struct bpf_iter_num it; 126 - int *v, i; 127 + int *v; 127 128 128 129 MY_PID_GUARD(); 129 130 ··· 191 192 int iter_manual_unroll_loop(const void *ctx) 192 193 { 193 194 struct bpf_iter_num it; 194 - int *v, i; 195 + int *v; 195 196 196 197 MY_PID_GUARD(); 197 198 ··· 620 621 int iter_stack_array_loop(const void *ctx) 621 622 { 622 623 long arr1[16], arr2[16], sum = 0; 623 - int *v, i; 624 + int i; 624 625 625 626 MY_PID_GUARD(); 626 627
+3
tools/testing/selftests/bpf/progs/linked_funcs1.c
··· 5 5 #include <bpf/bpf_helpers.h> 6 6 #include <bpf/bpf_tracing.h> 7 7 #include <bpf/bpf_core_read.h> 8 + #include "bpf_misc.h" 8 9 9 10 /* weak and shared between two files */ 10 11 const volatile int my_tid __weak; ··· 52 51 * cause problems for BPF static linker 53 52 */ 54 53 whatever = bpf_core_type_size(struct task_struct); 54 + __sink(whatever); 55 55 56 56 output_weak1 = x; 57 57 return x; ··· 73 71 74 72 /* make sure we have CO-RE relocations in main program */ 75 73 whatever = bpf_core_type_size(struct task_struct); 74 + __sink(whatever); 76 75 77 76 set_output_val2(1000); 78 77 set_output_ctx2(ctx); /* ctx definition is hidden in BPF_PROG macro */
+3
tools/testing/selftests/bpf/progs/linked_funcs2.c
··· 5 5 #include <bpf/bpf_helpers.h> 6 6 #include <bpf/bpf_tracing.h> 7 7 #include <bpf/bpf_core_read.h> 8 + #include "bpf_misc.h" 8 9 9 10 /* weak and shared between both files */ 10 11 const volatile int my_tid __weak; ··· 52 51 * cause problems for BPF static linker 53 52 */ 54 53 whatever = 2 * bpf_core_type_size(struct task_struct); 54 + __sink(whatever); 55 55 56 56 output_weak2 = x; 57 57 return 2 * x; ··· 73 71 74 72 /* make sure we have CO-RE relocations in main program */ 75 73 whatever = bpf_core_type_size(struct task_struct); 74 + __sink(whatever); 76 75 77 76 set_output_val1(2000); 78 77 set_output_ctx1(ctx); /* ctx definition is hidden in BPF_PROG macro */
-4
tools/testing/selftests/bpf/progs/linked_list.c
··· 313 313 int map_list_push_pop_multiple(void *ctx) 314 314 { 315 315 struct map_value *v; 316 - int ret; 317 316 318 317 v = bpf_map_lookup_elem(&array_map, &(int){0}); 319 318 if (!v) ··· 325 326 { 326 327 struct map_value *v; 327 328 void *map; 328 - int ret; 329 329 330 330 map = bpf_map_lookup_elem(&map_of_maps, &(int){0}); 331 331 if (!map) ··· 350 352 int map_list_in_list(void *ctx) 351 353 { 352 354 struct map_value *v; 353 - int ret; 354 355 355 356 v = bpf_map_lookup_elem(&array_map, &(int){0}); 356 357 if (!v) ··· 362 365 { 363 366 struct map_value *v; 364 367 void *map; 365 - int ret; 366 368 367 369 map = bpf_map_lookup_elem(&map_of_maps, &(int){0}); 368 370 if (!map)
-1
tools/testing/selftests/bpf/progs/linked_list_fail.c
··· 557 557 int incorrect_head_off2(void *ctx) 558 558 { 559 559 struct foo *f; 560 - struct bar *b; 561 560 562 561 f = bpf_obj_new(typeof(*f)); 563 562 if (!f)
-1
tools/testing/selftests/bpf/progs/local_storage.c
··· 77 77 struct inode *new_dir, struct dentry *new_dentry, 78 78 unsigned int flags) 79 79 { 80 - __u32 pid = bpf_get_current_pid_tgid() >> 32; 81 80 struct local_storage *storage; 82 81 int err; 83 82
-3
tools/testing/selftests/bpf/progs/map_kptr.c
··· 515 515 { 516 516 struct task_struct *current; 517 517 struct map_value *v; 518 - int ret; 519 518 520 519 current = bpf_get_current_task_btf(); 521 520 if (!current) ··· 533 534 { 534 535 struct task_struct *current; 535 536 struct map_value *v; 536 - int ret; 537 537 538 538 current = bpf_get_current_task_btf(); 539 539 if (!current) ··· 548 550 { 549 551 struct task_struct *current; 550 552 struct map_value *v; 551 - int ret; 552 553 553 554 current = bpf_get_current_task_btf(); 554 555 if (!current)
-1
tools/testing/selftests/bpf/progs/netcnt_prog.c
··· 26 26 int bpf_nextcnt(struct __sk_buff *skb) 27 27 { 28 28 union percpu_net_cnt *percpu_cnt; 29 - char fmt[] = "%d %llu %llu\n"; 30 29 union net_cnt *cnt; 31 30 __u64 ts, dt; 32 31 int ret;
-1
tools/testing/selftests/bpf/progs/netif_receive_skb.c
··· 53 53 do { \ 54 54 static const char _expectedval[EXPECTED_STRSIZE] = \ 55 55 _expected; \ 56 - static const char _ptrtype[64] = #_type; \ 57 56 __u64 _hflags = _flags | BTF_F_COMPACT; \ 58 57 static _type _ptrdata = __VA_ARGS__; \ 59 58 static struct btf_ptr _ptr = { }; \
-1
tools/testing/selftests/bpf/progs/perfbuf_bench.c
··· 22 22 SEC("fentry/" SYS_PREFIX "sys_getpgid") 23 23 int bench_perfbuf(void *ctx) 24 24 { 25 - __u64 *sample; 26 25 int i; 27 26 28 27 for (i = 0; i < batch_cnt; i++) {
+1 -1
tools/testing/selftests/bpf/progs/pyperf.h
··· 345 345 SEC("raw_tracepoint/kfree_skb") 346 346 int on_event(struct bpf_raw_tracepoint_args* ctx) 347 347 { 348 - int i, ret = 0; 348 + int ret = 0; 349 349 ret |= __on_event(ctx); 350 350 ret |= __on_event(ctx); 351 351 ret |= __on_event(ctx);
-11
tools/testing/selftests/bpf/progs/rbtree_btf_fail__wrong_node_type.c
··· 16 16 struct bpf_list_node node; 17 17 }; 18 18 19 - static bool less(struct bpf_rb_node *a, const struct bpf_rb_node *b) 20 - { 21 - struct node_data *node_a; 22 - struct node_data *node_b; 23 - 24 - node_a = container_of(a, struct node_data, node); 25 - node_b = container_of(b, struct node_data, node); 26 - 27 - return node_a->key < node_b->key; 28 - } 29 - 30 19 #define private(name) SEC(".data." #name) __hidden __attribute__((aligned(8))) 31 20 private(A) struct bpf_spin_lock glock; 32 21 private(A) struct bpf_rb_root groot __contains(node_data, node);
+2 -1
tools/testing/selftests/bpf/progs/rbtree_fail.c
··· 105 105 } 106 106 107 107 SEC("?tc") 108 - __failure __msg("Unreleased reference id=2 alloc_insn=11") 108 + __failure __msg("Unreleased reference id=2 alloc_insn=10") 109 109 long rbtree_api_remove_no_drop(void *ctx) 110 110 { 111 111 struct bpf_rb_node *res; ··· 119 119 res = bpf_rbtree_remove(&groot, res); 120 120 121 121 n = container_of(res, struct node_data, node); 122 + __sink(n); 122 123 bpf_spin_unlock(&glock); 123 124 124 125 /* bpf_obj_drop(n) is missing here */
-4
tools/testing/selftests/bpf/progs/rcu_read_lock.c
··· 179 179 int miss_lock(void *ctx) 180 180 { 181 181 struct task_struct *task; 182 - struct css_set *cgroups; 183 - struct cgroup *dfl_cgrp; 184 182 185 183 /* missing bpf_rcu_read_lock() */ 186 184 task = bpf_get_current_task_btf(); ··· 193 195 int miss_unlock(void *ctx) 194 196 { 195 197 struct task_struct *task; 196 - struct css_set *cgroups; 197 - struct cgroup *dfl_cgrp; 198 198 199 199 /* missing bpf_rcu_read_unlock() */ 200 200 task = bpf_get_current_task_btf();
-1
tools/testing/selftests/bpf/progs/read_bpf_task_storage_busy.c
··· 23 23 int BPF_PROG(read_bpf_task_storage_busy) 24 24 { 25 25 int *value; 26 - int key; 27 26 28 27 if (!CONFIG_PREEMPT) 29 28 return 0;
-2
tools/testing/selftests/bpf/progs/recvmsg4_prog.c
··· 17 17 int recvmsg4_prog(struct bpf_sock_addr *ctx) 18 18 { 19 19 struct bpf_sock *sk; 20 - __u32 user_ip4; 21 - __u16 user_port; 22 20 23 21 sk = ctx->sk; 24 22 if (!sk)
-2
tools/testing/selftests/bpf/progs/recvmsg6_prog.c
··· 20 20 int recvmsg6_prog(struct bpf_sock_addr *ctx) 21 21 { 22 22 struct bpf_sock *sk; 23 - __u32 user_ip4; 24 - __u16 user_port; 25 23 26 24 sk = ctx->sk; 27 25 if (!sk)
-2
tools/testing/selftests/bpf/progs/sendmsg4_prog.c
··· 21 21 SEC("cgroup/sendmsg4") 22 22 int sendmsg_v4_prog(struct bpf_sock_addr *ctx) 23 23 { 24 - int prio; 25 - 26 24 if (ctx->type != SOCK_DGRAM) 27 25 return 0; 28 26
+4
tools/testing/selftests/bpf/progs/sockmap_verdict_prog.c
··· 1 1 #include <linux/bpf.h> 2 2 #include <bpf/bpf_helpers.h> 3 3 #include <bpf/bpf_endian.h> 4 + #include "bpf_misc.h" 4 5 5 6 struct { 6 7 __uint(type, BPF_MAP_TYPE_SOCKMAP); ··· 40 39 __u32 rport = skb->remote_port; 41 40 __u8 *d = data; 42 41 __u8 sk, map; 42 + 43 + __sink(lport); 44 + __sink(rport); 43 45 44 46 if (data + 8 > data_end) 45 47 return SK_DROP;
-1
tools/testing/selftests/bpf/progs/strobemeta.h
··· 391 391 struct strobe_map_raw map; 392 392 void *location; 393 393 uint64_t len; 394 - int i; 395 394 396 395 descr->tag_len = 0; /* presume no tag is set */ 397 396 descr->cnt = -1; /* presume no value is set */
+11
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf3.c
··· 2 2 #include <linux/bpf.h> 3 3 #include <bpf/bpf_helpers.h> 4 4 #include "bpf_legacy.h" 5 + #include "bpf_misc.h" 5 6 6 7 struct { 7 8 __uint(type, BPF_MAP_TYPE_PROG_ARRAY); ··· 21 20 else 22 21 bpf_tail_call_static(skb, &jmp_table, 1); 23 22 23 + __sink(arr[sizeof(arr) - 1]); 24 + 24 25 return skb->len; 25 26 } 26 27 ··· 33 30 34 31 bpf_tail_call_static(skb, &jmp_table, 0); 35 32 33 + __sink(arr[sizeof(arr) - 1]); 34 + 36 35 return skb->len * 2; 37 36 } 38 37 ··· 42 37 int classifier_0(struct __sk_buff *skb) 43 38 { 44 39 volatile char arr[128] = {}; 40 + 41 + __sink(arr[sizeof(arr) - 1]); 45 42 46 43 return subprog_tail2(skb); 47 44 } ··· 53 46 { 54 47 volatile char arr[128] = {}; 55 48 49 + __sink(arr[sizeof(arr) - 1]); 50 + 56 51 return skb->len * 3; 57 52 } 58 53 ··· 62 53 int entry(struct __sk_buff *skb) 63 54 { 64 55 volatile char arr[128] = {}; 56 + 57 + __sink(arr[sizeof(arr) - 1]); 65 58 66 59 return subprog_tail(skb); 67 60 }
+3
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/bpf.h> 3 3 #include <bpf/bpf_helpers.h> 4 + #include "bpf_misc.h" 4 5 5 6 #define __unused __attribute__((unused)) 6 7 ··· 36 35 { 37 36 /* Have data on stack which size is not a multiple of 8 */ 38 37 volatile char arr[1] = {}; 38 + 39 + __sink(arr[0]); 39 40 40 41 return subprog_tail(skb); 41 42 }
+1
tools/testing/selftests/bpf/progs/task_kfunc_failure.c
··· 109 109 acquired = bpf_task_acquire(task); 110 110 111 111 /* Acquired task is never released. */ 112 + __sink(acquired); 112 113 113 114 return 0; 114 115 }
-6
tools/testing/selftests/bpf/progs/task_kfunc_success.c
··· 171 171 SEC("tp_btf/task_newtask") 172 172 int BPF_PROG(test_task_from_pid_arg, struct task_struct *task, u64 clone_flags) 173 173 { 174 - struct task_struct *acquired; 175 - 176 174 if (!is_test_kfunc_task()) 177 175 return 0; 178 176 ··· 181 183 SEC("tp_btf/task_newtask") 182 184 int BPF_PROG(test_task_from_pid_current, struct task_struct *task, u64 clone_flags) 183 185 { 184 - struct task_struct *current, *acquired; 185 - 186 186 if (!is_test_kfunc_task()) 187 187 return 0; 188 188 ··· 204 208 SEC("tp_btf/task_newtask") 205 209 int BPF_PROG(test_task_from_pid_invalid, struct task_struct *task, u64 clone_flags) 206 210 { 207 - struct task_struct *acquired; 208 - 209 211 if (!is_test_kfunc_task()) 210 212 return 0; 211 213
-1
tools/testing/selftests/bpf/progs/test_bpf_nf.c
··· 75 75 struct bpf_ct_opts___local opts_def = { .l4proto = IPPROTO_TCP, .netns_id = -1 }; 76 76 struct bpf_sock_tuple bpf_tuple; 77 77 struct nf_conn *ct; 78 - int err; 79 78 80 79 __builtin_memset(&bpf_tuple, 0, sizeof(bpf_tuple.ipv4)); 81 80
-1
tools/testing/selftests/bpf/progs/test_cls_redirect_dynptr.c
··· 455 455 456 456 static ret_t skip_next_hops(__u64 *offset, int n) 457 457 { 458 - __u32 res; 459 458 switch (n) { 460 459 case 1: 461 460 *offset += sizeof(struct in_addr);
-1
tools/testing/selftests/bpf/progs/test_core_reloc_bitfields_probed.c
··· 42 42 { 43 43 struct core_reloc_bitfields *in = (void *)&data.in; 44 44 struct core_reloc_bitfields_output *out = (void *)&data.out; 45 - uint64_t res; 46 45 47 46 out->ub1 = BPF_CORE_READ_BITFIELD_PROBED(in, ub1); 48 47 out->ub2 = BPF_CORE_READ_BITFIELD_PROBED(in, ub2);
+4
tools/testing/selftests/bpf/progs/test_global_func1.c
··· 18 18 { 19 19 volatile char buf[MAX_STACK] = {}; 20 20 21 + __sink(buf[MAX_STACK - 1]); 22 + 21 23 return f0(0, skb) + skb->len; 22 24 } 23 25 ··· 35 33 int f3(int val, struct __sk_buff *skb, int var) 36 34 { 37 35 volatile char buf[MAX_STACK] = {}; 36 + 37 + __sink(buf[MAX_STACK - 1]); 38 38 39 39 return skb->ifindex * val * var; 40 40 }
+4
tools/testing/selftests/bpf/progs/test_global_func2.c
··· 18 18 { 19 19 volatile char buf[MAX_STACK] = {}; 20 20 21 + __sink(buf[MAX_STACK - 1]); 22 + 21 23 return f0(0, skb) + skb->len; 22 24 } 23 25 ··· 35 33 int f3(int val, struct __sk_buff *skb, int var) 36 34 { 37 35 volatile char buf[MAX_STACK] = {}; 36 + 37 + __sink(buf[MAX_STACK - 1]); 38 38 39 39 return skb->ifindex * val * var; 40 40 }
+1 -1
tools/testing/selftests/bpf/progs/test_hash_large_key.c
··· 28 28 SEC("raw_tracepoint/sys_enter") 29 29 int bpf_hash_large_key_test(void *ctx) 30 30 { 31 - int zero = 0, err = 1, value = 42; 31 + int zero = 0, value = 42; 32 32 struct bigelement *key; 33 33 34 34 key = bpf_map_lookup_elem(&key_map, &zero);
-1
tools/testing/selftests/bpf/progs/test_ksyms_btf_write_check.c
··· 35 35 int handler2(const void *ctx) 36 36 { 37 37 int *active; 38 - __u32 cpu; 39 38 40 39 active = bpf_this_cpu_ptr(&bpf_prog_active); 41 40 write_active(active);
+1 -1
tools/testing/selftests/bpf/progs/test_legacy_printk.c
··· 56 56 SEC("tp/raw_syscalls/sys_enter") 57 57 int handle_modern(void *ctx) 58 58 { 59 - int zero = 0, cur_pid; 59 + int cur_pid; 60 60 61 61 cur_pid = bpf_get_current_pid_tgid() >> 32; 62 62 if (cur_pid != my_pid_var)
+1 -1
tools/testing/selftests/bpf/progs/test_map_lock.c
··· 33 33 SEC("cgroup/skb") 34 34 int bpf_map_lock_test(struct __sk_buff *skb) 35 35 { 36 - struct hmap_elem zero = {}, *val; 36 + struct hmap_elem *val; 37 37 int rnd = bpf_get_prandom_u32(); 38 38 int key = 0, err = 1, i; 39 39 struct array_elem *q;
+2
tools/testing/selftests/bpf/progs/test_obj_id.c
··· 4 4 #include <stddef.h> 5 5 #include <linux/bpf.h> 6 6 #include <bpf/bpf_helpers.h> 7 + #include "bpf_misc.h" 7 8 8 9 struct { 9 10 __uint(type, BPF_MAP_TYPE_ARRAY); ··· 20 19 __u64 *value; 21 20 22 21 value = bpf_map_lookup_elem(&test_map_id, &key); 22 + __sink(value); 23 23 24 24 return 0; 25 25 }
-1
tools/testing/selftests/bpf/progs/test_parse_tcp_hdr_opt.c
··· 87 87 __u8 tcp_hdr_opt_len = 0; 88 88 struct tcphdr *tcp_hdr; 89 89 __u64 tcp_offset = 0; 90 - __u32 off; 91 90 int err; 92 91 93 92 tcp_offset = sizeof(struct ethhdr) + sizeof(struct ipv6hdr);
+1 -1
tools/testing/selftests/bpf/progs/test_parse_tcp_hdr_opt_dynptr.c
··· 30 30 static int parse_hdr_opt(struct bpf_dynptr *ptr, __u32 *off, __u8 *hdr_bytes_remaining, 31 31 __u32 *server_id) 32 32 { 33 - __u8 *tcp_opt, kind, hdr_len; 33 + __u8 kind, hdr_len; 34 34 __u8 buffer[sizeof(kind) + sizeof(hdr_len) + sizeof(*server_id)]; 35 35 __u8 *data; 36 36
+5
tools/testing/selftests/bpf/progs/test_pkt_access.c
··· 13 13 #include <linux/pkt_cls.h> 14 14 #include <bpf/bpf_helpers.h> 15 15 #include <bpf/bpf_endian.h> 16 + #include "bpf_misc.h" 16 17 17 18 /* llvm will optimize both subprograms into exactly the same BPF assembly 18 19 * ··· 52 51 { 53 52 volatile char buf[MAX_STACK] = {}; 54 53 54 + __sink(buf[MAX_STACK - 1]); 55 + 55 56 return skb->len; 56 57 } 57 58 ··· 75 72 int get_skb_ifindex(int val, struct __sk_buff *skb, int var) 76 73 { 77 74 volatile char buf[MAX_STACK] = {}; 75 + 76 + __sink(buf[MAX_STACK - 1]); 78 77 79 78 return skb->ifindex * val * var; 80 79 }
-1
tools/testing/selftests/bpf/progs/test_ringbuf.c
··· 41 41 { 42 42 int cur_pid = bpf_get_current_pid_tgid() >> 32; 43 43 struct sample *sample; 44 - int zero = 0; 45 44 46 45 if (cur_pid != pid) 47 46 return 0;
+1
tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c
··· 53 53 /* test using 'sample' (PTR_TO_MEM | MEM_ALLOC) as map key arg 54 54 */ 55 55 lookup_val = (int *)bpf_map_lookup_elem(&hash_map, sample); 56 + __sink(lookup_val); 56 57 57 58 /* workaround - memcpy is necessary so that verifier doesn't 58 59 * complain with:
-1
tools/testing/selftests/bpf/progs/test_ringbuf_multi.c
··· 59 59 int cur_pid = bpf_get_current_pid_tgid() >> 32; 60 60 struct sample *sample; 61 61 void *rb; 62 - int zero = 0; 63 62 64 63 if (cur_pid != pid) 65 64 return 0;
+1 -1
tools/testing/selftests/bpf/progs/test_select_reuseport_kern.c
··· 64 64 int _select_by_skb_data(struct sk_reuseport_md *reuse_md) 65 65 { 66 66 __u32 linum, index = 0, flags = 0, index_zero = 0; 67 - __u32 *result_cnt, *linum_value; 67 + __u32 *result_cnt; 68 68 struct data_check data_check = {}; 69 69 struct cmd *cmd, cmd_copy; 70 70 void *data, *data_end;
+2 -2
tools/testing/selftests/bpf/progs/test_sk_assign.c
··· 15 15 #include <sys/socket.h> 16 16 #include <bpf/bpf_helpers.h> 17 17 #include <bpf/bpf_endian.h> 18 + #include "bpf_misc.h" 18 19 19 20 #if defined(IPROUTE2_HAVE_LIBBPF) 20 21 /* Use a new-style map definition. */ ··· 58 57 void *data = (void *)(long)skb->data; 59 58 struct bpf_sock_tuple *result; 60 59 struct ethhdr *eth; 61 - __u64 tuple_len; 62 60 __u8 proto = 0; 63 61 __u64 ihl_len; 64 62 ··· 94 94 return NULL; 95 95 96 96 *tcp = (proto == IPPROTO_TCP); 97 + __sink(ihl_len); 97 98 return result; 98 99 } 99 100 ··· 174 173 struct bpf_sock_tuple *tuple; 175 174 bool ipv4 = false; 176 175 bool tcp = false; 177 - int tuple_len; 178 176 int ret = 0; 179 177 180 178 tuple = get_tuple(skb, &ipv4, &tcp);
+2 -7
tools/testing/selftests/bpf/progs/test_sk_lookup.c
··· 391 391 int ctx_narrow_access(struct bpf_sk_lookup *ctx) 392 392 { 393 393 struct bpf_sock *sk; 394 - int err, family; 395 394 __u32 val_u32; 396 395 bool v4; 397 396 ··· 644 645 SEC("sk_lookup") 645 646 int multi_prog_redir1(struct bpf_sk_lookup *ctx) 646 647 { 647 - int ret; 648 - 649 - ret = select_server_a(ctx); 648 + (void)select_server_a(ctx); 650 649 bpf_map_update_elem(&run_map, &KEY_PROG1, &PROG_DONE, BPF_ANY); 651 650 return SK_PASS; 652 651 } ··· 652 655 SEC("sk_lookup") 653 656 int multi_prog_redir2(struct bpf_sk_lookup *ctx) 654 657 { 655 - int ret; 656 - 657 - ret = select_server_a(ctx); 658 + (void)select_server_a(ctx); 658 659 bpf_map_update_elem(&run_map, &KEY_PROG2, &PROG_DONE, BPF_ANY); 659 660 return SK_PASS; 660 661 }
-2
tools/testing/selftests/bpf/progs/test_sk_lookup_kern.c
··· 110 110 { 111 111 struct bpf_sock_tuple tuple = {}; 112 112 struct bpf_sock *sk; 113 - __u32 family; 114 113 115 114 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); 116 115 if (sk) { ··· 124 125 { 125 126 struct bpf_sock_tuple tuple = {}; 126 127 struct bpf_sock *sk; 127 - __u32 family; 128 128 129 129 sk = bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); 130 130 sk += 1;
+1 -1
tools/testing/selftests/bpf/progs/test_sock_fields.c
··· 121 121 SEC("cgroup_skb/egress") 122 122 int egress_read_sock_fields(struct __sk_buff *skb) 123 123 { 124 - struct bpf_spinlock_cnt cli_cnt_init = { .lock = 0, .cnt = 0xeB9F }; 124 + struct bpf_spinlock_cnt cli_cnt_init = { .lock = {}, .cnt = 0xeB9F }; 125 125 struct bpf_spinlock_cnt *pkt_out_cnt, *pkt_out_cnt10; 126 126 struct bpf_tcp_sock *tp, *tp_ret; 127 127 struct bpf_sock *sk, *sk_ret;
+11 -3
tools/testing/selftests/bpf/progs/test_sockmap_kern.h
··· 14 14 #include <sys/socket.h> 15 15 #include <bpf/bpf_helpers.h> 16 16 #include <bpf/bpf_endian.h> 17 + #include "bpf_misc.h" 17 18 18 19 /* Sockmap sample program connects a client and a backend together 19 20 * using cgroups. ··· 112 111 int len, *f, ret, zero = 0; 113 112 __u64 flags = 0; 114 113 114 + __sink(rport); 115 115 if (lport == 10000) 116 116 ret = 10; 117 117 else 118 118 ret = 1; 119 119 120 120 len = (__u32)skb->data_end - (__u32)skb->data; 121 + __sink(len); 122 + 121 123 f = bpf_map_lookup_elem(&sock_skb_opts, &zero); 122 124 if (f && *f) { 123 125 ret = 3; ··· 184 180 if (err) 185 181 return SK_DROP; 186 182 bpf_write_pass(skb, 13); 187 - tls_out: 188 183 return ret; 189 184 } 190 185 ··· 191 188 int bpf_sockmap(struct bpf_sock_ops *skops) 192 189 { 193 190 __u32 lport, rport; 194 - int op, err = 0, index, key, ret; 195 - 191 + int op, err, ret; 196 192 197 193 op = (int) skops->op; 198 194 ··· 229 227 default: 230 228 break; 231 229 } 230 + 231 + __sink(err); 232 232 233 233 return 0; 234 234 } ··· 325 321 } else { 326 322 return SK_DROP; 327 323 } 324 + 325 + __sink(data_end); 326 + __sink(data); 327 + 328 328 return SK_PASS; 329 329 } 330 330 SEC("sk_msg4")
+3
tools/testing/selftests/bpf/progs/test_spin_lock.c
··· 3 3 #include <linux/bpf.h> 4 4 #include <linux/version.h> 5 5 #include <bpf/bpf_helpers.h> 6 + #include "bpf_misc.h" 6 7 7 8 struct hmap_elem { 8 9 volatile int cnt; ··· 89 88 q->credit -= pkt_len; 90 89 credit = q->credit; 91 90 bpf_spin_unlock(&q->lock); 91 + 92 + __sink(credit); 92 93 93 94 /* spin_lock in cgroup local storage */ 94 95 cls = bpf_get_local_storage(&cls_map, 0);
+2 -2
tools/testing/selftests/bpf/progs/test_tc_dtime.c
··· 163 163 ip6h = data + sizeof(struct ethhdr); 164 164 if (ip6h + 1 > data_end) 165 165 return -1; 166 - if (v6_equal(ip6h->saddr, (struct in6_addr)ip6_src)) 166 + if (v6_equal(ip6h->saddr, (struct in6_addr){{ip6_src}})) 167 167 ns = SRC_NS; 168 - else if (v6_equal(ip6h->saddr, (struct in6_addr)ip6_dst)) 168 + else if (v6_equal(ip6h->saddr, (struct in6_addr){{ip6_dst}})) 169 169 ns = DST_NS; 170 170 inet_proto = ip6h->nexthdr; 171 171 trans = ip6h + 1;
+2 -2
tools/testing/selftests/bpf/progs/test_tc_neigh.c
··· 94 94 redirect = is_remote_ep_v4(skb, __bpf_constant_htonl(ip4_src)); 95 95 break; 96 96 case __bpf_constant_htons(ETH_P_IPV6): 97 - redirect = is_remote_ep_v6(skb, (struct in6_addr)ip6_src); 97 + redirect = is_remote_ep_v6(skb, (struct in6_addr){{ip6_src}}); 98 98 break; 99 99 } 100 100 ··· 119 119 redirect = is_remote_ep_v4(skb, __bpf_constant_htonl(ip4_dst)); 120 120 break; 121 121 case __bpf_constant_htons(ETH_P_IPV6): 122 - redirect = is_remote_ep_v6(skb, (struct in6_addr)ip6_dst); 122 + redirect = is_remote_ep_v6(skb, (struct in6_addr){{ip6_dst}}); 123 123 break; 124 124 } 125 125
-2
tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c
··· 46 46 struct bpf_sock_ops *reuse = skops; 47 47 struct tcphdr *thdr; 48 48 int window_clamp = 9216; 49 - int good_call_rv = 0; 50 - int bad_call_rv = 0; 51 49 int save_syn = 1; 52 50 int rv = -1; 53 51 int v = 0;
-6
tools/testing/selftests/bpf/progs/test_tunnel_kern.c
··· 209 209 { 210 210 struct bpf_tunnel_key key; 211 211 struct erspan_metadata md; 212 - __u32 index; 213 212 int ret; 214 213 215 214 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 0); ··· 288 289 { 289 290 struct bpf_tunnel_key key; 290 291 struct erspan_metadata md; 291 - __u32 index; 292 292 int ret; 293 293 294 294 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), ··· 403 405 int ret; 404 406 struct bpf_tunnel_key key; 405 407 struct vxlan_metadata md; 406 - __u32 orig_daddr; 407 - __u32 index = 0; 408 408 409 409 ret = bpf_skb_get_tunnel_key(skb, &key, sizeof(key), 410 410 BPF_F_TUNINFO_FLAGS); ··· 439 443 void *data_end = (void *)(long)skb->data_end; 440 444 struct udphdr *udph; 441 445 struct iphdr *iph; 442 - __u32 index = 0; 443 446 int ret = 0; 444 - int shrink; 445 447 __s64 csum; 446 448 447 449 if ((void *)eth + sizeof(*eth) > data_end) {
-2
tools/testing/selftests/bpf/progs/test_usdt_multispec.c
··· 18 18 SEC("usdt//proc/self/exe:test:usdt_100") 19 19 int BPF_USDT(usdt_100, int x) 20 20 { 21 - long tmp; 22 - 23 21 if (my_pid != (bpf_get_current_pid_tgid() >> 32)) 24 22 return 0; 25 23
+1 -1
tools/testing/selftests/bpf/progs/test_verif_scale1.c
··· 11 11 void *data_end = (void *)(long)ctx->data_end; 12 12 void *data = (void *)(long)ctx->data; 13 13 void *ptr; 14 - int ret = 0, nh_off, i = 0; 14 + int nh_off, i = 0; 15 15 16 16 nh_off = 14; 17 17
+1 -1
tools/testing/selftests/bpf/progs/test_verif_scale2.c
··· 11 11 void *data_end = (void *)(long)ctx->data_end; 12 12 void *data = (void *)(long)ctx->data; 13 13 void *ptr; 14 - int ret = 0, nh_off, i = 0; 14 + int nh_off, i = 0; 15 15 16 16 nh_off = 14; 17 17
+1 -1
tools/testing/selftests/bpf/progs/test_verif_scale3.c
··· 11 11 void *data_end = (void *)(long)ctx->data_end; 12 12 void *data = (void *)(long)ctx->data; 13 13 void *ptr; 14 - int ret = 0, nh_off, i = 0; 14 + int nh_off, i = 0; 15 15 16 16 nh_off = 32; 17 17
-2
tools/testing/selftests/bpf/progs/test_xdp_adjust_tail_grow.c
··· 5 5 SEC("xdp") 6 6 int _xdp_adjust_tail_grow(struct xdp_md *xdp) 7 7 { 8 - void *data_end = (void *)(long)xdp->data_end; 9 - void *data = (void *)(long)xdp->data; 10 8 int data_len = bpf_xdp_get_buff_len(xdp); 11 9 int offset = 0; 12 10 /* SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) */
-2
tools/testing/selftests/bpf/progs/test_xdp_bpf2bpf.c
··· 45 45 int BPF_PROG(trace_on_entry, struct xdp_buff *xdp) 46 46 { 47 47 struct meta meta; 48 - void *data_end = (void *)(long)xdp->data_end; 49 - void *data = (void *)(long)xdp->data; 50 48 51 49 meta.ifindex = xdp->rxq->dev->ifindex; 52 50 meta.pkt_len = bpf_xdp_get_buff_len((struct xdp_md *)xdp);
-2
tools/testing/selftests/bpf/progs/test_xdp_dynptr.c
··· 82 82 struct iptnl_info *tnl; 83 83 struct ethhdr *new_eth; 84 84 struct ethhdr *old_eth; 85 - __u32 transport_hdr_sz; 86 85 struct iphdr *iph; 87 86 __u16 *next_iph; 88 87 __u16 payload_len; ··· 164 165 struct iptnl_info *tnl; 165 166 struct ethhdr *new_eth; 166 167 struct ethhdr *old_eth; 167 - __u32 transport_hdr_sz; 168 168 struct ipv6hdr *ip6h; 169 169 __u16 payload_len; 170 170 struct vip vip = {};
-43
tools/testing/selftests/bpf/progs/test_xdp_noinline.c
··· 372 372 } 373 373 374 374 static __attribute__ ((noinline)) 375 - bool decap_v6(struct xdp_md *xdp, void **data, void **data_end, bool inner_v4) 376 - { 377 - struct eth_hdr *new_eth; 378 - struct eth_hdr *old_eth; 379 - 380 - old_eth = *data; 381 - new_eth = *data + sizeof(struct ipv6hdr); 382 - memcpy(new_eth->eth_source, old_eth->eth_source, 6); 383 - memcpy(new_eth->eth_dest, old_eth->eth_dest, 6); 384 - if (inner_v4) 385 - new_eth->eth_proto = 8; 386 - else 387 - new_eth->eth_proto = 56710; 388 - if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct ipv6hdr))) 389 - return false; 390 - *data = (void *)(long)xdp->data; 391 - *data_end = (void *)(long)xdp->data_end; 392 - return true; 393 - } 394 - 395 - static __attribute__ ((noinline)) 396 - bool decap_v4(struct xdp_md *xdp, void **data, void **data_end) 397 - { 398 - struct eth_hdr *new_eth; 399 - struct eth_hdr *old_eth; 400 - 401 - old_eth = *data; 402 - new_eth = *data + sizeof(struct iphdr); 403 - memcpy(new_eth->eth_source, old_eth->eth_source, 6); 404 - memcpy(new_eth->eth_dest, old_eth->eth_dest, 6); 405 - new_eth->eth_proto = 8; 406 - if (bpf_xdp_adjust_head(xdp, (int)sizeof(struct iphdr))) 407 - return false; 408 - *data = (void *)(long)xdp->data; 409 - *data_end = (void *)(long)xdp->data_end; 410 - return true; 411 - } 412 - 413 - static __attribute__ ((noinline)) 414 375 int swap_mac_and_send(void *data, void *data_end) 415 376 { 416 377 unsigned char tmp_mac[6]; ··· 391 430 __u16 *next_iph_u16; 392 431 __u32 tmp_addr = 0; 393 432 struct iphdr *iph; 394 - __u32 csum1 = 0; 395 433 __u32 csum = 0; 396 434 __u64 off = 0; 397 435 ··· 622 662 void *data_end) 623 663 { 624 664 struct iphdr *iph; 625 - __u64 iph_len; 626 665 int action; 627 666 628 667 iph = data + off; ··· 655 696 struct packet_description pckt = { }; 656 697 struct vip_definition vip = { }; 657 698 struct lb_stats *data_stats; 658 - struct eth_hdr *eth = data; 659 699 void *lru_map = &lru_cache; 660 700 struct vip_meta *vip_info; 661 701 __u32 lru_stats_key = 513; ··· 662 704 __u32 stats_key = 512; 663 705 struct ctl_value *cval; 664 706 __u16 pkt_bytes; 665 - __u64 iph_len; 666 707 __u8 protocol; 667 708 __u32 vip_num; 668 709 int action;
-13
tools/testing/selftests/bpf/progs/test_xdp_vlan.c
··· 210 210 } 211 211 212 212 static __always_inline 213 - void shift_mac_4bytes_16bit(void *data) 214 - { 215 - __u16 *p = data; 216 - 217 - p[7] = p[5]; /* delete p[7] was vlan_hdr->h_vlan_TCI */ 218 - p[6] = p[4]; /* delete p[6] was ethhdr->h_proto */ 219 - p[5] = p[3]; 220 - p[4] = p[2]; 221 - p[3] = p[1]; 222 - p[2] = p[0]; 223 - } 224 - 225 - static __always_inline 226 213 void shift_mac_4bytes_32bit(void *data) 227 214 { 228 215 __u32 *p = data;
-1
tools/testing/selftests/bpf/progs/type_cast.c
··· 63 63 int BPF_PROG(untrusted_ptr, struct pt_regs *regs, long id) 64 64 { 65 65 struct task_struct *task, *task_dup; 66 - long *ptr; 67 66 68 67 task = bpf_get_current_task_btf(); 69 68 task_dup = bpf_rdonly_cast(task, bpf_core_type_id_kernel(struct task_struct));
-2
tools/testing/selftests/bpf/progs/udp_limit.c
··· 17 17 int sock(struct bpf_sock *ctx) 18 18 { 19 19 int *sk_storage; 20 - __u32 key; 21 20 22 21 if (ctx->type != SOCK_DGRAM) 23 22 return 1; ··· 45 46 int sock_release(struct bpf_sock *ctx) 46 47 { 47 48 int *sk_storage; 48 - __u32 key; 49 49 50 50 if (ctx->type != SOCK_DGRAM) 51 51 return 1;
-6
tools/testing/selftests/bpf/progs/user_ringbuf_success.c
··· 162 162 int test_user_ringbuf_protocol(void *ctx) 163 163 { 164 164 long status = 0; 165 - struct sample *sample = NULL; 166 - struct bpf_dynptr ptr; 167 165 168 166 if (!is_test_process()) 169 167 return 0; ··· 181 183 SEC("fentry/" SYS_PREFIX "sys_getpgid") 182 184 int test_user_ringbuf(void *ctx) 183 185 { 184 - int status = 0; 185 - struct sample *sample = NULL; 186 - struct bpf_dynptr ptr; 187 - 188 186 if (!is_test_process()) 189 187 return 0; 190 188
-1
tools/testing/selftests/bpf/progs/xdp_features.c
··· 70 70 struct tlv_hdr *tlv; 71 71 struct udphdr *uh; 72 72 __be16 port; 73 - __u8 *cmd; 74 73 75 74 if (eh + 1 > (struct ethhdr *)data_end) 76 75 return -EINVAL;
-2
tools/testing/selftests/bpf/progs/xdping_kern.c
··· 89 89 SEC("xdp") 90 90 int xdping_client(struct xdp_md *ctx) 91 91 { 92 - void *data_end = (void *)(long)ctx->data_end; 93 92 void *data = (void *)(long)ctx->data; 94 93 struct pinginfo *pinginfo = NULL; 95 94 struct ethhdr *eth = data; ··· 152 153 SEC("xdp") 153 154 int xdping_server(struct xdp_md *ctx) 154 155 { 155 - void *data_end = (void *)(long)ctx->data_end; 156 156 void *data = (void *)(long)ctx->data; 157 157 struct ethhdr *eth = data; 158 158 struct icmphdr *icmph;
-1
tools/testing/selftests/bpf/progs/xdpwall.c
··· 321 321 void *data = (void *)(long)(ctx->data); 322 322 struct fw_match_info match_info = {}; 323 323 struct pkt_info info = {}; 324 - __u8 parse_err = NO_ERR; 325 324 void *transport_hdr; 326 325 struct ethhdr *eth; 327 326 bool filter_res;