-
Notifications
You must be signed in to change notification settings - Fork 3.4k
loader: fix obsolete XDP program removal #30163
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
Merged
Merged
Conversation
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
This commit fixes a bug where `maybeUnloadObsoleteXDPPrograms()` removes XDP programs after a restart that are still in use and should remain in place. This can cause intermittent connectivity issues. The issue is that the kernel returns different values when it is queried for the attach mode of a netlink device compared to the values used when configuring the attach mode. E.g. when attaching with `XDPDriverMode` which evaluates to '4' in the input flags, querying it will return `XDP_ATTACHED_DRV` which evaluates to '1'. So when `maybeUnloadObsoleteXDPPrograms()` compares the queried values to the used input values there can be a mismatch which leads to cilium removing still needed XDP programs. This commit also changes the test, to be a suitable regression test for this fix. Previously the test was using `XDPGenericMode`. Unfortunately in this case the returned value from the kernel when querying netlink devices is `XDP_ATTACHED_SKB`, and both constants evaluate to '2' which is why this bug wasn't caught by the test in the first place. Fixes: cilium#30132 Signed-off-by: Robin Gögge <r.goegge@isovalent.com>
/test |
dylandreimerink
approved these changes
Jan 10, 2024
this indeed fixes my issue :) |
also verified here with these changes #30114 |
CI is green except for Gink-go conformance, which is hitting flake #30101. Marking ready-to-merge |
This was referenced Jan 12, 2024
dlapcevic
pushed a commit
to dlapcevic/cilium
that referenced
this pull request
Feb 13, 2024
The test is currently causing a lot of flakes, so it looks like we need to revisit cilium#30163 to figure out why it is still not addressed. Related: cilium#30114 Closes: cilium#30707 Closes: cilium#24728 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Pionerd
pushed a commit
to Pionerd/cilium
that referenced
this pull request
Feb 13, 2024
The test is currently causing a lot of flakes, so it looks like we need to revisit cilium#30163 to figure out why it is still not addressed. Related: cilium#30114 Closes: cilium#30707 Closes: cilium#24728 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
area/loader
Impacts the loading of BPF programs into the kernel.
backport/author
The backport will be carried out by the author of the PR.
backport-done/1.13
The backport for Cilium 1.13.x for this PR is done.
backport-done/1.14
The backport for Cilium 1.14.x for this PR is done.
backport-done/1.15
The backport for Cilium 1.15.x for this PR is done.
kind/bug
This is a bug in the Cilium logic.
kind/regression
This functionality worked fine before, but was broken in a newer release of Cilium.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/bug
This PR fixes an issue in a previous release of Cilium.
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.
This commit fixes a bug where
maybeUnloadObsoleteXDPPrograms()
removes XDP programs after a restart that are still in use and should remain in place. This can cause intermittent connectivity issues.The issue is that the kernel returns different values when it is queried for the attach mode of a netlink device compared to the values used when configuring the attach mode. E.g. when attaching with
XDPDriverMode
which evaluates to '4' in the input flags, querying it will returnXDP_ATTACHED_DRV
which evaluates to '1'. So whenmaybeUnloadObsoleteXDPPrograms()
compares the queried values to the used input values there can be a mismatch which leads to cilium removing still needed XDP programs.This commit also changes the test, to be a suitable regression test for this fix. Previously the test was using
XDPGenericMode
. Unfortunately in this case the returned value from the kernel when querying netlink devices isXDP_ATTACHED_SKB
, and both constants evaluate to '2' which is why this bug wasn't caught by the test in the first place.Fixes: #30132