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: lb: misc cleanups #25372
Merged
julianwiedmann
merged 4 commits into
cilium:main
from
julianwiedmann:1.14-bpf-lb-cleanups
May 12, 2023
Merged
bpf: lb: misc cleanups #25372
julianwiedmann
merged 4 commits into
cilium:main
from
julianwiedmann:1.14-bpf-lb-cleanups
May 12, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pull the code that only applies to CT_REPLY into the switch statement, so that CT_NEW doesn't need to jump over it. The diff looks massive, but that's only because all the indentation changes. It's really just copy & paste and adjusting the goto's. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Don't require the callers to pass in a full ct_state struct. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
lb*_local() gets called with a ct_state struct. This struct gets used for the internal ct_lookup() [with CT_SERVICE scope], and is also updated with the selected backend_id and rev_nat_index. lb_local()'s caller then either uses the same ct_state struct for its own CT handling (in case of nodeport_lb()), or transports some fields across a tail-call and plumbs them into a new ct_state struct (in case of bpf_lxc). But both callers create their own CT entries with non-CT_SERVICE scope. So ct_create() simply ignores the ct_state->backend_id field, and doesn't copy it into the actual CT entry. Therefore lb*_local() doesn't need to bother with passing the selected backend_id back. We just need to store/update it in the CT_SERVICE entry. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
ct_update_backend_id() and ct_update_rev_nat_index() typically come in pairs. Add a helper that applies the updates with a single map lookup. Suggested-by: Maxim Mikityanskiy <maxim@isovalent.com> Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
julianwiedmann
added
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
release-note/misc
This PR makes changes that have no direct user impact.
labels
May 11, 2023
/test |
gentoo-root
reviewed
May 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
gentoo-root
approved these changes
May 12, 2023
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
May 12, 2023
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.
sig/datapath
Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some more cleanups to untangle
lib/lb.h
. #24757 might help as background.