Skip to content

[ZTP] Add vendor specific hook to check link state#77

Open
lotus-nexthop wants to merge 2 commits intosonic-net:masterfrom
lotus-nexthop:lotus.eth0-ztp
Open

[ZTP] Add vendor specific hook to check link state#77
lotus-nexthop wants to merge 2 commits intosonic-net:masterfrom
lotus-nexthop:lotus.eth0-ztp

Conversation

@lotus-nexthop
Copy link
Copy Markdown

@lotus-nexthop lotus-nexthop commented Apr 15, 2026

What I did
Use get_management_port_link_status_override from sonic platform API introduced by sonic-net/sonic-platform-common#654 to determine management port link status for ZTP.

Why I did it

Nexthop's platforms have an unmanaged switch sitting between the front panel rj45 and the CPU's eth0.
As a result eth0's link state as advertised by the kernel (/sys/class/net/eth0/operstate), does not reflect the state of the rj45.

e.g.

Front Panel RJ45 (Management Port)
         |
        A
         |
    BCM53134 Switch (management switch running in unmanaged mode)
       /    \
      B      C
     /        \
    BMC    CPU (eth0)

Link A may be down (if RJ45 for example is unplugged), but link C (/sys/class/net/eth0/operstate) still says up.

in this PR we avoid needlessly attempting to access eth0 (eth0 is just an example, can be any management port) in ZTP if eth0 is down on platforms where /sys/class/net/eth0/operstate link being up is not enough information to indicate management port being up.

Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown

/azp run

@lotus-nexthop lotus-nexthop marked this pull request as ready for review April 15, 2026 05:43
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants