Skip to content

feat: add bpf_link_info & TC BPF filter attach info#196

Open
ver-nyan wants to merge 1 commit intoNetflix:mainfrom
ver-nyan:feat/bpf-link-info
Open

feat: add bpf_link_info & TC BPF filter attach info#196
ver-nyan wants to merge 1 commit intoNetflix:mainfrom
ver-nyan:feat/bpf-link-info

Conversation

@ver-nyan
Copy link
Copy Markdown
Contributor

@ver-nyan ver-nyan commented Jan 30, 2026

currently WIP, I'm currently working to get an API upstream for TC BPF filters in https://github.com/rust-netlink/netlink-packet-route

Add attach info in the "Program Information" window:

  • bpf_link_info up to libbpf-rs v0.24.4 which only includes:
    • raw_tracepoint
    • tracing
    • iter
    • net_ns
  • attach info for TC filter progs attached to clsact qdisc via netlink

@jfernandez
Copy link
Copy Markdown
Collaborator

@ver-nyan heya, any update on this? I'm going to cut 0.8.0 next week. If it needs more time, that's fine.

@ver-nyan
Copy link
Copy Markdown
Contributor Author

ver-nyan commented Mar 29, 2026

Srry for late update, i was waiting for a release on my TC bpf filter in netlink-packet-route and didn't realize 0.29.0 was out already (interestingly github only says 0.28.0 is still the latest for some reason).

But the implementation is basically finished, it's just a display design decision now.

just a quick update, this is what it currently looks like:

┌ Program Information ─────────
│
│   Program ID      109
│   Program Type    SchedCls
│   Program Name    tc_netlink_and_
│   PIDs            all (16141)
│   TC Filter
│     Interface     lo (1)
│     Direction     Ingress
│     Direct Action true
│   TC Filter
│     Interface     eth0 (2)             
│     Direction     Egress
│     Direct Action true
└──────────────────────
┌ Program Information ─────────────────
│
│   Program ID      140
│   Program Type    SkLookup
│   Program Name    sk_lookup_prog
│   PIDs            all (16313)
│   Link ID         44: NetNs
│     Attach Type   SkLookup
│     Inode         4026531840

but im changing the look again, which should be ready or at least previewable by tomorrow 👍

@ver-nyan
Copy link
Copy Markdown
Contributor Author

ver-nyan commented Mar 30, 2026

oh my god hyper-v just nuked all my work today...

edit: well most of the time spent was just design decisions and relearning and getting up to date with ratatui lol. i can still get it done by tomorrow

Add attach info in the "Program Information" window:
- bpf_link_info up to libbpf-rs v0.24.4 which only includes:
  - raw_tracepoint
  - tracing
  - iter (specific metadata not in the version yet)
  - net_ns
- TC filters attached to clsact qdiscs via netlink

The other link_info variants can be added once libbpf-rs is bumped.
Variants not key implemented will show up as type "Unknown".

Closes: Netflix#190
@ver-nyan ver-nyan force-pushed the feat/bpf-link-info branch from 22280c3 to 1647c6a Compare March 30, 2026 21:24
@ver-nyan ver-nyan marked this pull request as ready for review March 30, 2026 21:30
@ver-nyan
Copy link
Copy Markdown
Contributor Author

Here's what it looks like:

bpftop_link_info

it adds some new dependencies specifically for collecting TC BPF filters attached to clsact qdisc. Support for BPF links for TC was only added in v6.6.

beyond the new bpf attachment stuff, I made some changes to convert type to &'static str since they're static.

also LinkTypeInfo variants that haven't been implemented yet in libbpf-rs v0.24.4 show up as "Unknown", which appears in the gif TC prog from the TCX links. would there be any way to bump the Fedora package version?

@ver-nyan ver-nyan changed the title WIP: Add bpf_link_info & TC BPF filter attach info feat: add bpf_link_info & TC BPF filter attach info Mar 30, 2026
@jfernandez
Copy link
Copy Markdown
Collaborator

Thanks for the update! The UI is looking great.

Regarding libbpf-rs, Fedora currently only has 0.25.0 packaged. Can you confirm that 0.25.0 would be sufficient to get the additional LinkTypeInfo variants (Tcx, Xdp, etc.) showing up instead of "Unknown"? Or do you need 0.26.x?

Also, I try to keep the Fedora package in sync with upstream, so any new dependencies need to be available in Fedora at the required versions. Could you check https://packages.fedoraproject.org and confirm that the following are packaged at the versions you need?

  • netlink-packet-core 0.8.1
  • netlink-packet-route 0.29.0
  • netlink-sys 0.8.8

If they're not published yet, I could maintain those packages. Just want to know what we're looking at before merging.

Once we have a clear picture on the packaging situation, I'll take a close look at the code.

@ver-nyan
Copy link
Copy Markdown
Contributor Author

ver-nyan commented Mar 31, 2026

libbpf-rs v0.25.0 is good, it actually looks like it has all the possible bpf_link_info variants so that's great.


netlink-packet-core 0.8.1 is present. :)
(+default is the same since there isn't any feature flags)

netlink-packet-route latest is on 0.28.0 unfortunately. :(
I'm not sure what the release schedule based on https://bugzilla.redhat.com/show_bug.cgi?id=2420491, but I can try to get more info.
(+default also same; there's no feature flags)

netlink-sys rawhide is on 0.8.8 while 43 & 42 are on 0.8.7, but I think I can make 0.8.7 work.
(+default also same since no features are enabled on default)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants