-
Notifications
You must be signed in to change notification settings - Fork 108
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
Refactor http2_grpc to leverage tail calls #1447
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,22 @@ | |||
#ifndef K_TRACER_TAILCALL_H |
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.
This file was necessary to avoid a cyclic header dependency.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1447 +/- ##
===========================================
- Coverage 76.86% 65.36% -11.50%
===========================================
Files 149 148 -1
Lines 15252 15255 +3
===========================================
- Hits 11723 9972 -1751
- Misses 2911 4541 +1630
- Partials 618 742 +124
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fc24639
to
d25b57a
Compare
http2_grpc_request_t prev_info; | ||
u8 has_prev_info; | ||
|
||
int pos; //FIXME should be size_t equivalent |
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.
This FIXME will be addressed separately - there are too many other places to check and tweak.
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.
LGTM as long as test are fixed!
Also, could you add some extra commenting to the new C functions 🙏 ?
The latest kernel versions have changed the way the verifier deals with scalar spills, reducing its tolerance towards complex programs - for a comprehensive discussion, please refer to
https://lore.kernel.org/bpf/[email protected]/T/
Our http2 code therefore no longer passes the verifier, owing to mostly a complex for loop. This PR splits the code into different bpf programs that are now tail called, and changes the
_for_
loop to be a hybrid of a recursive bpf_tail_call and a loop with less iterations. This approach was chosen because neither do we want to bpf_tail_call/recurse for each iteration, nor do we wish to usebpf_loop
as constrains our program to kernel versions greater than 5.17.