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

cilium: fib lookup consolidation #23884

Merged
merged 23 commits into from Mar 3, 2023
Merged

cilium: fib lookup consolidation #23884

merged 23 commits into from Mar 3, 2023

Conversation

borkmann
Copy link
Member

@borkmann borkmann commented Feb 20, 2023

This series reworks and consolidates all fib lookups in our BPF code to utilize common functionality.

For tc BPF, this means that redirect_neigh code can be used whenever neighbors cannot be resolved. XDP utilizes the BPF neighbor map as we cannot do this ad-hoc in this layer.

This affects KPR, standalone LB, NAT46x64 GW, DSR code.

Fixes: #22782
Fixes: #22800

@borkmann borkmann 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 Feb 20, 2023
@borkmann
Copy link
Member Author

/test

@borkmann borkmann force-pushed the pr/nat46x64-batch2 branch 5 times, most recently from c908c37 to 446aa87 Compare February 20, 2023 22:55
@borkmann
Copy link
Member Author

/test

@borkmann borkmann added the release-note/major This PR introduces major new functionality to Cilium. label Feb 24, 2023
@borkmann borkmann force-pushed the pr/nat46x64-batch2 branch 3 times, most recently from b3d63f8 to 31a4262 Compare February 24, 2023 17:11
@borkmann
Copy link
Member Author

/test

@borkmann
Copy link
Member Author

borkmann commented Mar 3, 2023

(CI was all green before, squashed some of the commits. No code changes.)

@joestringer
Copy link
Member

@borkmann if this is major, can you please add a ```release-note: section to the description of the PR so that users can understand the difference this makes?

@borkmann borkmann removed backport/author The backport will be carried out by the author of the PR. needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels May 30, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed ready-to-merge This PR has passed all tests and received consensus from code owners to merge. labels May 30, 2023
@joestringer
Copy link
Member

@borkmann can you update the release note labels? This is currently marked as both major and misc. It's fixing bugs, so it seems like it's a bugfix?

borkmann added a commit that referenced this pull request Aug 22, 2023
The limitation exists mainly on old kernels where the fib lookup helper
does not populate the outgoing ifindex. Only for this case we rely on
the CT lookup stored ifindex which back then was added as a 16bit field
due to limited padding space available. Nowadays this can be lifted
after the big rework in #23884. We've seen users with high netdevice
churn run into this limitation where the agent bails out.

Apart from fixing the bleed, this can be further refined by not relying
on the asm.FnRedirectPeer helper presence but by actually doing a runtime
BPF program probe so that stable kernels can even be covered.

Fixes: #16260
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit that referenced this pull request Aug 22, 2023
The limitation exists mainly on old kernels where the fib lookup helper
does not populate the outgoing ifindex. Only for this case we rely on
the CT lookup stored ifindex which back then was added as a 16bit field
due to limited padding space available. Nowadays this can be lifted
after the big rework in #23884. We've seen users with high netdevice
churn run into this limitation where the agent bails out.

Apart from fixing the bleed, this can be further refined by not relying
on the asm.FnRedirectPeer helper presence but by actually doing a runtime
BPF program probe so that stable kernels can even be covered.

Fixes: #16260
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
derailed pushed a commit to derailed/cilium that referenced this pull request Aug 23, 2023
The limitation exists mainly on old kernels where the fib lookup helper
does not populate the outgoing ifindex. Only for this case we rely on
the CT lookup stored ifindex which back then was added as a 16bit field
due to limited padding space available. Nowadays this can be lifted
after the big rework in cilium#23884. We've seen users with high netdevice
churn run into this limitation where the agent bails out.

Apart from fixing the bleed, this can be further refined by not relying
on the asm.FnRedirectPeer helper presence but by actually doing a runtime
BPF program probe so that stable kernels can even be covered.

Fixes: cilium#16260
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit that referenced this pull request Sep 1, 2023
[ upstream commit bd8b4d0 ]
[ manual conflict resolution in kube_proxy_replacement.go
  and nodeport.h due to difference from upstream, the latter
  mainly in locations where we ifdef ct_state.ifindex ]

The limitation exists mainly on old kernels where the fib lookup helper
does not populate the outgoing ifindex. Only for this case we rely on
the CT lookup stored ifindex which back then was added as a 16bit field
due to limited padding space available. Nowadays this can be lifted
after the big rework in #23884. We've seen users with high netdevice
churn run into this limitation where the agent bails out.

Apart from fixing the bleed, this can be further refined by not relying
on the asm.FnRedirectPeer helper presence but by actually doing a runtime
BPF program probe so that stable kernels can even be covered.

Fixes: #16260
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
borkmann added a commit that referenced this pull request Sep 1, 2023
[ upstream commit bd8b4d0 ]
[ manual conflict resolution in kube_proxy_replacement.go
  and nodeport.h due to difference from upstream, the latter
  mainly in locations where we ifdef ct_state.ifindex ]

The limitation exists mainly on old kernels where the fib lookup helper
does not populate the outgoing ifindex. Only for this case we rely on
the CT lookup stored ifindex which back then was added as a 16bit field
due to limited padding space available. Nowadays this can be lifted
after the big rework in #23884. We've seen users with high netdevice
churn run into this limitation where the agent bails out.

Apart from fixing the bleed, this can be further refined by not relying
on the asm.FnRedirectPeer helper presence but by actually doing a runtime
BPF program probe so that stable kernels can even be covered.

Fixes: #16260
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
ldelossa pushed a commit to ldelossa/cilium that referenced this pull request Sep 27, 2023
[ upstream commit bd8b4d0 ]
[ manual conflict resolution in kube_proxy_replacement.go
  and nodeport.h due to difference from upstream, the latter
  mainly in locations where we ifdef ct_state.ifindex ]

The limitation exists mainly on old kernels where the fib lookup helper
does not populate the outgoing ifindex. Only for this case we rely on
the CT lookup stored ifindex which back then was added as a 16bit field
due to limited padding space available. Nowadays this can be lifted
after the big rework in cilium#23884. We've seen users with high netdevice
churn run into this limitation where the agent bails out.

Apart from fixing the bleed, this can be further refined by not relying
on the asm.FnRedirectPeer helper presence but by actually doing a runtime
BPF program probe so that stable kernels can even be covered.

Fixes: cilium#16260
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/major This PR introduces major new functionality to Cilium. 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
6 participants