Add vendor specific hook to populate management port status in STATE_DB#26790
Open
lotus-nexthop wants to merge 1 commit into
Open
Add vendor specific hook to populate management port status in STATE_DB#26790lotus-nexthop wants to merge 1 commit into
lotus-nexthop wants to merge 1 commit into
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/azpw ms_conflict |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
2a5610e to
d278e86
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
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.
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.Work item tracking
How I did it
Use
get_management_port_link_status_overridefrom sonic platform API introduced by sonic-net/sonic-platform-common#654 to populate the management port link state to STATE_DB. This will reflect the correct link state in SNMP (or any future consumers of this state).How to verify it
Note this requires sonic-net/sonic-platform-common#654 and the platform dependent implementation of it.
Now I log into management switch to bring the port down. After a minute when monit runs we see on the console:
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)