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

[v1.15] bpf: avoid SNAT tracking for overlay traffic #31785

Merged
merged 6 commits into from Apr 10, 2024

Conversation

julianwiedmann
Copy link
Member

@julianwiedmann julianwiedmann commented Apr 5, 2024

Manual backport of

Once this PR is merged, a GitHub action will update the labels of these PRs:

 31737 31082 31818

@maintainer-s-little-helper maintainer-s-little-helper bot added backport/1.15 This PR represents a backport for Cilium 1.15.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. labels Apr 5, 2024
@julianwiedmann
Copy link
Member Author

/test-backport-1.15

@julianwiedmann julianwiedmann marked this pull request as ready for review April 5, 2024 09:00
@julianwiedmann julianwiedmann requested a review from a team as a code owner April 5, 2024 09:00
@julianwiedmann julianwiedmann added the dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs label Apr 8, 2024
[ upstream commit 3e32efc ]

This is an internal macro that's selected by common.h (based on
TUNNEL_MODE and a few other config options). There should be no need to
explicitly set it.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
[ upstream commit 5b37dc9 ]

When a packet gets SNATed in to-overlay, there is no point in setting the
SNAT-done mark. Firstly the mark refers to the *inner* packet, but all
subsequent users will only see the outer headers. Also our own netfilter
rules installed by installHostTrafficMarkRule() currently clear the mark
for overlay traffic.

Free up the mark for future usage.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
[ upstream commit 2860ded ]

To make smarter decisions at the native-device level (in to-netdev), mark
traffic that is created by cilium's overlay interface.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
[ upstream commit 7c789e5 ]

Creating SNAT entries for our own overlay traffic makes little sense. In
particular as the replies will not be addressed to the egressing packet's
source port, but to TUNNEL_PORT.

Avoiding such SNAT tracking reduces the pressure on the CT and NAT maps.

Fixes: cilium#26908
Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
[ upstream commit b523a92 ]

Prior to 2860ded ("datapath: mark to-overlay traffic"), overlay
traffic would reach the HostFW egress path in to-netdev with
MARK_MAGIC_HOST set. Restore this behaviour by also assigning HOST_ID for
traffic that has MARK_MAGIC_OVERLAY set.

Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
[ upstream commit 8984c20 ]

As we now have a mark-derived src_sec_identity available, we might as well
share this bit of information with the user.

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

/test-backport-1.15

@julianwiedmann julianwiedmann added ready-to-merge This PR has passed all tests and received consensus from code owners to merge. and removed dont-merge/wait-until-release Freeze window for current release is blocking non-bugfix PRs labels Apr 10, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Apr 10, 2024
@julianwiedmann julianwiedmann added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Apr 10, 2024
@lmb lmb merged commit 848f4f1 into cilium:v1.15 Apr 10, 2024
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.15 This PR represents a backport for Cilium 1.15.x of a PR that was merged to main. kind/backports This PR provides functionality previously merged into master. ready-to-merge This PR has passed all tests and received consensus from code owners to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants