bpf, nodeport: source port ranges converted to runtime config#43680
Merged
bpf, nodeport: source port ranges converted to runtime config#43680
Conversation
02d3244 to
9cd26c6
Compare
Contributor
Author
|
/test |
9cd26c6 to
c4c872a
Compare
Contributor
Author
|
/test |
jrife
requested changes
Jan 13, 2026
c4c872a to
33331cb
Compare
Contributor
Author
|
/test |
ysksuzuki
reviewed
Jan 14, 2026
33 tasks
Contributor
|
Given Timo is already reviewing this, I'm taking myself of the reviewers list. |
jrife
approved these changes
Jan 20, 2026
Contributor
jrife
left a comment
There was a problem hiding this comment.
LGTM for datapath. Let's just figure out the answer to how to reuse the same default port values across test files.
33331cb to
95bf21b
Compare
Contributor
Author
|
/test |
4067771 to
9e0588c
Compare
Contributor
Author
|
/test |
ti-mo
reviewed
Jan 29, 2026
9e0588c to
5478682
Compare
Contributor
Author
|
/test |
b98008d to
24329aa
Compare
Contributor
Author
|
/test |
665f6f1 to
1a7d57a
Compare
Contributor
Author
|
/test |
1a7d57a to
a7b1dfb
Compare
Contributor
Author
|
/test |
ti-mo
reviewed
Feb 4, 2026
This commit moves NodePort and NodePort NAT port ranges into the node configuration, so BPF programs consume CONFIG(nodeport_port_*) values rather than fixed macros. The Go datapath now populates these fields from the LB config when KPR or BPF masquerade is enabled, and the old headerfile defines in the Linux config writer are dropped. Updates included: - BPF datapath and NAT logic switched to CONFIG(nodeport_port_min/max/min_nat/max_nat), with defaults and overrides in bpf/include/bpf/config/node.h. - Tests adjusted to use config-driven ranges (including deterministic overrides) and refreshed wildcard lookup helpers. - NodePortMaxNAT constant moved to pkg/datapath/config, and NAT stats import updated accordingly. Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
This change removes hardcoded NodePort port default assignments from bpf/include/bpf/config/node.h and moves test-only defaults into a shared helper used by BPF tests. The Go datapath node config now initializes port range fields to zero, letting runtime config supply values. Updates included: - New bpf/tests/test_helpers.h with ASSIGN_NODEPORT_DEFAULTS() to set NodePort/NAT port ranges for deterministic source port selection. - BPF tests now include test_helpers.h and call the helper instead of relying on node.h defaults or per-test overrides. Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
It removes the guard that only populated node.NodeportPortMin/Max and the NAT NodePort range when kube-proxy replacement or BPF masquerade was enabled. Now those fields are always set from lnc.LBConfig, ensuring consistent initialization regardless of KPR or masquerade settings. Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
The commit replaces nodeport_port_min_nat/max_nat config fields with BPF macros and updates all NAT target uses in BPF programs/tests to use NODEPORT_PORT_*_NAT macros. Test defaults simplified. Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
a7b1dfb to
c52d29d
Compare
Contributor
Author
|
/test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit moves NodePort and NodePort NAT port ranges into the node configuration, so BPF programs consume CONFIG(nodeport_port_*) values rather than fixed macros.
The Go datapath now populates these fields from the LB config when KPR or BPF masquerade is enabled, and the old headerfile defines in the Linux config writer are dropped.
Updates included:
Related: #38370