On 1/17/24 10:56 PM, Amery Hung wrote:
tc_sch_fq.bpf.c A simple bpf fair queueing (fq) qdisc that gives each flow a euqal chance to transmit data. The qdisc respects the timestamp in a skb set by an clsact rate limiter. It can also inform the rate limiter about packet drop when enabled to adjust timestamps. The implementation does not prevent hash collision of flows nor does it recycle flows. tc_sch_fq.c A user space program to load and attach the eBPF-based fq qdisc, which by default add the bpf fq to the loopback device, but can also add to other dev and class with '-d' and '-p' options. To test the bpf fq qdisc with the EDT rate limiter: $ tc qdisc add dev lo clsact $ tc filter add dev lo egress bpf obj tc_clsact_edt.bpf.o sec classifier $ ./tc_sch_fq -s
Would be nice if you also include a performance comparison (did you do production tests with it?) with side-by-side to native fq and if you see a delta elaborate on what would be needed to address it.
Signed-off-by: Amery Hung <amery.hung@xxxxxxxxxxxxx> --- samples/bpf/Makefile | 8 +- samples/bpf/bpf_experimental.h | 134 +++++++ samples/bpf/tc_clsact_edt.bpf.c | 103 +++++ samples/bpf/tc_sch_fq.bpf.c | 666 ++++++++++++++++++++++++++++++++ samples/bpf/tc_sch_fq.c | 321 +++++++++++++++ 5 files changed, 1231 insertions(+), 1 deletion(-) create mode 100644 samples/bpf/bpf_experimental.h create mode 100644 samples/bpf/tc_clsact_edt.bpf.c create mode 100644 samples/bpf/tc_sch_fq.bpf.c create mode 100644 samples/bpf/tc_sch_fq.c