[ZTP] Add vendor specific hook to check link state#77
Open
lotus-nexthop wants to merge 2 commits intosonic-net:masterfrom
Open
[ZTP] Add vendor specific hook to check link state#77lotus-nexthop wants to merge 2 commits intosonic-net:masterfrom
lotus-nexthop wants to merge 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/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.