bpf_host: emit '-> network' traces for egress packets#13485
bpf_host: emit '-> network' traces for egress packets#13485ti-mo wants to merge 5 commits intocilium:masterfrom
Conversation
d74332d to
7e0b197
Compare
joestringer
left a comment
There was a problem hiding this comment.
Nice, I think this is quite close to what I had in mind.
Some feedback below on the main open topic, where to execute the trace_notify for these programs.
105d8c6 to
0e4192a
Compare
ti-mo
left a comment
There was a problem hiding this comment.
Another question I had: I recall seeing a test (suite) that checks for particular trace messages being emitted under certain packet scenarios. Could someone point me in the right direction? Should we add some tests to cover this PR as well?
2505041 to
534d460
Compare
1dcb9eb to
42c843d
Compare
|
This seems to need a rebase, so I'll mark it as draft so it disappears from assignee review queues. Feel free to mark ready for review again when you are looking for further review/feedback. |
For cilium#12561. To be able to send aggregated traces from 'to_netdev()', the monitor variable needs to be declared there and passed to the datapath as an argument. This is the IPv6 path, IPv4 will follow separately as it moves some logic to a func. checkpatch.pl trips over srcID, so that was changed to src_id. Signed-off-by: Timo Beckers <timo@isovalent.com>
For cilium#12561. Moved ipv4 egress srcid resolution to 'handle_to_netdev_ipv4' for parity with how ipv6 is handled. Also plumbs the aggregation monitor through to the ipv4 datapath. Signed-off-by: Timo Beckers <timo@isovalent.com>
…rt are enabled For cilium#12561. Also adds monitor aggregation to the TRACE_TO_NETWORK observation point, which has the side effect of enabling it by default. Signed-off-by: Timo Beckers <timo@isovalent.com>
Also added `CB_CT_MONITOR` to store monitor aggregation value. Signed-off-by: Timo Beckers <timo@isovalent.com>
For cilium#12561. Store monitor in skb->cb for use in nodeport tail calls. Signed-off-by: Timo Beckers <timo@isovalent.com>
1815a51 to
9b9689a
Compare
|
test-me-please |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has not seen any activity since it was marked stale. Closing. |
See the issue below for the full context. The caveat is, this program is only attached to the native device egress if the host firewall is enabled, so there still won't be any TRACE_TO_NETWORK visibility if that's not the case. bpf_host: emit '-> network' traces for packets leaving the node when Host Firewall are enabled Based on: cilium#13485 Fixes: cilium#12561 Co-authored-by: Thiago Navarro <navarro@accuknox.com> Signed-off-by: Timo Beckers <timo@isovalent.com> Signed-off-by: Thiago Navarro <navarro@accuknox.com>
See the issue below for the full context. The caveat is, this program is only attached to the native device egress if the host firewall is enabled, so there still won't be any TRACE_TO_NETWORK visibility if that's not the case. bpf_host: emit '-> network' traces for packets leaving the node when Host Firewall are enabled Based on: #13485 Fixes: #12561 Co-authored-by: Thiago Navarro <navarro@accuknox.com> Signed-off-by: Timo Beckers <timo@isovalent.com> Signed-off-by: Thiago Navarro <navarro@accuknox.com>
Fixes: #12561
See the issue above for the full context. The caveat is, this program is only attached to the native device egress if either the host firewall or BPF NodePort is enabled, so there still won't be any
TRACE_TO_NETWORKvisibility if that's not the case.I've had to move the trace to fire before
nodeport_nat_fwd()is called, since that function tail calls on the happy path, and there's no CT context available downstream from there. This could likely be improved when/if we adopt BTF and get rid of tail calls on kernels that support it.I've also added
handle_to_netdev_ipv4()to clean upto_netdev()a bit, to bring it on par with the ipv6 handling.