Skip to content

How can ebpf programs be attached to TC classes/qdiscs? #769

Answered by ti-mo
vincentmli asked this question in Q&A
Discussion options

You must be logged in to vote

Long story short: use https://pkg.go.dev/github.com/florianl/go-tc#example-package-EBPF.

TC is a completely separate kernel subsystem from eBPF that can currently only be interacted with using netlink sockets and its corresponding protocol. As a comparison, on older versions of the Linux kernel, attaching XDP programs also required netlink. However, due to its simplicity (XDP associates a prog FD with an ifindex, which can be retrieved by name using the Go stdlib), XDP has since received a bpf_link interface, and cilium/ebpf was easily extended to support it.

TC, however, is significantly more complex in both its design and its implementation. Assuming the user sets up a class/qdisc hiera…

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vincentmli
Comment options

You must be logged in to vote
2 replies
@lmb
Comment options

@unikzforce
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #768 on August 26, 2022 08:53.