[BufferOrch] Use SAI bulk API to configure port, PG and queue#3452
Merged
prsunny merged 13 commits intosonic-net:masterfrom Feb 18, 2025
Merged
[BufferOrch] Use SAI bulk API to configure port, PG and queue#3452prsunny merged 13 commits intosonic-net:masterfrom
prsunny merged 13 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
DEL happens first, then SET. Otherwise the order in bulk SET could be different. Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
Will review shortly |
kperumalbfn
reviewed
Jan 8, 2025
| const auto tokens = tokenize(key, delimiter); | ||
| Port port; | ||
|
|
||
| for (const auto& portContext: task.ports) |
Contributor
There was a problem hiding this comment.
Any capability check to query vendor SAI's bulk API implementation?
Contributor
Author
There was a problem hiding this comment.
Not required, please check https://github.com/jianyuewu/sonic-sairedis/blob/master/syncd/Syncd.cpp#L2186
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
VS tests fail due to bulk set not supported for PGs in init view in syncd: Either need to add such support or disable bulk for systems that use init view |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
stephenxs
approved these changes
Feb 13, 2025
Contributor
|
@prsunny Could you help review & merge? Thanks |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
Cherry-pick PR to 202411: #3523 |
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…net#3452) * [BufferOrch] Use SAI bulk API to configure port, PG and queue What I did Make use of SAI set bulk API to improve switch boot up performance, especially in warm-boot and fast-boot scenarios. The general concept: First, tasks are processed one by one by corresponding process* methods which add the SAI operation with a context to a bulk buffer. Bulk buffers are split by DB operation. Bulk buffer is flushed to syncd using SAI bulk API, first DELETE operations are pushed in bulk then SET operations are pushed. Status code for each operation is updated in the task context structure. Lastly, corresponding process*Post methods are invoked to handle SAI status code and perform post set operations like enabling FC counter for a PG/queue upon success. This design allows re-use of all existing code that is written to handle one task at a time and a small change is needed to maintain task context persistence throughout steps 1-3.
baorliu
pushed a commit
to baorliu/sonic-swss
that referenced
this pull request
Feb 23, 2026
…net#3452) * [BufferOrch] Use SAI bulk API to configure port, PG and queue What I did Make use of SAI set bulk API to improve switch boot up performance, especially in warm-boot and fast-boot scenarios. The general concept: First, tasks are processed one by one by corresponding process* methods which add the SAI operation with a context to a bulk buffer. Bulk buffers are split by DB operation. Bulk buffer is flushed to syncd using SAI bulk API, first DELETE operations are pushed in bulk then SET operations are pushed. Status code for each operation is updated in the task context structure. Lastly, corresponding process*Post methods are invoked to handle SAI status code and perform post set operations like enabling FC counter for a PG/queue upon success. This design allows re-use of all existing code that is written to handle one task at a time and a small change is needed to maintain task context persistence throughout steps 1-3. Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
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.
What I did
Make use of SAI set bulk API to improve switch boot up performance, especially in warm-boot and fast-boot scenarios.
The general concept:
process*methods which add the SAI operation with a context to a bulk buffer. Bulk buffers are split by DB operation.process*Postmethods are invoked to handle SAI status code and perform post set operations like enabling FC counter for a PG/queue upon success.This design allows re-use of all existing code that is written to handle one task at a time and a small change is needed to maintain task context persistence throughout steps 1-3.
Why I did it
To improve fast-boot/warm-boot convergence time.
How I verified it
Manual verification by booting up the T0 topology configuration and running basic tests with static and dynamic buffer models. Fast-boot tested and observed ~2 times improvement in buffer configuration time on 256 port system from 3 sec to 1.7 sec when syncd falls back to single SET API. A bigger improvement is expected with proper SAI driver bulk SET support.
Details if related