bpf: net_sched: Support implementation of Qdisc_ops in bpf
authorAmery Hung <amery.hung@bytedance.com>
Wed, 9 Apr 2025 21:45:58 +0000 (14:45 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 17 Apr 2025 17:54:33 +0000 (10:54 -0700)
commitc8240344956e3f0b4e8f1d40ec3435e47040cacb
treed76630692c8ce7246c107c85d425c33aa2188a88
parenta1b669ea16c4d7c1a1a8fc7e25aaf651ea0078c3
bpf: net_sched: Support implementation of Qdisc_ops in bpf

The recent advancement in bpf such as allocated objects, bpf list and bpf
rbtree has provided powerful and flexible building blocks to realize
sophisticated packet scheduling algorithms. As struct_ops now supports
core operators in Qdisc_ops, start allowing qdisc to be implemented using
bpf struct_ops with this patch. Users can implement Qdisc_ops.{enqueue,
dequeue, init, reset, destroy} in bpf and register the qdisc dynamically
into the kernel.

Co-developed-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Amery Hung <amery.hung@bytedance.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20250409214606.2000194-3-ameryhung@gmail.com
net/sched/Kconfig
net/sched/Makefile
net/sched/bpf_qdisc.c [new file with mode: 0644]
net/sched/sch_api.c
net/sched/sch_generic.c