Skip to content

Conversation

@YairRaviv
Copy link
Contributor

@YairRaviv YairRaviv commented Dec 7, 2025

What I did

Added a new Mellanox CLI: show platform mlnx mpo-status that prints the Interfaces → MPO mapping for CPO ports, including per-port oper status.

How I did it

Single-ASIC:

  • Read PORT from CONFIG_DB, filter CPO ports.
  • For each CPO port, parse lanes and map lane ln to MPO floor(ln/4)+1 and Lane column (ln%4).
  • Fetch oper_status from APPL_DB and print as EthernetX(UP|DOWN).

Multi-ASIC:

  • For each ASIC namespace, read PORT from CONFIG_DB, filter the CPO ports, and fetch oper_status from APPL_DB.
  • Compose MPO rows by index: MPO m uses the m-th CPO port from each ASIC in order (Lane1=asic0, Lane2=asic1, Lane3=asic2, Lane4=asic3).
  • Print EthernetX/asicN(UP|DOWN).

How to verify it

By running "show platform mlnx mpo-status" command

New command output (if the output of a command-line utility has changed)

show platform mlnx mpo-status
Single-ASIC:

+-------+-----------------+-----------------+-----------------+-----------------+
|   MPO | Lane 1          | Lane 2          | Lane 3          | Lane 4          |
+=======+=================+=================+=================+=================+
|     1 | Ethernet0(UP)   | Ethernet0(UP)   | Ethernet0(UP)   | Ethernet0(UP)   |
|     2 | Ethernet4(UP)   | Ethernet4(UP)   | Ethernet4(UP)   | Ethernet4(UP)   |
|     3 | Ethernet8(UP)   | Ethernet8(UP)   | Ethernet8(UP)   | Ethernet8(UP)   |
...
|   127 | Ethernet504(UP) | Ethernet504(UP) | Ethernet504(UP) | Ethernet504(UP) |
|   128 | Ethernet508(UP) | Ethernet508(UP) | Ethernet508(UP) | Ethernet508(UP) |
+-------+-----------------+-----------------+-----------------+-----------------+

Multi-ASIC:

show platform mlnx mpo-status
+-------+-----------------------+------------------------+------------------------+------------------------+
|   MPO | Lane 1                | Lane 2                 | Lane 3                 | Lane 4                 |
+=======+=======================+========================+========================+========================+
|     1 | Ethernet0/asic0(UP)   | Ethernet512/asic1(UP)  | Ethernet1024/asic2(UP) | Ethernet1536/asic3(UP) |
|     2 | Ethernet1/asic0(UP)   | Ethernet513/asic1(UP)  | Ethernet1025/asic2(UP) | Ethernet1537/asic3(UP) |
...
|   511 | Ethernet510/asic0(UP) | Ethernet1022/asic1(UP) | Ethernet1534/asic2(UP) | Ethernet2046/asic3(UP) |
|   512 | Ethernet511/asic0(UP) | Ethernet1023/asic1(UP) | Ethernet1535/asic2(UP) | Ethernet2047/asic3(UP) |
+-------+-----------------------+------------------------+------------------------+------------------------+

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@YairRaviv YairRaviv force-pushed the yraviv-interfaces-mpo-status-mapping branch from 14f8731 to 955fbe3 Compare December 7, 2025 14:45
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@YairRaviv YairRaviv force-pushed the yraviv-interfaces-mpo-status-mapping branch from 955fbe3 to 1b1d624 Compare December 7, 2025 15:02
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@YairRaviv YairRaviv force-pushed the yraviv-interfaces-mpo-status-mapping branch from 1b1d624 to 4d3bd99 Compare December 7, 2025 15:06
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

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