Socket tracker for L7 context propagation #1377
Draft
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.
This PR adds L7 context propagation by leveraging a socket map. The code runs as follows:
The writing of the memory in TC is very complex and I'm not certain it needs to be. Essentially, in all my experiments the adding of extra memory in sock_msg results in separate unique empty TCP packet of the exact size. We cover this case in the "fast path". If we can confirm by reading the kernel code that this will always be the case we can remove the written accounting and the custom memcpy I added.
I hit issues with the verifier about the handling of IPv6. It worked on my small prototype, but not when I merged the code in Beyla. We need to fix this.
Note:
BEYLA_BPF_TC_CP
enables now both L4 and L7 context propagation.TODO: