Skip to content

SONiC Platform API - Add mgmt interface status override#654

Open
lotus-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:sonic-platform-api-add-eth0-behind
Open

SONiC Platform API - Add mgmt interface status override#654
lotus-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:sonic-platform-api-add-eth0-behind

Conversation

@lotus-nexthop
Copy link
Copy Markdown
Contributor

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.

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.

There are mainly pieces in SONiC that get negatively affected by this:

  1. ZTP thinks eth0 is up and wastes cycles attempting to communicate via eth0.
  2. SNMP will not report the correct management port link status

get_management_port_link_status_override added by this PR allows vendors to a custom way to report the management port's state.
get_management_port_link_status_override when 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_override in 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)

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
@lotus-nexthop lotus-nexthop force-pushed the sonic-platform-api-add-eth0-behind branch from c3e64f2 to e958a64 Compare April 15, 2026 05:01
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@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