cilium / ebpf

ebpf-go is a pure-Go library to read, modify and load eBPF programs and attach them to various hooks in the Linux kernel.
https://ebpf-go.dev
MIT License
6.3k stars 695 forks source link

link: Add tcx support #1117

Closed borkmann closed 11 months ago

borkmann commented 1 year ago

BPF link support for tcx got merged recently. Add full tcx support for cilium/ebpf, so that we can utilise it in Cilium.

For the library, it would be good to have both, the link and opts variants similar as libbpf supports it.

Depending on available cycles, I'll take a look at this.

### Tasks
- [x] Add kernel >= 6.6 to CI
- [x] Auto generate syscall definitions for generic multi attach
- [x] Add txc link type (probably following XDP example)
lmb commented 1 year ago

Nice! Once tcx support is in we can also look at a fall back for netlink.

lmb commented 1 year ago

Relevant commit is https://github.com/torvalds/linux/commit/e420bed025071a623d2720a92bc2245c84757ecb

borkmann commented 1 year ago

Relevant commit is torvalds/linux@e420bed

This one too for the bpf_mprog API / control directives: https://github.com/torvalds/linux/commit/053c8e1f235dc3f69d13375b32f4209228e1cb96

lmb commented 1 year ago

Current WIP is at https://github.com/lmb/ebpf/tree/link-tcx

lmb commented 11 months ago

Done in https://github.com/cilium/ebpf/commit/417f8a264d2e691649ede9b995fb334e6c58ca71