summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs
diff options
context:
space:
mode:
authorAmery Hung <ameryhung@gmail.com>2025-05-02 23:16:21 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2025-05-03 01:28:29 +0300
commit6d080362c3218b92b98a17eb4132e0e5a7ed30d4 (patch)
tree94762fbdd9a0a24dcba56ac86f3a9fe92ecffbd6 /tools/testing/selftests/bpf/progs
parent659b3b2c488532140676affef036a1702fde6e32 (diff)
downloadlinux-6d080362c3218b92b98a17eb4132e0e5a7ed30d4.tar.xz
selftests/bpf: Test setting and creating bpf qdisc as default qdisc
First, test that bpf qdisc can be set as default qdisc. Then, attach an mq qdisc to see if bpf qdisc can be successfully created and grafted. The test is a sequential test as net.core.default_qdisc is global. Signed-off-by: Amery Hung <ameryhung@gmail.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs')
-rw-r--r--tools/testing/selftests/bpf/progs/bpf_qdisc_fifo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_qdisc_fifo.c b/tools/testing/selftests/bpf/progs/bpf_qdisc_fifo.c
index 0c7cfb82dae1..571fa7233ec0 100644
--- a/tools/testing/selftests/bpf/progs/bpf_qdisc_fifo.c
+++ b/tools/testing/selftests/bpf/progs/bpf_qdisc_fifo.c
@@ -14,6 +14,8 @@ struct skb_node {
private(A) struct bpf_spin_lock q_fifo_lock;
private(A) struct bpf_list_head q_fifo __contains(skb_node, node);
+bool init_called;
+
SEC("struct_ops/bpf_fifo_enqueue")
int BPF_PROG(bpf_fifo_enqueue, struct sk_buff *skb, struct Qdisc *sch,
struct bpf_sk_buff_ptr *to_free)
@@ -77,6 +79,7 @@ int BPF_PROG(bpf_fifo_init, struct Qdisc *sch, struct nlattr *opt,
struct netlink_ext_ack *extack)
{
sch->limit = 1000;
+ init_called = true;
return 0;
}