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: gate egressgw datapath on separate defines #27189

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

lmb
Copy link
Contributor

@lmb lmb commented Aug 1, 2023

bpf: gate egressgw datapath on separate defines

Add a new define ENABLE_EGRESS_GATEWAY_COMMON which enables the common
egress gateway code. The existing ENABLE_EGRESS_GATEWAY flag now controls
whether to check for egress gateway policies with static gateway IPs. This
makes it easier to extend the codebase to with alternative implementations.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

bpf: move CT checks into egress_gw_request_needs_redirect

Move the CT reply check into egress_gw_request_needs_redirect so that
alternative implementations can have their own CT state handling.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>

@lmb lmb added release-note/minor This PR changes functionality that users may find relevant to operating Cilium. feature/egress-gateway Impacts the egress IP gateway feature. area/modularization labels Aug 1, 2023
@lmb lmb force-pushed the egw-datapath-split-defines branch from 429ff49 to 25b714e Compare August 1, 2023 14:10
@lmb
Copy link
Contributor Author

lmb commented Aug 1, 2023

/test

@lmb
Copy link
Contributor Author

lmb commented Aug 1, 2023

Needs a rebase on top of #26952 since that already moves the code to a separate file.

@lmb lmb force-pushed the egw-datapath-split-defines branch from 25b714e to f5428dd Compare August 2, 2023 08:57
@lmb
Copy link
Contributor Author

lmb commented Aug 2, 2023

/test

@lmb lmb marked this pull request as ready for review August 2, 2023 08:57
@lmb lmb requested review from a team as code owners August 2, 2023 08:57
@lmb lmb requested a review from jibi August 2, 2023 08:57
@lmb lmb force-pushed the egw-datapath-split-defines branch from f5428dd to 12342bc Compare August 2, 2023 09:38
@lmb
Copy link
Contributor Author

lmb commented Aug 2, 2023

/test

Add a new define ENABLE_EGRESS_GATEWAY_COMMON which enables the
common egress gateway code. The existing ENABLE_EGRESS_GATEWAY
flag now controls whether to check for egress gateway policies
with static gateway IPs. This makes it easier to extend the
codebase to with alternative implementations.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@lmb lmb force-pushed the egw-datapath-split-defines branch from 12342bc to f957feb Compare August 2, 2023 10:20
@lmb
Copy link
Contributor Author

lmb commented Aug 2, 2023

/test

1 similar comment
@lmb
Copy link
Contributor Author

lmb commented Aug 2, 2023

/test

Move the CT reply check into egress_gw_request_needs_redirect so
that alternative implementations can have their own CT
state handling.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@lmb lmb force-pushed the egw-datapath-split-defines branch from b3db2e3 to b32476d Compare August 2, 2023 11:00
Copy link
Member

@jibi jibi left a comment

Choose a reason for hiding this comment

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

LGTM! just a non blocking nit

@@ -1065,7 +1065,7 @@ static __always_inline int handle_ipv4_from_lxc(struct __ctx_buff *ctx, __u32 *d
}
}

#ifdef ENABLE_EGRESS_GATEWAY
#ifdef ENABLE_EGRESS_GATEWAY_COMMON
Copy link
Member

Choose a reason for hiding this comment

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

nit: let's just switch all of them to #if defined()?

#define ENABLE_EGRESS_GATEWAY_COMMON
#endif

#ifdef ENABLE_EGRESS_GATEWAY_COMMON
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@lmb
Copy link
Contributor Author

lmb commented Aug 2, 2023

/test

@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 Aug 2, 2023
@lmb lmb merged commit 475f5c1 into cilium:main Aug 2, 2023
58 of 59 checks passed
@lmb lmb deleted the egw-datapath-split-defines branch August 2, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/modularization feature/egress-gateway Impacts the egress IP gateway feature. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants