Skip to content

Conversation

julianwiedmann
Copy link
Member

@julianwiedmann julianwiedmann commented Jul 4, 2024

Minor adjustments in the templating patch + resolving trivial conflicts, here is a manual backport of

Once this PR is merged, a GitHub action will update the labels of these PRs:

 33083 33085

[ upstream commit 2a0bc76 ]

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>
@maintainer-s-little-helper maintainer-s-little-helper bot added backport/1.15 This PR represents a backport for Cilium 1.15.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. labels Jul 4, 2024
@julianwiedmann
Copy link
Member Author

/test-backport-1.15

@julianwiedmann
Copy link
Member Author

/test-backport-1.15

1 similar comment
@julianwiedmann
Copy link
Member Author

/test-backport-1.15

[ upstream commit 7898d95 ]

[ backporter's notes: minor changes to config_replacement.h and
  template.go to adjust for how the templating works on v1.15 ]

Make the ifindex of an endpoint available to the attached BPF program, so
that it can be used by a subsequent patch.

We can most likely unify this later with NATIVE_DEV_IFINDEX, which is only
provided for native devices.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
[ upstream commit 3c8ff5b ]

ipv*_policy() takes an `ifindex` parameter, and exclusively uses it to
fill trace notifications. But for some cases the provided ifindex is
currently 0 (for instance in a configuration with per-EP routing, when
calling from to-container).

Just provide the actual interface index instead.

Reported-by: Tomasz Tarczyński <tomasz.tarczynski@isovalent.com>
Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
@julianwiedmann
Copy link
Member Author

/test-backport-1.15

@julianwiedmann julianwiedmann requested a review from ysksuzuki July 4, 2024 08:37
@julianwiedmann julianwiedmann marked this pull request as ready for review July 4, 2024 08:38
@julianwiedmann julianwiedmann requested a review from a team as a code owner July 4, 2024 08:38
@julianwiedmann julianwiedmann changed the title [v1.15] bpf: lxc: trace fixes [v1.15] bpf: ifindex trace fixes Jul 4, 2024
Copy link
Member

@ysksuzuki ysksuzuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@julianwiedmann julianwiedmann added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jul 9, 2024
@aditighag aditighag merged commit e1eb6df into cilium:v1.15 Jul 9, 2024
@julianwiedmann julianwiedmann deleted the v1.15-trace-fixes branch January 20, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.15 This PR represents a backport for Cilium 1.15.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants