fix u2o policy route generate too many flow tables cause oom #3099
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.
What type of this PR
Examples of user facing changes:
The steps to reproduce are as follows:
kubectl ko nbctl add Address_Set ovn.default.u2o_exclude_ip.ip4 addresses "4.4.4.4"
Then you will find that the number of openflow flow tables is increasing rapidly using command in your
ovs-ovn
pod:ovs-ofctl dump-flows br-int | grep 31000 | wc -l
Which issue(s) this PR fixes:
Fixes
when turn on the u2o switch, the policy route below will cause oom, when addresses in the address set are more than 8 , or the underlay subnet's mask length is big, it will cause the ovs to generate many OpenFlow tables.
The reason is that when ovn generates the flow table, it divides dst 192.168.0.0/16 into addresses to generate the openflow flow table. And it seems that the same address may form various rules with different masks.
WHAT
🤖 Generated by Copilot at fae7792
Simplify and lower the priority of the policy route for underlay to overlay traffic. Define and use a constant for the priority value in
subnet.go
andunderlay.go
. Update the test case inunderlay.go
to match the new policy route.🤖 Generated by Copilot at fae7792
HOW
🤖 Generated by Copilot at fae7792