Skip to content

Conversation

@stepanblyschak
Copy link
Contributor

@stepanblyschak stepanblyschak commented Feb 10, 2025

DEPENDS ON: sonic-net/sonic-sairedis#1509

What I did

Optimized port initialization process using the following approach:

  1. Attributes that are known at initialization (whether because their default values are defined by the SAI spec or because we created the port with a value we already know) like speed and MTU.
  2. Heavy operations like querying list of PGs and queues are done in bulk to save on SAIRedis call overhead.

Why I did it

To improve boot time for systems with many ports.

How I verified it

Ran fast-reboot and measure. Observed 45% reduction in time.

Details if related

Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@mssonicbld
Copy link
Collaborator

/azp run

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Contributor Author

Checkers will pass once sairedis builds with sonic-net/sonic-sairedis#1509.
@prsunny Could you please review and/or assign someone to review?

@stepanblyschak
Copy link
Contributor Author

/azpw run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bingwang-ms
Copy link
Contributor

@prgeor Kindly reminding on this.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Collaborator

prsunny commented Sep 25, 2025

approved for merge as this is pending for few months.

@dgsudharsan dgsudharsan merged commit 9a2c1d0 into sonic-net:master Sep 25, 2025
15 checks passed
stepanblyschak added a commit to stepanblyschak/sonic-swss that referenced this pull request Sep 27, 2025
* [portsorch] Optimize port initialization

Signed-off-by: Stepan Blyschak <[email protected]>

* Add back get when init existing ports

Signed-off-by: Stepan Blyschak <[email protected]>

* Change mock function in fake_portsorch

Signed-off-by: Stepan Blyschak <[email protected]>

* Handle comments

Signed-off-by: Stepan Blyschak <[email protected]>

* Add a comment about scheduler groups query

Signed-off-by: Stepan Blyschak <[email protected]>

* Align fake_portsorch

Signed-off-by: Stepan Blyschak <[email protected]>

* Publish host if up event

Signed-off-by: Stepan Blyschak <[email protected]>

* Remove double definition

Signed-off-by: Stepan Blyschak <[email protected]>

* fix warm boot check

Signed-off-by: Stepan Blyschak <[email protected]>

* Remove obsolete code

Signed-off-by: Stepan Blyschak <[email protected]>

* read mtu on init

Signed-off-by: Stepan Blyschak <[email protected]>

* Add comment on registerPort

Signed-off-by: Stepan Blyschak <[email protected]>

---------

Signed-off-by: Stepan Blyschak <[email protected]>
Co-authored-by: Sudharsan Dhamal Gopalarathnam <[email protected]>
Co-authored-by: Prince Sunny <[email protected]>
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* [portsorch] Optimize port initialization

Signed-off-by: Stepan Blyschak <[email protected]>

* Add back get when init existing ports

Signed-off-by: Stepan Blyschak <[email protected]>

* Change mock function in fake_portsorch

Signed-off-by: Stepan Blyschak <[email protected]>

* Handle comments

Signed-off-by: Stepan Blyschak <[email protected]>

* Add a comment about scheduler groups query

Signed-off-by: Stepan Blyschak <[email protected]>

* Align fake_portsorch

Signed-off-by: Stepan Blyschak <[email protected]>

* Publish host if up event

Signed-off-by: Stepan Blyschak <[email protected]>

* Remove double definition

Signed-off-by: Stepan Blyschak <[email protected]>

* fix warm boot check

Signed-off-by: Stepan Blyschak <[email protected]>

* Remove obsolete code

Signed-off-by: Stepan Blyschak <[email protected]>

* read mtu on init

Signed-off-by: Stepan Blyschak <[email protected]>

* Add comment on registerPort

Signed-off-by: Stepan Blyschak <[email protected]>

---------

Signed-off-by: Stepan Blyschak <[email protected]>
Co-authored-by: Sudharsan Dhamal Gopalarathnam <[email protected]>
Co-authored-by: Prince Sunny <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants