[202503] add batch_mode support for bind_fp_ports and unbind_fp_ports (#18790)#417
Merged
bingwang-ms merged 1 commit intoAzure:202503from Jun 19, 2025
Merged
Conversation
Signed-off-by: Austin Pham <austinpham@microsoft.com> adjust logic Signed-off-by: Austin Pham <austinpham@microsoft.com> chore: set batchmode Signed-off-by: Austin Pham <austinpham@microsoft.com> add support for python2 Signed-off-by: Austin Pham <austinpham@microsoft.com> fix python2 Signed-off-by: Austin Pham <austinpham@microsoft.com>
Merged
11 tasks
bingwang-ms
approved these changes
Jun 19, 2025
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.
Cherry-pick sonic-net/sonic-mgmt#18790
Description of PR
Summary: This PR add option to use batch_mode support for bind_fp_ports. Which improves the speed by 50% tested on 128 VM neighbor.
Fixes # (issue) 32654908
Type of change
Back port request
Approach
What is the motivation for this PR?
When doing ovs flow creation, we're launching subprocess and waiting for each subprocess result before continue with the next call. This process is very inefficient even with the aid of multi-threading support.
How did you do it?
This PR change the behavior of multi-threading in the following way:
ovs-ofctlon the file using add-flows, put the process into queue for wait later and free the thread so that the same thread can be use to launch a different batchThis PR also provide an options to opt in this feature
How did you verify/test it?
Verified on physical testbed with 128 VMs. Time deduction for the same settings of 8 Threads is reduced from 1 hour 30 minutes to 45 minutes average.
The following is a sample of the same settings, same number of threads, with batch_mode enabled on renumber topology and unbind topology.
We can see the majority of benefit in Renumber topology by batch the bind_fp_ports.
Before
After
Other topology
The only affected functionality are
renumber topologyandunbind topologyAny platform specific information?
Supported testbed topology if it's a new test case?
Documentation