Skip to content

Optimize check_interface_status function.#21055

Merged
roy-sror merged 1 commit intosonic-net:masterfrom
OriTrabelsi:config_reload_opt
Nov 4, 2025
Merged

Optimize check_interface_status function.#21055
roy-sror merged 1 commit intosonic-net:masterfrom
OriTrabelsi:config_reload_opt

Conversation

@OriTrabelsi
Copy link
Contributor

@OriTrabelsi OriTrabelsi commented Oct 22, 2025

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

@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).

Add cache to get_ports_map.
Call transceiver presence once for all ports together.
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-mgmt.msft#819

dcaugher pushed a commit to dcaugher/sonic-mgmt that referenced this pull request Nov 12, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.
dcaugher pushed a commit to dcaugher/sonic-mgmt that referenced this pull request Nov 12, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.
vikumarks pushed a commit to vikumarks/sonic-mgmt that referenced this pull request Dec 1, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: vikumarks <[email protected]>
albertovillarreal-keys pushed a commit to albertovillarreal-keys/sonic-mgmt that referenced this pull request Dec 2, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Alberto Villarreal <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: opcoder0 <[email protected]>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Dec 11, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: selldinesh <[email protected]>
echuawu pushed a commit to echuawu/sonic-mgmt that referenced this pull request Dec 12, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.
saravanan-nexthop pushed a commit to saravanan-nexthop/sonic-mgmt that referenced this pull request Dec 15, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Saravanan <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Guy Shemesh <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Aharon Malkin <[email protected]>
deerao02 pushed a commit to deerao02/sonic-mgmt that referenced this pull request Dec 18, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.
deerao02 pushed a commit to deerao02/sonic-mgmt that referenced this pull request Dec 18, 2025
…t#820)

Add cache to get_ports_map.
Call transceiver presence once for all ports together.
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Guy Shemesh <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.
yifan-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Jan 14, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: YiFan Wang <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Guy Shemesh <[email protected]>
lakshmi-nexthop pushed a commit to lakshmi-nexthop/sonic-mgmt that referenced this pull request Jan 28, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Lakshmi Yarramaneni <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Jan 29, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Yael Tzur <[email protected]>
abhishek-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Feb 6, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Feb 13, 2026
Add cache to get_ports_map.
Call transceiver presence once for all ports together.

Signed-off-by: Raghavendran Ramanathan <[email protected]>
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.

5 participants