Skip to content

Set runtime configuration in verifier tests #39143

@ti-mo

Description

@ti-mo

Currently, there's no way of populating runtime configuration variables declared using DECLARE_CONFIG in verifier tests. This prevents porting over macros like ENABLE_IPV4=1 since they control branching, and the whole point of the verifier tests is having these chunks of code enabled.

This issue is for coming up with and implementing a solution to replace the configuration values in the files in bpf/complexity-tests/*/*/{1,2,etc}.txt with another mechanism. There's an opportunity to innovate on our approach, automate testing to reduce oversights, potentially increasing verifier test coverage in the process.

For example, given an ELF (bpf_lxc.o) and its config (struct BPFLXC), we could automatically generate all permutations of possible config values (true|false for bools, 0|1|MaxUint16 for u16, etc.) to ensure there can be no verifier errors under certain user configurations. Not sure how this will shake out in practice, but having some form of automation is now possible thanks to config structs.

Initially, a 1:1 port of the existing approach would suffice.

Metadata

Metadata

Labels

area/datapathImpacts bpf/ or low-level forwarding details, including map management and monitor messages.area/loaderImpacts the loading of BPF programs into the kernel.pinnedThese issues are not marked stale by our issue bot.

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions