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

add native tunnel encapsulation support for the XDP Loadbalancer #24422

Merged
merged 11 commits into from May 31, 2023

Conversation

julianwiedmann
Copy link
Member

@julianwiedmann julianwiedmann commented Mar 17, 2023

#21364 added support for combining XDP with tunnel-routing. This was done through a fallback mechanism, where we would (1) punt packets from XDP up to the from-netdev TC program, and (2) redirect them to cilium_vxlan / cilium_geneve as usual.

Besides the performance implications of the additional hop through the TC path, this also meant that #23890 later couldn't add support for IPv6 traffic with DSR-GENEVE using XDP (as there was no easy way of transporting the IPv6 DSR information from XDP all the way to the TC encap path).

This PR introduces native XDP support for adding VXLAN / GENEVE tunnel headers to a packet, and thus avoids the detour through the TC path.

open aspects

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 17, 2023
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

Note that if we want to use the IPV4_DIRECT_ROUTING as outerSrcIP, then we need something like #22738 to have it defined in combination with tunnel-mode ...

@julianwiedmann julianwiedmann added the release-note/minor This PR changes functionality that users may find relevant to operating Cilium. label Mar 20, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Mar 20, 2023
@julianwiedmann julianwiedmann added the sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. label Mar 20, 2023
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann force-pushed the 1.14-xdp-geneve branch 4 times, most recently from 318eafe to 6e86902 Compare May 11, 2023 08:58
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann added kind/feature This introduces new functionality. feature/ipv6 Relates to IPv6 protocol support labels May 12, 2023
@julianwiedmann julianwiedmann force-pushed the 1.14-xdp-geneve branch 2 times, most recently from b6e66e6 to 922a055 Compare May 12, 2023 14:09
@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann
Copy link
Member Author

/test

@julianwiedmann julianwiedmann changed the title WIP xdp add encapsulation support for XDP program May 17, 2023
When the XDP nodeport code requires tunnel encapsulation, we currently push
the packet up to the from-netdev TC program (with XFER_PKT_ENCAP set) and
let it handle the tunnel redirect.

Replace this with an in-XDP implementation that adds the outer headers
for VXLAN or GENEVE. This path now also returns CTX_ACT_REDIRECT, but in
contrast to the skb implementation it doesn't set the `ifindex`. We handle
this case in the relevant nodeport paths, and fall back to an IPv4 FIB
lookup for the outer packet.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Now that we have XDP support for adding tunnel headers, nothing sets
XFER_PKT_ENCAP anymore. Remove all the relevant code and parameters.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Configs with DSR-GENEVE will always use a GENEVE tunnel. So make it
possible to override the default (VXLAN), and use the correct macro for
the complexity tests.

This codepath is slightly more complex (it needs to handle GENEVE options),
so ensure that we cover it in the tests.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Cover both VXLAN and GENEVE in the XDP compile tests. And add some
additional complexity configs for XDP that cover tunnel-routing.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
With the in-XDP encap support, the IPv6 path should now also work.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
With in-XDP encap support, this no longer applies.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
@julianwiedmann
Copy link
Member Author

/ci-e2e

@julianwiedmann
Copy link
Member Author

/test

Copy link
Contributor

@rgo3 rgo3 left a comment

Choose a reason for hiding this comment

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

LGTM for loader related changes.

@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 May 31, 2023
@julianwiedmann julianwiedmann merged commit 2a966f4 into cilium:main May 31, 2023
62 checks passed
@julianwiedmann julianwiedmann deleted the 1.14-xdp-geneve branch May 31, 2023 12:41
julianwiedmann added a commit to julianwiedmann/cilium that referenced this pull request Jul 26, 2023
We recently added support for in-XDP tunnel encapsulation with
cilium#24422. Thus the performance concerns
(packets needing to bounce through TC for encapsulation) no longer apply.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
qmonnet pushed a commit that referenced this pull request Jul 27, 2023
We recently added support for in-XDP tunnel encapsulation with
#24422. Thus the performance concerns
(packets needing to bounce through TC for encapsulation) no longer apply.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
sayboras pushed a commit to sayboras/cilium that referenced this pull request Jul 31, 2023
[ upstream commit 8a811cb ]

We recently added support for in-XDP tunnel encapsulation with
cilium#24422. Thus the performance concerns
(packets needing to bounce through TC for encapsulation) no longer apply.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Signed-off-by: Tam Mach <tam.mach@cilium.io>
dylandreimerink pushed a commit that referenced this pull request Aug 2, 2023
[ upstream commit 8a811cb ]

We recently added support for in-XDP tunnel encapsulation with
#24422. Thus the performance concerns
(packets needing to bounce through TC for encapsulation) no longer apply.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Signed-off-by: Tam Mach <tam.mach@cilium.io>
julianwiedmann added a commit to julianwiedmann/cilium that referenced this pull request Aug 4, 2023
These were used to transfer encap information from XDP to TC. They are no
longer used since cilium#24422 added support
for in-XDP tunnel encapsulation.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
julianwiedmann added a commit that referenced this pull request Aug 5, 2023
These were used to transfer encap information from XDP to TC. They are no
longer used since #24422 added support
for in-XDP tunnel encapsulation.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/ipv6 Relates to IPv6 protocol support kind/feature This introduces new functionality. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-blocker/1.14 This issue will prevent the release of the next version of Cilium. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants