-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: minor CT cleanups #23718
bpf: minor CT cleanups #23718
Conversation
Remove some dead code. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
We currently have IPv4 and IPv6 variants of several helpers that update a CT entry. These only differ in the CT tuple parameter, which then gets used as key for a map lookup. To avoid this duplication, take ct_update_nodeport() as example and turn the CT tuple into an opaque parameter. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
/test |
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.
Very nice, love to see it!
/test-1.16-4.19 |
@@ -935,7 +935,7 @@ static __always_inline int lb6_local(const void *map, struct __ctx_buff *ctx, | |||
/* See lb4_local comment */ | |||
if (state->rev_nat_index == 0) { | |||
state->rev_nat_index = svc->rev_nat_index; | |||
ct_update6_rev_nat_index(map, tuple, state); |
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.
FYI: even if we don't rely on the compiler anymore to check the types, we could easily rely on Coccinelle instead to check that the second parameter is one of the two expected types.
Just some minor CT cleanups that have accumulated.