Skip to content

bpf: migrate non-branching config macros to runtime configuration #38370

@dylandreimerink

Description

@dylandreimerink

The current step in the clang-freedom (pre-compiled eBPF programs) journey is to start transitioning compile time configuration to load-time (runtime) configuration. The necessary agent and loader infrastructure has been merged.

Runtime configuration can be defined with DECLARE_CONFIG and NODE_CONFIG. See Configuring the Datapath in the Cilium Developer docs for guidelines and principles.

This issue specifically tracks variables which do not influence control flow by enabling or disabling certain code paths. Variables used in #ifdef/#if and if(is_defined(...)) will be converted in 1.19 since dead code elimination only really landed in Linux 5.5, and Cilium 1.18 targets Linux 5.4 which will go EOL at the end of 2025. 1.19 targets Linux 5.10. We can migrate branching macros, too. Additionally, #41628 shipped in 1.19 which added dead code detection in the agent to avoid loading unused maps and tail calls. Branching macros can now safely be ported.

This issue is for migrating node_config.h and WriteNodeConfig entries to config.Node, as well as some leftover per-object configs in ep_config.h. Through this issue, we can coordinate work and keep an overview. If you want to work on a particular (set of) variable(s), drop a comment and we'll spin out an issue or assign you to a list item.

The list may change over time and may grow as we find more work in this category. When migrating variables, do a quick search through Paul's macro documentation for a good docstring to use in DECLARE_CONFIG.

Metadata

Metadata

Assignees

No one assigned

    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.kind/metaMeta-task for co-ordination.pinnedThese issues are not marked stale by our issue bot.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions