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

bpf: l4lb: fix IPIP health-check path #27015

Merged

Conversation

julianwiedmann
Copy link
Member

@julianwiedmann julianwiedmann commented Jul 24, 2023

If handle_nat_fwd() expands into a tail-call (eg. because both ENABLE_IPV4 and ENABLE_IPV6 are set), control doesn't return to the main to-netdev program. Thus the packet path never passes through the L4LB health-check processing.

This is a regression caused by 54a8631 - previously, we would skip the NAT check in a full-DSR config (and the L4LB IPIP mode is always full-DSR).

Fix it by pulling the health-check section up, so that it gets applied before walking down the NAT path. Also add a minimal integration test to cover the expected encapsulation behaviour.

Fixes: 54a8631 ("bpf: nodeport: handle revDNAT for local backends at to-netdev/to-overlay")

Fix a bug that affected the health-check feature in Stand-alone L4LB mode. For certain configurations (eg if both IPv4 and IPv6 support is enabled) health-check traffic would not get IPIP-encapsulated.

@julianwiedmann julianwiedmann added kind/bug This is a bug in the Cilium logic. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/bug This PR fixes an issue in a previous release of Cilium. kind/regression This functionality worked fine before, but was broken in a newer release of Cilium. needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch area/loadbalancing Impacts load-balancing and Kubernetes service implementations needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Jul 24, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.14.0 Jul 24, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.13.5 Jul 24, 2023
@julianwiedmann julianwiedmann force-pushed the 1.15-bpf-l4lb-ipip-health-check branch 2 times, most recently from 9edf7f0 to 83f009e Compare July 24, 2023 11:31
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann marked this pull request as ready for review July 24, 2023 13:06
@julianwiedmann julianwiedmann requested review from a team as code owners July 24, 2023 13:06
Copy link
Contributor

@viktor-kurchenko viktor-kurchenko 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 force-pushed the 1.15-bpf-l4lb-ipip-health-check branch from 83f009e to 15d1712 Compare July 26, 2023 05:40
@julianwiedmann
Copy link
Member Author

/test

@aanm aanm added this to Needs backport from main in 1.14.1 Jul 26, 2023
@aanm aanm removed this from Needs backport from main in 1.14.0 Jul 26, 2023
@gentoo-root gentoo-root added this to Needs backport from main in 1.13.6 Jul 26, 2023
@gentoo-root gentoo-root removed this from Needs backport from main in 1.13.5 Jul 26, 2023
If handle_nat_fwd() expands into a tail-call (eg. because both ENABLE_IPV4
and ENABLE_IPV6 are set), control doesn't return to the main to-netdev
program. Thus the packet path never passes through the L4LB health-check
processing.

This is a regression caused by 54a8631 - previously, we would skip
the NAT check in a full-DSR config (and the L4LB IPIP mode is always
full-DSR).

Fix it by pulling the health-check section up, so that it gets applied
before walking down the NAT path. Also add a minimal integration test to
cover the expected encapsulation behaviour.

Fixes: 54a8631 ("bpf: nodeport: handle revDNAT for local backends at to-netdev/to-overlay")
Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
@julianwiedmann julianwiedmann force-pushed the 1.15-bpf-l4lb-ipip-health-check branch from 15d1712 to 45ed4ee Compare July 27, 2023 11:19
@julianwiedmann
Copy link
Member Author

tiny update to the test, to bring it more in-line with how the feature works

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

For some context: #14610

Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

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

Changes LGTM.

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jul 28, 2023
@dylandreimerink dylandreimerink merged commit ebdfb37 into cilium:main Jul 28, 2023
58 checks passed
@julianwiedmann julianwiedmann deleted the 1.15-bpf-l4lb-ipip-health-check branch July 28, 2023 15:15
@sayboras sayboras mentioned this pull request Jul 31, 2023
6 tasks
@sayboras sayboras added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Jul 31, 2023
@sayboras sayboras mentioned this pull request Jul 31, 2023
3 tasks
@sayboras sayboras added backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. and removed needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels Jul 31, 2023
@sayboras sayboras mentioned this pull request Aug 1, 2023
6 tasks
@sayboras sayboras added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. labels Aug 3, 2023
@nebril nebril moved this from Needs backport from main to Backport done to v1.13 in 1.13.6 Aug 10, 2023
@nebril nebril moved this from Needs backport from main to Backport done to v1.14 in 1.14.1 Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/loadbalancing Impacts load-balancing and Kubernetes service implementations backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. kind/bug This is a bug in the Cilium logic. kind/regression This functionality worked fine before, but was broken in a newer release of Cilium. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
No open projects
1.13.6
Backport done to v1.13
1.14.1
Backport done to v1.14
Development

Successfully merging this pull request may close these issues.

None yet

5 participants