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

bpf: force inline functions #712

Merged
merged 1 commit into from
Sep 30, 2024
Merged

bpf: force inline functions #712

merged 1 commit into from
Sep 30, 2024

Conversation

AltraMayor
Copy link
Owner

clang version 18.1.3 on Ubuntu 24.04.1 LTS ignores the hint inline while compiling bpf/tcp-services.c, which, in turn, leads to Gatekeeper servers to fail to load that BPF. clang does this because some inline functions in bpf/tcp-services.c increase the number of jumping states a lot (see is_port_listed_forward() and is_port_listed_back()).

Although clang's decision is smart from an optimization point of view, it breaks Gatekeeper because DPDK's BPF library does not support a BPF function to call another BPF function.

clang version 18.1.3 on Ubuntu 24.04.1 LTS ignores the hint 'inline'
while compiling bpf/tcp-services.c, which, in turn, leads to
Gatekeeper servers to fail to load that BPF.
clang does this because some inline functions in bpf/tcp-services.c
increase the number of jumping states a lot (see is_port_listed_forward()
and is_port_listed_back()).

Although clang's decision is smart from an optimization point of view,
it breaks Gatekeeper because DPDK's BPF library does not support
a BPF function to call another BPF function.
@AltraMayor AltraMayor added the Production requirement Either the issue is solved, or Gatekeeper doesn't work in production label Sep 27, 2024
@AltraMayor AltraMayor added this to the Version 1.2 milestone Sep 27, 2024
@AltraMayor
Copy link
Owner Author

@ShawnLeung87 confirmed the solution. See issue #711.

@AltraMayor AltraMayor merged commit 917021c into master Sep 30, 2024
1 check passed
@AltraMayor AltraMayor deleted the bpf_ai branch September 30, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Production requirement Either the issue is solved, or Gatekeeper doesn't work in production
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant