Skip to content

Conversation

dylandreimerink
Copy link
Member

@dylandreimerink dylandreimerink commented Jul 4, 2025

This PR introduces a new test runner for the BPF verifier complexity tests. This new runner still uses the existing files to get all of the build permutations to be ran, in addition it also allows for multiple permutations of load-time config to be tried for each build permutation.

The new runner also has a number of other improvements. First, we new reuse code from the loader to invoke the compiler in the exact same way we do in the cilium agent at runtime.

Second, we now run the tests in parallel, all build permutations and load-time configurations are run in parallel, which should speed up the test suite significantly.

Third, we tell the verifier to not spit out the entire verifier log, just the stats. This increases the speed of verification and lowers memory usage. When a load fails, we enable detailed verifier logs and re-attempt to gather the full log in such cases. On load failure, this full verifier log is emitted as test artifact along with the object file that failed to load. The --full-log flag can be used to force the full log to be emitted for all loads, even when successful. In case we want to do analysis of the successful logs.

Last, we enable additional stats gathering in the verifier, giving us the stack depth (amount of bytes of stack used by a program) and verifier verification time in microseconds (more accurate than time the full syscall takes). All stats collected are always emitted in a test artifact as a JSON file, which should be easy to query with jq or similar tools.

Fixes: #39143

Improved capabilities of verifier complexity tests

@dylandreimerink dylandreimerink added area/loader Impacts the loading of BPF programs into the kernel. area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. area/CI-improvement Topic or proposal to improve the Continuous Integration workflow dont-merge/preview-only Only for preview or testing, don't merge it. release-note/ci This PR makes changes to the CI. labels Jul 4, 2025
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch 2 times, most recently from 7fe7bc7 to b5287e4 Compare July 4, 2025 12:08
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from b5287e4 to baab150 Compare July 4, 2025 12:25
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from baab150 to 040e8bb Compare July 4, 2025 12:46
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from 040e8bb to 7ab236b Compare July 4, 2025 12:58
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from 7ab236b to 16ade69 Compare July 4, 2025 13:13
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from 16ade69 to ed636f4 Compare July 4, 2025 14:05
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from ed636f4 to 3d910cf Compare July 7, 2025 09:34
@dylandreimerink
Copy link
Member Author

/ci-verifier

1 similar comment
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from d50b767 to d23eb05 Compare July 7, 2025 10:33
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from d23eb05 to a1ab085 Compare July 7, 2025 10:42
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from a1ab085 to 326171e Compare July 7, 2025 11:22
@dylandreimerink
Copy link
Member Author

/ci-verifier

@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from 326171e to c1d4d37 Compare July 7, 2025 11:47
@dylandreimerink
Copy link
Member Author

/ci-verifier

Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Contributor

@rgo3 rgo3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three nits, otherwise looks good to me. Nice work!

As a side note, as previously mentioned offline I think we still need a nice way of excluding certain load config permutations if they are known not to work (if that problem ever comes up).

Copy link
Member

@aditighag aditighag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 LGTM!

@maintainer-s-little-helper maintainer-s-little-helper bot added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels Jul 14, 2025
@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch 2 times, most recently from 19e1ab5 to c07ff12 Compare July 15, 2025 07:03
@dylandreimerink
Copy link
Member Author

/test

@dylandreimerink dylandreimerink added this pull request to the merge queue Jul 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 15, 2025
@dylandreimerink dylandreimerink added this pull request to the merge queue Jul 15, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 15, 2025
There are some differences in the flags used by the makefile and the
loader package when invoking the compiler. This commit ensures that the
flags used by the makefile and the loader package match.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
This commit introduces a new test runner for the BPF verifier
complexity tests. This new runner still uses the existing files to get
all of the build permutations to be ran, in addition it also allows
for multiple permutations of load-time config to be tried for each
build permutation.

The new runner also has a number of other improvements. First, we
new reuse code from the loader to invoke the compiler in the exact
same way we do in the cilium agent at runtime.

Second, we now run the tests in parallel, all build permutations and
load-time configurations are run in parallel, which should speed up the
test suite significantly.

Third, we tell the verifier to not spit out the entire verifier log,
just the stats. This increases the speed of verification and lowers
memory usage. When a load fails, we enable detailed verifier logs
and re-attempt to gather the full log in such cases. On load failure,
this full verifier log is emitted as test artifact along with the
object file that failed to load. The `--full-log` flag can be used
to force the full log to be emitted for all loads, even when successful.
In case we want to do analysis of the successful logs.

Last, we enable additional stats gathering in the verifier, giving us
the stack depth (amount of bytes of stack used by a program) and
verifier verification time in microseconds (more accurate than
time the full syscall takes).
All stats collected are always emitted in a test artifact as a JSON
file, which should be easy to query with jq or similar tools.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
In v1.18 we changed the minimum supported kernel version to v5.10.
For a while we still were testing RHEL 8.6 against v5.4, but that is
no longer the case since #40390.

So we can remove the compile permutations for v5.4.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
Now that we have a new complexity test runner that lives in the
loader package we can delete the old one.

Signed-off-by: Dylan Reimerink <dylan.reimerink@isovalent.com>
@dylandreimerink dylandreimerink force-pushed the pr/dylandreimerink/new-complexity-tests branch from c07ff12 to 48ce612 Compare July 15, 2025 14:57
@dylandreimerink
Copy link
Member Author

/test

@dylandreimerink dylandreimerink added this pull request to the merge queue Jul 16, 2025
Merged via the queue into main with commit 3baa506 Jul 16, 2025
362 of 366 checks passed
@dylandreimerink dylandreimerink deleted the pr/dylandreimerink/new-complexity-tests branch July 16, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI-improvement Topic or proposal to improve the Continuous Integration workflow area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. area/loader Impacts the loading of BPF programs into the kernel. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set runtime configuration in verifier tests
5 participants