[v1.19] loader: XDP attach type fallback logic#44496
Merged
Conversation
Contributor
Author
|
/test |
[ upstream commit 7c633a7 ] Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com> Signed-off-by: Timo Beckers <timo@isovalent.com>
[ upstream commit c861775 ] Due to changes in newer kernels and the cilium/ebpf library, XDP programs will in future be loaded as ebpf.AttachXDP. However, older Cilium versions will have already created links with ebpf.AttachNone programs. The kernel does not allow us to change the program of a link if its attach type does not match. This means that we can only use the new XDP attach type when a link is newly created. This commit adds logic which detects errors on link update and attempts to load and attach with the other attach type instead. So when upgrading from an older version to a newer version, new links are created as XDP attach type, but existing links will remain using the AttachNone. On downgrade, all links will be created with AttachNone, and existing links will continue to use AttachXDP. Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com> Co-authored-by: Timo Beckers <timo@isovalent.com> Signed-off-by: Timo Beckers <timo@isovalent.com>
This commit is unique to release branches. ebpf-go will now return AttachXDP as the attach type of XDP programs by default. This is something the Cilium versions that want to upgrade to/from versions using the new ebpf-go release need to be aware of. This commit restores the old behaviour of the library on top of having the retry loop added in the previous commit, making sure we don't use the new attach type unless strictly necessary. Signed-off-by: Timo Beckers <timo@isovalent.com>
d1bd05b to
60d81cd
Compare
Contributor
Author
|
/test |
dylandreimerink
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Once this PR is merged, a GitHub action will update the labels of these PRs: