WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / fexit_bpf2bpf_simple.c
blob85c0b516d6ee62727d4b90c458ecdce0859577d5
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2019 Facebook */
3 #include <linux/bpf.h>
4 #include <bpf/bpf_helpers.h>
5 #include <bpf/bpf_tracing.h>
7 struct sk_buff {
8 unsigned int len;
9 };
11 __u64 test_result = 0;
13 SEC("fexit/test_pkt_md_access")
14 int BPF_PROG(test_main2, struct sk_buff *skb, int ret)
16 int len;
18 __builtin_preserve_access_index(({
19 len = skb->len;
20 }));
21 if (len != 74 || ret != 0)
22 return 0;
24 test_result = 1;
25 return 0;
27 char _license[] SEC("license") = "GPL";