Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpf: Add BPF map operations for the StateDB reconciler #32123

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

joamaki
Copy link
Contributor

@joamaki joamaki commented Apr 22, 2024

This allows defining the desired state of a BPF map as a StateDB table and to reconcile it with a BPF map. The table can be inspected with "cilium-dbg statedb dump" (or with a table-specific command), and the reconciliation state of each object can be queried. Failure the reconcile will be reported in module health, metrics and in the individual objects.

See ops_linux_test.go for example usage.

@joamaki joamaki added the release-note/misc This PR makes changes that have no direct user impact. label Apr 22, 2024
@joamaki
Copy link
Contributor Author

joamaki commented Apr 22, 2024

I left out the batch operations as I'm not sure how we could currently do this efficiently without bunch of copying and the benchmarks didn't show significant improvement in speed.

Here's how it would approximately look like: https://github.com/cilium/cilium/pull/31035/files#diff-d8fb501ccfd280cddcf1eb74a221bcd6de40714f3fbba1176502fbb435ec18c7R165.

Add index.Uint32 and use Append* functions instead for shorter implementation.

Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki joamaki force-pushed the pr/joamaki/bpf-reconciler-ops branch from f62c128 to 558373e Compare April 22, 2024 13:16
This allows defining the desired state of a BPF map as a StateDB
table and to reconcile it with a BPF map. The table can be inspected
with "cilium-dbg statedb dump" (or with a table-specific command),
and the reconciliation state of each object can be queried. Failure
the reconcile will be reported in module health, metrics and in the
individual objects.

See ops_linux_test.go for example usage.

Signed-off-by: Jussi Maki <jussi@isovalent.com>
@joamaki joamaki force-pushed the pr/joamaki/bpf-reconciler-ops branch from 558373e to fefb136 Compare April 22, 2024 15:31
@joamaki
Copy link
Contributor Author

joamaki commented Apr 23, 2024

/test

@joamaki joamaki marked this pull request as ready for review April 23, 2024 14:20
@joamaki joamaki requested review from a team as code owners April 23, 2024 14:20
Copy link
Member

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

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

LGTM

@joamaki joamaki enabled auto-merge April 24, 2024 08:00
@joamaki
Copy link
Contributor Author

joamaki commented Apr 24, 2024

/test

@joamaki joamaki added this pull request to the merge queue Apr 24, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Apr 24, 2024
Merged via the queue into cilium:main with commit 6092fca Apr 24, 2024
61 of 62 checks passed
@joamaki joamaki deleted the pr/joamaki/bpf-reconciler-ops branch April 24, 2024 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants