-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ipvlan: use github.com/cilium/ebpf to create map and load program #14043
Conversation
test-me-please |
a520718
to
f8f1b72
Compare
test-me-please |
f8f1b72
to
d84adeb
Compare
This will also pull in github.com/google/go-cmp v0.5.2 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit introduces a test to verify the tail call map program is unchanged during refactoring by successive commits. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This makes it easier to understand what the eBPF program does. In commit 7bfe015 ("cilium, ipvlan: add initial endpoint ipvlan support") the loaded program was described as: [...] The program we load to cls_bpf is doing: load BPF map fd into register R2, load 0 into register R3, (R1 has implicit skb already), and do a tail call into the map. Fall-through is just exiting with TC_ACT_OK. [...] Using TestEntryProgInstructions introduced in the previous commit it can be verified that the emitted instructions are in fact the same. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This allows to drop the local copy of bpfAttrProg and the magic numbers for prog type and the bpf() syscall commands. Instead it leverages the cilium ebpf lib to load the eBPF program. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Use the github.com/cilium/ebpf library to create the tail call map and load the corresponding program. This allows to drop local definitions of various BPF types as well as a lot of direct interaction with the bpf() syscall. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
d84adeb
to
dcfe087
Compare
Rebased after #14056 was merged. |
test-me-please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great to see we are starting to move towards using cilium/ebpf
🔥🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto on moving to cilium/ebpf
QQ, what kind of validation have we done on this? When I grep for |
I was wrongly assuming that this is covered by the docker-based runtime tests, sorry about that. I'll run the IPVLAN-based Networking GSG to verify this. |
Reviewable by commit, see individual commit messages for details.