bpf: hostfw: use tailcall buffer for ipv{4,6}_host_policy_{e,in}gress - #47648
Draft
smagnani96 wants to merge 2 commits into
Draft
bpf: hostfw: use tailcall buffer for ipv{4,6}_host_policy_{e,in}gress#47648smagnani96 wants to merge 2 commits into
smagnani96 wants to merge 2 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Similarly to what has been done in commit 524a591 ("bpf: Never allocate ct_buffers on stack"), let's move the `ct_buffer` to a pointer in `ipv{4,6}_host_policy_egress`. No additional code changes should be needed, as we initialize and use fields in subsequent functions as long as we need them. This should free us some space in stack and lower complexity. This requires moving the `cilium_tail_call_buffer{4,6}` map definitions before we include host_firewall.h. In host_firewall.h we already gate and protect to use it only when IS_BPF_HOST. Signed-off-by: Simone Magnani <[email protected]>
Similar to the previous commit and to what has been done in commit 524a591 ("bpf: Never allocate ct_buffers on stack"), let's move the `ct_buffer` to a pointer in `ipv{4,6}_host_policy_egress`. No additional code changes should be needed, as we initialize and use fields in subsequent functions as long as we need them. This should free us some space in stack and lower complexity. Signed-off-by: Simone Magnani <[email protected]>
pchaigno
force-pushed
the
pr/smagnani96/complexity-and-stack-optim
branch
from
August 3, 2026 08:36
2a90f81 to
9235a51
Compare
pchaigno
marked this pull request as ready for review
August 3, 2026 08:38
pchaigno
approved these changes
Aug 3, 2026
pchaigno
enabled auto-merge
August 3, 2026 08:38
|
/test |
pchaigno
disabled auto-merge
August 3, 2026 09:42
Member
pchaigno
marked this pull request as draft
August 6, 2026 07:42
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request performs a similar change as done in #45589, to reduce stack usage and complexity. See commits for details. This will help fix a complexity issue on one of the stable branches.