Skip to content

bpf: encap: fix ifindex in TO_OVERLAY trace notification#33083

Merged
julianwiedmann merged 1 commit intocilium:mainfrom
julianwiedmann:1.16-bpf-encap-trace
Jun 14, 2024
Merged

bpf: encap: fix ifindex in TO_OVERLAY trace notification#33083
julianwiedmann merged 1 commit intocilium:mainfrom
julianwiedmann:1.16-bpf-encap-trace

Conversation

@julianwiedmann
Copy link
Copy Markdown
Member

The encap helpers were meant to abstract from differences between TC and XDP. Therefore ctx_set_encap_info() provides the ifindex for TC, and setting the ifindex also indicates that a redirect to encap interface is possible (rather than manually adding the overlay headers + FIB lookup).

The downside is that __encap_with_nodeid() for TC currently emits a trace notification without the ifindex set to ENCAP_IFINDEX.

Fix this up manually by moving the ifindex initialization up.

The encap helpers were meant to abstract from differences between TC and
XDP. Therefore ctx_set_encap_info() provides the ifindex for TC, and
setting the ifindex also indicates that a redirect to encap interface
is possible (rather than manually adding the overlay headers + FIB lookup).

The downside is that __encap_with_nodeid() for TC currently emits a trace
notification without the ifindex set to ENCAP_IFINDEX.

Fix this up manually by moving the `ifindex` initialization up.

Reported-by: Tomasz Tarczyński <tomasz.tarczynski@isovalent.com>
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. area/monitor Impacts monitoring, access logging, flow logging, visibility of datapath traffic. release-note/misc This PR makes changes that have no direct user impact. labels Jun 12, 2024
@julianwiedmann julianwiedmann requested a review from a team as a code owner June 12, 2024 07:52
@julianwiedmann julianwiedmann requested a review from ysksuzuki June 12, 2024 07:52
@julianwiedmann julianwiedmann enabled auto-merge June 12, 2024 07:58
@julianwiedmann
Copy link
Copy Markdown
Member Author

/test

@julianwiedmann julianwiedmann added this pull request to the merge queue Jun 14, 2024
@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 14, 2024
Merged via the queue into cilium:main with commit 2a0bc76 Jun 14, 2024
@julianwiedmann julianwiedmann deleted the 1.16-bpf-encap-trace branch June 14, 2024 04:29
@github-actions github-actions bot added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. and removed backport-pending/1.15 labels Jul 9, 2024
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. area/monitor Impacts monitoring, access logging, flow logging, visibility of datapath traffic. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. 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