Skip to content

[v1.19] loader: XDP attach type fallback logic#44496

Merged
ti-mo merged 3 commits intov1.19from
pr/v1.19-backport-2026-02-23-11-49
Feb 26, 2026
Merged

[v1.19] loader: XDP attach type fallback logic#44496
ti-mo merged 3 commits intov1.19from
pr/v1.19-backport-2026-02-23-11-49

Conversation

@ti-mo
Copy link
Copy Markdown
Contributor

@ti-mo ti-mo commented Feb 23, 2026

Once this PR is merged, a GitHub action will update the labels of these PRs:

 44209

@ti-mo ti-mo added kind/backports This PR provides functionality previously merged into master. backport/1.19 This PR represents a backport for Cilium 1.19.x of a PR that was merged to main. labels Feb 23, 2026
@ti-mo ti-mo changed the title v1.19 Backports 2026-02-23 [v1.19] loader: XDP attach type fallback logic Feb 23, 2026
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Feb 23, 2026

/test

dylandreimerink and others added 3 commits February 23, 2026 14:18
[ 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>
@ti-mo ti-mo force-pushed the pr/v1.19-backport-2026-02-23-11-49 branch from d1bd05b to 60d81cd Compare February 23, 2026 13:19
@ti-mo ti-mo marked this pull request as ready for review February 23, 2026 13:22
@ti-mo ti-mo requested a review from a team as a code owner February 23, 2026 13:22
@ti-mo
Copy link
Copy Markdown
Contributor Author

ti-mo commented Feb 23, 2026

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 26, 2026
@ti-mo ti-mo added this pull request to the merge queue Feb 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 26, 2026
@ti-mo ti-mo added this pull request to the merge queue Feb 26, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 26, 2026
@ti-mo ti-mo added this pull request to the merge queue Feb 26, 2026
Merged via the queue into v1.19 with commit c415698 Feb 26, 2026
721 of 756 checks passed
@ti-mo ti-mo deleted the pr/v1.19-backport-2026-02-23-11-49 branch February 26, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/1.19 This PR represents a backport for Cilium 1.19.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants