-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BPF] always use bpf_redir_neigh after FIB lookup #9423
base: master
Are you sure you want to change the base?
[BPF] always use bpf_redir_neigh after FIB lookup #9423
Conversation
6e4a1ad
to
8e4dfd2
Compare
d285d3d
to
2f15c59
Compare
There is not need to copy and fill in the mac addresses, bpf_redir_neigh will do that for us.
Going forward, we will maintain co-re and will eventually deprecate and remove the legacy one. That will get us back to a single fib.h.
bpf_redir_neigh will do it
bpf_redirect_neigh() will do it.
When redirecting to a workload when NAt is required, usually from HEP because of node port, us the destination IP as the next hop in bpf_redir_neigh() to avoid FIB lookup.
e71b383
to
6375338
Compare
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.
Few small nits but great to see the code getting modernised!
There's still quite a lot of shared logic between the two fib impls (I diffed them locally to get a better feel for it) but happy to go with your judgement on the split. Not like we can't roll it back if we find the duplication awkward.
state->ct_result.ifindex_fwd); | ||
goto no_fib_redirect; | ||
} | ||
CALI_DEBUG("Fall through to redirct without fib lookupi rc %d", rc); |
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.
Typos
case 0: | ||
case BPF_FIB_LKUP_RET_NO_NEIGH: | ||
#ifdef IPVER6 | ||
CALI_DEBUG("FIB lookup succeeded - gw"); |
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.
Could use IP_FMT
?
@@ -53,6 +53,8 @@ struct calico_ct_leg { | |||
|
|||
__u32 opener:1; | |||
|
|||
__u32 workload:1; |
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.
Can imagine forgetting that this means "the source of this leg is a local workload iface" at some point. Worth a comment just to make ti really clear?
Description
Related issues/PRs
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.