Repository navigation
Port selftests for loop (non-volatile) which are feasible now - #109
Merged
Merged
Conversation
for/while lower since #106. The iterator loops (bpf_for, bpf_repeat) and the bpf_loop helper do not, so they keep a hard label of their own, and a do { } while (0) macro is no longer read as a loop. Against bpf-next 5714ca8 the programs with no hard blocker go from 29 to 39. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Four programs from prog_tests/bpf_verif_scale.c that loops alone kept out. The loop lowering matches clang's for the same C, but volatile, barrier() and the no-unroll pragma have no spelling here: loop2 folds to a constant and loop4 unrolls, so those two no longer make the verifier walk a loop. Their headers and PORTING-NOTES.md say so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The added fixtures and audit updates are internally consistent, with known semantic limitations clearly documented.
0 open findings
What changed in this PR
Ports four Linux BPF loop selftests and updates audit documentation for newly supported loops.
Changes:
- Adds nested, bounded, and break-driven loop fixtures.
- Updates selftest auditing to distinguish unsupported iterator/helper loops.
- Documents port limitations caused by missing volatile reads and compiler barriers.
| File | Description |
|---|---|
tools/selftest-audit.py |
Updates loop classification. |
tests/kernel_selftest_equivalent/vmlinux/loop1.py |
Adds nested-loop verifier test. |
tests/kernel_selftest_equivalent/vmlinux/loop2.py |
Adds break-driven while-loop port. |
tests/kernel_selftest_equivalent/vmlinux/loop4.py |
Adds bounded branching-loop port. |
tests/kernel_selftest_equivalent/vmlinux/loop5.py |
Adds multi-exit while-loop port. |
tests/kernel_selftest_equivalent/PORTING-NOTES.md |
Records coverage and limitations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…operly -d asks the kernel for the instruction-level verifier log on every load. For loop1, which makes the verifier walk nested loops, that log outgrows libbpf's buffer; the kernel fails the load with ENOSPC, libbpf doubles the buffer and verifies again, and on CI the load ran past the 30s timeout. A rejection still comes with its log without -d, since libbpf retries a failed load at log level 1 and prints it as a warning. The timeout path also returned a bare string where callers expect stdout and stderr, so a timeout surfaced as an AttributeError instead of the timeout. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
lgtm, simple change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.