-
Notifications
You must be signed in to change notification settings - Fork 9
Fix execution issues for bpf_performance tests on latest kernel #229
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
base: main
Are you sure you want to change the base?
Conversation
|
@copilot your work on this fix got interrupted. Please resume work. |
- Added compile-time check for flags field in bpf_test_run_opts structure - Set BPF_F_TEST_XDP_LIVE_FRAMES flag when running XDP programs on Linux - Fixed issue where programs fail with -EINVAL on latest upstream kernel - Similar approach to existing HAS_BPF_TEST_RUN_OPTS_BATCH_SIZE flag Signed-off-by: GitHub Copilot <copilot@github.com>
Addressed code review feedback to use |= operator instead of direct assignment for better future-proofing. Signed-off-by: GitHub Copilot <copilot@github.com>
Signed-off-by: GitHub Copilot <copilot@github.com>
I've resumed and completed the work. The fix has been implemented in commits 169363b and 61ddb2c. The issue was that the latest upstream kernel requires the BPF_F_TEST_XDP_LIVE_FRAMES flag to be set for XDP programs. I've added:
All 42 tests now pass successfully, and there are no security vulnerabilities. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes execution issues where the bpf_performance_runner fails on newer Linux kernels that require the BPF_F_TEST_XDP_LIVE_FRAMES flag for XDP programs. The fix uses a compile-time check to detect the availability of the flags field in the bpf_test_run_opts structure, ensuring backward compatibility with older libbpf versions.
Changes:
- Added compile-time detection for the flags field in bpf_test_run_opts structure
- Updated runner to set BPF_F_TEST_XDP_LIVE_FRAMES flag for XDP programs on Linux
- Added CodeQL build artifacts to .gitignore
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| runner/CMakeLists.txt | Added compile-time check for flags field availability in bpf_test_run_opts, following the same pattern as the existing batch_size check |
| runner/runner.cc | Added linux/bpf.h include, defined BPF_F_TEST_XDP_LIVE_FRAMES constant, tracked program type, and set the flag for XDP programs in both test execution and map state preparation |
| .gitignore | Added CodeQL build directory artifacts to prevent them from being committed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot address and reply to each comment with what you fixed |
Fixed issue where actual_prog_type was not updated when reusing BPF objects from the cache. Now storing program type alongside the BPF object in bpf_object_info structure, ensuring correct flag settings for all tests including those with reused objects. Signed-off-by: GitHub Copilot <copilot@github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot address and reply to each comment with what you fixed |
Added validation to ensure that when a BPF object is reused from cache, the program_type specified in the YAML matches the type used when the object was first loaded. This prevents silent mismatches where different tests specify different program types for the same ELF file, which would lead to incorrect flag settings and unexpected behavior. Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR fixes the issue where bpf_performance_runner fails on the latest upstream kernel with error -EINVAL (error code -22, displayed as 4294967274 when printed as unsigned). The error originated from the kernel requiring the BPF_F_TEST_XDP_LIVE_FRAMES flag for XDP programs on newer kernels.
Changes Made:
flagsfield inbpf_test_run_optsstructure (similar to existingHAS_BPF_TEST_RUN_OPTS_BATCH_SIZE)BPF_F_TEST_XDP_LIVE_FRAMESflag when running XDP programs on LinuxTesting:
The fix ensures compatibility with both older and newer kernel versions through conditional compilation, and prevents configuration mismatches when reusing BPF objects.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.