Skip to content
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

[1.15] loader: fix obsolete XDP program removal #30224

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

rgo3
Copy link
Contributor

@rgo3 rgo3 commented Jan 12, 2024

This is a manual backport of #30163.

@rgo3 rgo3 requested a review from a team as a code owner January 12, 2024 08:50
@maintainer-s-little-helper maintainer-s-little-helper bot added backport/1.15 This PR represents a backport for Cilium 1.15.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. labels Jan 12, 2024
@rgo3
Copy link
Contributor Author

rgo3 commented Jan 12, 2024

/test-backport-1.15

@rgo3 rgo3 force-pushed the pr/rgo3/1.15-fix-obsolete-xdp-removal branch from 37259f5 to 1120831 Compare January 12, 2024 09:48
@rgo3
Copy link
Contributor Author

rgo3 commented Jan 12, 2024

/test-backport-1.15

@aanm
Copy link
Member

aanm commented Jan 15, 2024

@rgo3 this PR needs to be rebased since ipsec test is timing out and the timeout was increased already on the v1.15 branch.

[ upstream commit ea7c375 ]

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: #30132

Signed-off-by: Robin Gögge <r.goegge@isovalent.com>
@rgo3 rgo3 force-pushed the pr/rgo3/1.15-fix-obsolete-xdp-removal branch from 1120831 to 2579c25 Compare January 15, 2024 13:02
@rgo3
Copy link
Contributor Author

rgo3 commented Jan 15, 2024

/test-backport-1.15

@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 Jan 15, 2024
@dylandreimerink dylandreimerink merged commit bb9a3ce into v1.15 Jan 15, 2024
205 checks passed
@dylandreimerink dylandreimerink deleted the pr/rgo3/1.15-fix-obsolete-xdp-removal branch January 15, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.15 This PR represents a backport for Cilium 1.15.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.

None yet

4 participants