-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[BPF/SNAT] Improve code readability and complexity of the datapath #19712
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
Conversation
This is currently only addressing IPv4. I would appreciate comments before starting working on IPv6. Thanks a lot. |
This comment was marked as outdated.
This comment was marked as outdated.
Looks like the complexity increased |
My change here which does factor the code of [0] https://jenkins.cilium.io/job/Cilium-PR-K8s-1.22-kernel-4.19/1293/consoleText |
This comment was marked as outdated.
This comment was marked as outdated.
be815d5
to
0da1989
Compare
This comment was marked as outdated.
This comment was marked as outdated.
@brb Hello, the verifier does not look to have appreciated the split here: I have isolated the commit
Then ran verifier locally
Any idea? |
My feeling is that, we are using |
This comment was marked as outdated.
This comment was marked as outdated.
Without seeing the full verifier log it's difficult to answer. Anyway, my idea was to get rid of |
/test Job 'Cilium-PR-K8s-1.23-kernel-5.4' failed: Click to show.Test Name
Failure Output
If it is a flake and a GitHub issue doesn't already exist to track it, comment |
This comment was marked as outdated.
This comment was marked as outdated.
/test |
This split snat_v4_process() to introduce two functions: snat_v4_nat() and snat_v4_rev_nat(). This does not change logic, it is expected to reduce verifier complexity and improve code maintenability. Fixes: cilium#19660 Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
This split snat_v6_process() to introduce two functions: snat_v6_nat() and snat_v6_rev_nat(). This does not change logic, it is expected to reduce verifier complexity and improve code maintenability. Fixes: cilium#19660 Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
In this desire of continuing improving code quality and verifier complexity. This patch is splitting snat_v*_can_skip into two functions. Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
In this desire of continuing improving code quality and verifier complexity. This patch is splitting snat_v*_handle_mapping into two functions. Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
This is introducting and using snat_v*_init_tuple() to set initial values for the ct tuple. Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
It's redondante variable that does not look to bring any value. Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
/test |
This is addressing issue #19660.
Fixes: #19660