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

map: disentangle per-CPU handling #1067

Merged
merged 1 commit into from
Jun 21, 2023
Merged

map: disentangle per-CPU handling #1067

merged 1 commit into from
Jun 21, 2023

Conversation

lmb
Copy link
Collaborator

@lmb lmb commented Jun 19, 2023

It's difficult to figure out what kind of types are valid to unmarshal into because "regular" and per-CPU values use the same code paths. This was done originally to cut down on duplicate code, but ultimately has just led to harder to read code.

Handle per-CPU values in a separate code path. This in turn makes it easy to understand that the only valid types for per-CPU values are slices and pointers to slices. Zero-copy shenanigans with unsafe.Pointer are not supported.

@lmb lmb requested review from ti-mo and rgo3 June 19, 2023 09:47
It's difficult to figure out what kind of types are valid to unmarshal
into because "regular" and per-CPU values use the same code paths.
This was done originally to cut down on duplicate code, but ultimately
has just led to harder to read code.

Handle per-CPU values in a separate code path. This in turn makes it
easy to understand that the only valid types for per-CPU values are
slices and pointers to slices. Zero-copy shenanigans with unsafe.Pointer
are not supported.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@lmb lmb merged commit f4b0232 into cilium:master Jun 21, 2023
@lmb lmb deleted the per-cpu-marshal branch June 21, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants