Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify "show interface transceiver status" CLI to show SW cmis state #3238

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

mihirpat1
Copy link
Contributor

@mihirpat1 mihirpat1 commented Mar 22, 2024

What I did

With the below PR, we are now storing cmis_state in TRANSCEIVER_STATUS table of STATE_DB. Hence, we need to modify the show interface transceiver status CLI to show the software cmis_state of a port

sonic-net/sonic-platform-daemons#449

MSFT ADO - 27254777

How I did it

Added cmis_state in QSFP_STATUS_MAP to display it for all types of transceivers which have this field populated.

How to verify it

  1. Dumped o/p of show int transceiver status with the cmis_state field present in TRANSCEIVER_STATUS table
  2. Dumped o/p of show int transceiver status with the cmis_state field absent in TRANSCEIVER_STATUS table
root@sonic:/home/admin# show int transceiver status Ethernet256
Ethernet256: 
        CMIS State (SW): READY
        Tx fault flag on media lane 1: False
        Rx loss of signal flag on media lane 1: False
        TX disable status on lane 1: False
        Disabled TX channels: 0
root@sonic:/home/admin# redis-cli -n 6 hgetall "TRANSCEIVER_STATUS|Ethernet256"
 1) "cmis_state"
 2) "READY"
 3) "status"
 4) "1"
 5) "error"
 6) "N/A"
 7) "rxlos1"
 8) "False"
 9) "txfault1"
10) "False"
11) "tx1disable"
12) "False"
13) "tx_disabled_channel"
14) "0"
root@sonic:/home/admin# redis-cli -n 6 HDEL "TRANSCEIVER_STATUS|Ethernet256" "cmis_state"
(integer) 1
root@sonic:/home/admin# show int transceiver status Ethernet256
Ethernet256: 
        Tx fault flag on media lane 1: False
        Rx loss of signal flag on media lane 1: False
        TX disable status on lane 1: False
        Disabled TX channels: 0
root@sonic:/home/admin# 

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

root@sonic:/home/admin# show int transceiver status Ethernet256
Ethernet256: 
        Tx fault flag on media lane 1: False
        Rx loss of signal flag on media lane 1: False
        TX disable status on lane 1: False
        Disabled TX channels: 0
root@sonic:/home/admin# 

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

root@sonic:/home/admin# show int transceiver status Ethernet256
Ethernet256: 
        CMIS State (SW): READY
        Tx fault flag on media lane 1: False
        Rx loss of signal flag on media lane 1: False
        TX disable status on lane 1: False
        Disabled TX channels: 0

@mihirpat1
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mihirpat1 mihirpat1 marked this pull request as ready for review March 22, 2024 23:09
@mihirpat1 mihirpat1 requested a review from prgeor March 22, 2024 23:09
@@ -47,6 +47,7 @@
# For non-CMIS, only first 1 or 4 lanes are applicable.
# For CMIS, all 8 lanes are applicable.
QSFP_STATUS_MAP = {
'cmis_state': 'CMIS State (SW)',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mihirpat1 thanks for adding explicit SW

@mihirpat1 mihirpat1 merged commit e35452b into sonic-net:master Mar 25, 2024
5 checks passed
@mihirpat1
Copy link
Contributor Author

@StormLiangMS @yxieca - Can you please help in merging this to 202305 and 202311?
MSFT ADO - 27254777

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #3245

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #3258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants