Skip to content

[action] [PR:21055] Optimize check_interface_status function.#819

Merged
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/21055
Nov 7, 2025
Merged

[action] [PR:21055] Optimize check_interface_status function.#819
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/21055

Conversation

@mssonicbld
Copy link
Collaborator

Description of PR

Optimize check_interface_status function.

Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • [X ] Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

What is the motivation for this PR?

As the number of ports increases, the function slows down and may fail the test because not all interfaces up in time.

How did you do it?

Add cache to get_ports_map.
Call transceiver presence once for all ports together.

How did you verify/test it?

measure the new time and rerun the test.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
Optimize check_interface_status function.

Add cache to get_ports_map.
Call transceiver presence once for all ports together.
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:
Fixes # (issue)

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [X ] Test case improvement

### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505

### Approach
#### What is the motivation for this PR?
As the number of ports increases, the function slows down and may fail the test because not all interfaces up in time.

#### How did you do it?
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

#### How did you verify/test it?
measure the new time and rerun the test.

#### Any platform specific information?

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
@mssonicbld
Copy link
Collaborator Author

Original PR: sonic-net/sonic-mgmt#21055

@mssonicbld
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 5edbaf5 into Azure:202412 Nov 7, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant