loader: XDP attach type fallback logic#44209
Merged
ti-mo merged 2 commits intocilium:mainfrom Feb 20, 2026
Merged
Conversation
Member
Author
|
/test |
3740a48 to
be08864
Compare
Member
Author
|
/test |
ti-mo
reviewed
Feb 9, 2026
Contributor
ti-mo
left a comment
There was a problem hiding this comment.
Thanks! Left some comments.
a48d416 to
885c3c0
Compare
885c3c0 to
2014352
Compare
Contributor
|
/test |
Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
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>
2014352 to
e7b9529
Compare
Contributor
|
/test |
ti-mo
approved these changes
Feb 20, 2026
rastislavs
approved these changes
Feb 20, 2026
1 task
2 tasks
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.
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.
Fixes: #44063