File Index
Files and directories
Sign in
FILE

bpf_qdisc_fail__incompl_ops.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/bpf_qdisc_fail__incompl_ops.c C
 1// SPDX-License-Identifier: GPL-2.0
 2
 3#include <vmlinux.h>
 4#include "bpf_experimental.h"
 5#include "bpf_qdisc_common.h"
 6
 7char _license[] SEC("license") = "GPL";
 8
 9SEC("struct_ops")
10int BPF_PROG(bpf_qdisc_test_enqueue, struct sk_buff *skb, struct Qdisc *sch,
11	     struct bpf_sk_buff_ptr *to_free)
12{
13	bpf_qdisc_skb_drop(skb, to_free);
14	return NET_XMIT_DROP;
15}
16
17SEC("struct_ops")
18struct sk_buff *BPF_PROG(bpf_qdisc_test_dequeue, struct Qdisc *sch)
19{
20	return NULL;
21}
22
23SEC("struct_ops")
24void BPF_PROG(bpf_qdisc_test_reset, struct Qdisc *sch)
25{
26}
27
28SEC("struct_ops")
29void BPF_PROG(bpf_qdisc_test_destroy, struct Qdisc *sch)
30{
31}
32
33SEC(".struct_ops")
34struct Qdisc_ops test = {
35	.enqueue   = (void *)bpf_qdisc_test_enqueue,
36	.dequeue   = (void *)bpf_qdisc_test_dequeue,
37	.reset     = (void *)bpf_qdisc_test_reset,
38	.destroy   = (void *)bpf_qdisc_test_destroy,
39	.id        = "bpf_qdisc_test",
40};
41
~/ Read-only file preview.