SONiC Platform API - Add mgmt interface status override#654
Open
lotus-nexthop wants to merge 1 commit into
Open
SONiC Platform API - Add mgmt interface status override#654lotus-nexthop wants to merge 1 commit into
lotus-nexthop wants to merge 1 commit into
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
c3e64f2 to
e958a64
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
8 tasks
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.
Description
Add a way for vendors to provide an override to a management port's link status.
Motivation and Context
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.There are mainly pieces in SONiC that get negatively affected by this:
get_management_port_link_status_overrideadded by this PR allows vendors to a custom way to report the management port's state.get_management_port_link_status_overridewhen implemented is meant to take precedent over the kernel's advertisement of eth0's link state in/sys/class/net/eth0/operstate.In the near term,
get_management_port_link_status_overridein the following two places. In the future there can be more use cases.https://github.com/sonic-net/sonic-buildimage/blob/d0bcc88756b38a7287aaa67a785bba73194d2a01/files/image_config/monit/mgmt_oper_status.py#L41-L42
https://github.com/sonic-net/sonic-ztp/blob/c84b50a36ec02451a9fb691a7ff4de310046b9f2/src/usr/lib/ztp/ztp-engine.py#L159-L162
How Has This Been Tested?
Additional Information (Optional)