]> Git Repo - linux.git/blob - tools/testing/selftests/bpf/progs/test_global_func8.c
Linux 6.14-rc3
[linux.git] / tools / testing / selftests / bpf / progs / test_global_func8.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (c) 2020 Facebook */
3 #include <stddef.h>
4 #include <linux/bpf.h>
5 #include <bpf/bpf_helpers.h>
6 #include "bpf_misc.h"
7
8 __noinline int foo(struct __sk_buff *skb)
9 {
10         return bpf_get_prandom_u32();
11 }
12
13 SEC("cgroup_skb/ingress")
14 __success
15 int global_func8(struct __sk_buff *skb)
16 {
17         if (!foo(skb))
18                 return 0;
19
20         return 1;
21 }
This page took 0.0315 seconds and 4 git commands to generate.