-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
cilium: Remove attached bpf_xdp upon "cilium cleanup" #19735
Conversation
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.
Hi, sorry for the late response and thanks for your contribution!
Could you use vishvananda/netlink
and cilium/ebpf
instead of ip
and bpftool
? We are now basically removing those two from our code base.
that's no problem! i will update commit |
@YutaroHayakawa , as far as I know, BPF_PROG_GET_FD_BY_ID/BPF_OBJ_GET_INFO_BY_FD equivalence cilium/ebpf call is
|
Ah, alright. In that case, please use |
i could add an |
f656b21
to
4951887
Compare
@zhanghe9702 Thanks for the PR!
Maybe you could ping https://github.com/cilium/ebpf maintainers about exporting the functions (e.g., @ti-mo)? It would be good to not add a new code which depends on tools from which we are trying to migrate off. |
|
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.
Please s/Xdp/XDP/
everywhere. (except for netlink.LinkSetXdpFd
, of course)
cca5837
to
673de27
Compare
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.
LGTM with Nit
b7aecb7
to
4a4afa1
Compare
7b0e5ea
to
ab83db0
Compare
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.
A couple minor comments below, but looks good to me otherwise. Thanks for tackling this! 🚀
cilium/cmd/cleanup.go
Outdated
return false, err | ||
} | ||
|
||
if strings.Contains(info.Name, "bpf_xdp_entry") { |
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.
How can we ensure that we won't forget to update this if/when we update the function's name in bpf_xdp.c
? AFAIK, we don't have any tests covering this. At the very least, we should add a comment in bpf_xdp.c
.
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.
The comment is still needed IMO.
ab83db0
to
a742ac8
Compare
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.
Thanks, LGTM.
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.
Logging still needs to be fixed. See previous review.
a742ac8
to
07fb7e6
Compare
/test |
cilium cleanup doesn't remove a previously attached XDP progs by Cilium, this commit is an complementary. Fixes: cilium#19586 Signed-off-by: zhang he <zhanghe9702@163.com>
07fb7e6
to
9531cbc
Compare
/test Job 'Cilium-PR-K8s-1.22-kernel-5.4' failed: Click to show.Test Name
Failure Output
If it is a flake and a GitHub issue doesn't already exist to track it, comment |
just run it in local CI,passed :-)
|
/test-1.22-5.4 |
PR cilium#20615 added a new test which relied on the name of the XDP entry program. PR cilium#19735 changed this name. They were merged within short time of each other, since the changes were not overlapping no merge conflict resulted. This commit fixes the test so it works with the new name. Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
PR #20615 added a new test which relied on the name of the XDP entry program. PR #19735 changed this name. They were merged within short time of each other, since the changes were not overlapping no merge conflict resulted. This commit fixes the test so it works with the new name. Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
PR cilium#20615 added a new test which relied on the name of the XDP entry program. PR cilium#19735 changed this name. They were merged within short time of each other, since the changes were not overlapping no merge conflict resulted. This commit fixes the test so it works with the new name. Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
cilium cleanup doesn't remove a previously attached XDP progs by Cilium,
this commit is an complementary.
Fixes: #19586
Signed-off-by: zhang he zhanghe9702@163.com