-
Hi, I would like to query which XDP program (if any) is attached to an interface and trying to figure out if there is support for that. I managed to make it work by extending the wrappers around the main PS. There is a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Without further information, it might be hard to get from a Link to an interface. In addition, Link is only supported for Linux kernel version 5.7 and newer iirc. Instead of querying the |
Beta Was this translation helpful? Give feedback.
Without further information, it might be hard to get from a Link to an interface. In addition, Link is only supported for Linux kernel version 5.7 and newer iirc.
Instead of querying the
BPF
syscall, I would recomment to walk the interfaces usingrtnetlink
. As shown in the example, one can query all interfaces quite easily and then further check theXDP
element in theLinkAttributes
in the returnedLinkMessage
.LinkXDP
holdsFD
, which can be used as argument toNewProgramFromFD()
to resolve the eBPF program.