Skip to content
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: encap: send TO_OVERLAY trace before adding encapsulation #25828

Merged
merged 1 commit into from Jun 2, 2023

Conversation

julianwiedmann
Copy link
Member

When used from TC context, ctx_set_encap_info() merely adds the tunnel metadata without touching the packet content. So the send_trace_notify() still describes the content of the inner packet.

But when called from XDP context, the ctx_set_encap_info() invocation pushes the actual tunnel headers. So the send_trace_notify() will report the outer packet.

Move the trace statement slightly up, so that it consistently describes the inner packet. Note that we now get a trace entry when the subsequent ctx_set_encap_info() fails - so we would need to match any resulting drop notification against the preceding TRACE_TO_OVERLAY.

When used from TC context, ctx_set_encap_info() merely adds the tunnel
metadata without touching the packet content. So the send_trace_notify()
still describes the content of the inner packet.

But when called from XDP context, the ctx_set_encap_info() invocation
pushes the actual tunnel headers. So the send_trace_notify() will report
the *outer* packet.

Move the trace statement slightly up, so that it consistently describes
the inner packet. Note that we now get a trace entry when the
subsequent ctx_set_encap_info() fails - so we would need to match any
resulting drop notification against the preceding TRACE_TO_OVERLAY.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
@julianwiedmann julianwiedmann added sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/misc This PR makes changes that have no direct user impact. labels Jun 1, 2023
@julianwiedmann
Copy link
Member Author

This addresses one of the follow-ons from #24422.

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann marked this pull request as ready for review June 1, 2023 17:15
@julianwiedmann julianwiedmann requested a review from a team as a code owner June 1, 2023 17:15
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jun 2, 2023
@julianwiedmann julianwiedmann merged commit a5775c4 into cilium:main Jun 2, 2023
62 checks passed
@julianwiedmann julianwiedmann deleted the 1.14-xdp-encap-trace branch June 2, 2023 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants