Skip to content

Remove 'map migration' mechanism #29333

@ti-mo

Description

@ti-mo

This supersedes #24013.

When an ELF is loaded and one or more of its maps are incompatible with a pinned map on bpffs, something needs to be done for ELF loading to proceed normally. Historically, we've opted for renaming the existing map pin with a :pending suffix, but this has the unfortunate downside of creating state to manage on bpffs.

As an alternative, I'm proposing to remove {Start,Finalize}BPFFSMapMigration altogether, and return a commit() closure from bpf.LoadCollection() instead of finalize() in replaceDatapath(). This would minimize changes in callers of replaceDatapath().

As a follow-up, we can make bpf.NewCollection support custom pinning flags for e.g. per-endpoint maps and always-recreated maps like cilium_calls. commit() can be used to perform the pinning operations for those maps as well, e.g. for #29334.

Metadata

Metadata

Assignees

Labels

area/loaderImpacts the loading of BPF programs into the kernel.kind/tech-debtTechnical debtpinnedThese 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