Skip to content

Conversation

julianwiedmann
Copy link
Member

@julianwiedmann julianwiedmann commented Jun 12, 2024

Insert the ifindex of an endpoint into the bpf_lxc program, so that we can use it for trace notifications.

@julianwiedmann julianwiedmann added area/loader Impacts the loading of BPF programs into the kernel. 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
Copy link
Member Author

/test

@julianwiedmann julianwiedmann force-pushed the 1.16-bpf-lxc-trace branch 2 times, most recently from 86ba0c5 to fe8684b Compare June 12, 2024 08:44
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

/ci-runtime

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann changed the title 1.16 bpf lxc trace bpf: lxc: fix ifindex in TO_ENDPOINT trace notification Jun 12, 2024
@julianwiedmann julianwiedmann added the dont-merge/preview-only Only for preview or testing, don't merge it. label Jun 12, 2024
@julianwiedmann julianwiedmann marked this pull request as ready for review June 12, 2024 17:31
@julianwiedmann julianwiedmann requested review from a team as code owners June 12, 2024 17:31
@julianwiedmann
Copy link
Member Author

Mind you that I have little clue about all the templating dance in the loader. So this might be totally bogus :).

@julianwiedmann
Copy link
Member Author

/test

Copy link
Contributor

@lmb lmb 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 removed the dont-merge/preview-only Only for preview or testing, don't merge it. label Jun 14, 2024
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

(quick rebase to pick up healthy CI)

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>
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

@julianwiedmann
Copy link
Member Author

(and one more to resolve a conflict in bpf_lxc)

@julianwiedmann julianwiedmann enabled auto-merge June 14, 2024 14:10
@ysksuzuki
Copy link
Member

We don't need to pass CB_IFINDEX from l3_local_delivery anymore with this PR?

ctx_store_meta(ctx, CB_IFINDEX, ep->ifindex);

@julianwiedmann julianwiedmann added this pull request to the merge queue Jun 19, 2024
Merged via the queue into cilium:main with commit 3c8ff5b Jun 19, 2024
@julianwiedmann julianwiedmann deleted the 1.16-bpf-lxc-trace branch June 19, 2024 08:23
@julianwiedmann
Copy link
Member Author

We don't need to pass CB_IFINDEX from l3_local_delivery anymore with this PR?

ctx_store_meta(ctx, CB_IFINDEX, ep->ifindex);

I think we still need it to indicate whether the redirect should happen. But ack, it can be a boolean flag now.

@julianwiedmann
Copy link
Member Author

We don't need to pass CB_IFINDEX from l3_local_delivery anymore with this PR?

ctx_store_meta(ctx, CB_IFINDEX, ep->ifindex);

I think we still need it to indicate whether the redirect should happen. But ack, it can be a boolean flag now.

Addressed here: #33524

@julianwiedmann julianwiedmann added the backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. label Jul 4, 2024
@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 The backport for Cilium 1.15.x for this PR is in progress. 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/loader Impacts the loading of BPF programs into the kernel. 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. 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.

5 participants