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: Remove duplicate code in bpf_sock.c #10862
Conversation
test-me-please |
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.
Would it make sense to add -DHOOK_CONNECT
to LB_OPTIONS
in bpf/Makefile
so it gets compile-tested too in various option combinations?
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.
Makes sense, but why do we need even more ifdef wrt HOOK_CONNECT
at all? Either we could leave the sanity check in place (which doesn't hurt much either) or if we really want to remove it then via const bool
so compiler optimizes it out. I'd probably do the former so __sock4_xlate()
could stay unchanged, for example.
@borkmann It was just to save a few CPU cycles considering that the unnecessary checks would be in the fastpath in the case of UDP. If you think that's not worth doing, then I can remove the ifdefs from the checks. |
But in such case I'd just go for |
0f9ef14
to
1960340
Compare
test-me-please |
@tklauser |
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.
Even nicer without the HOOK_CONNECT
define! Two small nits/questions inline. Otherwise LGTM.
1960340
to
82fe288
Compare
test-me-please |
1 similar comment
test-me-please |
82fe288
to
6705034
Compare
test-me-please |
This commit refactors __sock{4,6}_xlate() functions in a way that they can be used to replace __sock{4,6}_snd_xlate(). The refactoring also allows us to get rid of the sock6_xlate_snd_v4_in_v6() function. Signed-off-by: Martynas Pumputis <m@lambda.lt>
test-me-please |
CI hit the flake #10669. As my code changes are tested by the flaking test, re-running the CI. |
test-me-please |
1 similar comment
test-me-please |
test-me-please |
This commit refactors
__sock{4,6}_xlate()
functions in a way that they can be used to replace__sock{4,6}_snd_xlate()
.The refactoring also allows us to get rid of the
sock6_xlate_snd_v4_in_v6()
function.