-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Fix 16bit ifindex limitation #27622
Conversation
5b21092
to
41d3573
Compare
/test |
note that you will need a rebase for picking up #27592 to fix CI |
41d3573
to
a5085fe
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you! Needs just one small change I think (see review below).
As follow-on, let's also add HAVE_FIB_IFINDEX
to the relevant complexity tests to reflect the real world.
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.
We can further also check for ENABLE_SKIP_FIB
.
ah, maybe not 🤔 . That's a runtime thing - so if one changes their config to remove |
Ah yes, I'll add it. |
Yeah, I'd avoid combining the two. |
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>
Commit d1c362e1dd68 ("bpf: Always return target ifindex in bpf_fib_lookup") which HAVE_FIB_IFINDEX reflects is part of is 5.10+ kernels. Add the define to the complexity tests for 5.10 and net-next to better reflect real world. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
4181f78
to
961afe4
Compare
/test |
(checkpatch complaint unrelated given this refers to kernel commit not cilium one) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, ty!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@borkmann I've tried to backport this PR to |
Yep will try to get it done this week. |
v1.14 backport makes sense, does this also affect older releases? |
It does, there it would have to be even more custom patch for older stable releases given they don't have #23884 (only 1.14). If I find some cycles, I could take a look. |
FYI, I opened #27642 to cover the fine-tuning of the feature probe. |
See details in commit desc.
Fixes: #16260