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

Implement libbpf autoload APIs #3592

Merged
merged 15 commits into from
Jun 3, 2024
Merged

Implement libbpf autoload APIs #3592

merged 15 commits into from
Jun 3, 2024

Conversation

dthaler
Copy link
Collaborator

@dthaler dthaler commented May 30, 2024

Description

This PR does the following:

  • Implement libbpf autoload APIs
  • Make bpf_program__set_type() fail for native programs, since verification is done at compile time so the prog type cannot be changed after that.
  • Add a test for the case of a file with maps but 0 programs. Per the libbpf API contract, the load should succeed and create the maps.
  • Remove program_type from the load native programs ioctl, since it was unused and since a file loaded can contain programs of multiple types.
  • Update _load_invalid_program in unit_tests to match the same function in api_test

Fixes #3555

Testing

Updated tests.

Documentation

Updated docs.

Installation

No impact.

Alan-Jowett
Alan-Jowett previously approved these changes May 31, 2024
libs/api/ebpf_api.cpp Show resolved Hide resolved
libs/api/ebpf_api.cpp Outdated Show resolved Hide resolved
libs/api/ebpf_api.cpp Outdated Show resolved Hide resolved
tests/api_test/api_test.cpp Outdated Show resolved Hide resolved
tests/api_test/api_test.cpp Outdated Show resolved Hide resolved
Alan-Jowett
Alan-Jowett previously approved these changes May 31, 2024
Signed-off-by: Dave Thaler <[email protected]>
Files with no program sections succeed loading

Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
Signed-off-by: Dave Thaler <[email protected]>
tests/end_to_end/end_to_end.cpp Show resolved Hide resolved
tests/api_test/api_test.cpp Outdated Show resolved Hide resolved
libs/api/ebpf_api.cpp Outdated Show resolved Hide resolved
libs/api/ebpf_api.cpp Outdated Show resolved Hide resolved
Signed-off-by: Dave Thaler <[email protected]>
saxena-anurag
saxena-anurag previously approved these changes Jun 1, 2024
Signed-off-by: Dave Thaler <[email protected]>
@dthaler dthaler added this pull request to the merge queue Jun 3, 2024
Merged via the queue into microsoft:main with commit 7b3f682 Jun 3, 2024
84 of 86 checks passed
@dthaler dthaler deleted the autoload branch June 3, 2024 16:18
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.

Add support for autoload libbpf APIs
3 participants