Skip to content

bpf: encap: send TO_OVERLAY trace before adding encapsulation#25828

Merged
julianwiedmann merged 1 commit intocilium:mainfrom
julianwiedmann:1.14-xdp-encap-trace
Jun 2, 2023
Merged

bpf: encap: send TO_OVERLAY trace before adding encapsulation#25828
julianwiedmann merged 1 commit intocilium:mainfrom
julianwiedmann:1.14-xdp-encap-trace

Conversation

@julianwiedmann
Copy link
Copy Markdown
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 area/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
Copy Markdown
Member Author

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

@julianwiedmann
Copy link
Copy Markdown
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
@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

area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants