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

Fix xdp-forward loading and unloading in some cases #489

Merged
merged 5 commits into from
Mar 6, 2025
Merged

Conversation

tohojo
Copy link
Member

@tohojo tohojo commented Mar 5, 2025

@sbraz discovered that xdp-forward can't unload properly when run in flowtable
mode. It turns out we also can't attach to interfaces with high ifindexes. Fix
both issues and add tests to verify.

Fixes #487.

tohojo added 5 commits March 5, 2025 13:30
The BPF function names used by xdp-forward in flowtable mode end up
being ambiguous when truncated by the kernel. This causes xdp-forward to
be unable to unload the programs. Fix this by using shorter function
names.

Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
The DEVMAP map types used by xdp-forward prevents installing xdp-forward
on ifindexes larger than the map size, because the ifindex is also used
as the lookup key. Change to DEVMAP_HASH to avoid this.

Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
Converting errno returns to program exit status means we may end up
returning SKIPPED_TEST, which messes with the selftests. Change this to
always use EXIT_SUCCESS/EXIT_FAILURE instead.

Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
The flowtable test for xdp-forward did not unload the programs after
running, which is why it didn't catch the ambiguous program name error.
Add an unload to the text to make sure this keeps working.

Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
Add a test that creates an interface with a high ifindex and verify that
xdp-forward can attach to it.

Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
@tohojo tohojo force-pushed the xdp-forward-fixes branch from 8714c94 to 1bf5e3e Compare March 5, 2025 12:30
@tohojo tohojo merged commit 6b1c35c into main Mar 6, 2025
29 checks passed
@tohojo tohojo deleted the xdp-forward-fixes branch March 6, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xdp-forward unload fails with "Couldn't find program on interface"
1 participant