[ZTP] Add vendor specific hook to check link state - #77
Open
lotus-nexthop wants to merge 2 commits into
Open
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
lotus-nexthop
marked this pull request as ready for review
April 15, 2026 05:43
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
|
||
| @return 'up' if the platform reports link up; | ||
| 'down' if the platform reports link down; | ||
| None if the platform does not override or on error. |
There was a problem hiding this comment.
Could we document the API contract that None means no override and ZTP should fallback to kernel link state? This helps platform implementers avoid confusing False with unsupported state.
Author
There was a problem hiding this comment.
Thanks @lucas-li-micas, I updated the doc string to be more clear, please take a look.
I also updated the doc string in sonic-net/sonic-platform-common#654 to be more specific.
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
lotus-nexthop
force-pushed
the
lotus.eth0-ztp
branch
from
July 22, 2026 20:52
dd3222c to
1d9924c
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
lotus-nexthop
force-pushed
the
lotus.eth0-ztp
branch
from
July 22, 2026 20:55
1d9924c to
64904cd
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
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
Use
get_management_port_link_status_overridefrom 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.
Link
Amay be down (if RJ45 for example is unplugged), but linkC(/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/operstatelink being up is not enough information to indicate management port being up.