Skip to content

Commit

Permalink
Display target firmware version through CLI (sonic-net#3274)
Browse files Browse the repository at this point in the history
Signed-off-by: Mihir Patel <patelmi@microsoft.com>
  • Loading branch information
mihirpat1 authored and mssonicbld committed Apr 30, 2024
1 parent 21f69fb commit d52dc8e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
3 changes: 3 additions & 0 deletions scripts/sfpshow
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ class SFPShow(object):
output += covert_application_advertisement_to_output_string(indent, sfp_info_dict)
elif key == 'active_firmware' or key == 'inactive_firmware':
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_firmware_info_dict[key] if key in sfp_firmware_info_dict else 'N/A')
elif key.startswith(('e1_', 'e2_')):
if key in sfp_firmware_info_dict:
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_firmware_info_dict[key])
else:
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_info_dict[key])

Expand Down
8 changes: 7 additions & 1 deletion tests/mock_tables/asic1/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@
},
"TRANSCEIVER_FIRMWARE_INFO|Ethernet64": {
"active_firmware": "X.X",
"inactive_firmware": "X.X"
"inactive_firmware": "X.X",
"e1_active_firmware" : "X.X",
"e1_inactive_firmware" : "Y.Y",
"e1_server_firmware" : "A.B.C.D",
"e2_active_firmware" : "X.X",
"e2_inactive_firmware" : "Y.Y",
"e2_server_firmware" : "A.B.C.D"
},
"CHASSIS_INFO|chassis 1": {
"psu_num": "2"
Expand Down
8 changes: 7 additions & 1 deletion tests/mock_tables/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,13 @@
},
"TRANSCEIVER_FIRMWARE_INFO|Ethernet64": {
"active_firmware": "X.X",
"inactive_firmware": "X.X"
"inactive_firmware": "X.X",
"e1_active_firmware" : "X.X",
"e1_inactive_firmware" : "Y.Y",
"e1_server_firmware" : "A.B.C.D",
"e2_active_firmware" : "X.X",
"e2_inactive_firmware" : "Y.Y",
"e2_server_firmware" : "A.B.C.D"
},
"TRANSCEIVER_INFO|Ethernet72": {
"active_apsel_hostlane4": "N/A",
Expand Down
18 changes: 18 additions & 0 deletions tests/sfp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,12 @@
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
CMIS Rev: 4.1
Connector: LC
E1 Active Firmware: X.X
E1 Inactive Firmware: Y.Y
E1 Server Firmware: A.B.C.D
E2 Active Firmware: X.X
E2 Inactive Firmware: Y.Y
E2 Server Firmware: A.B.C.D
Encoding: N/A
Extended Identifier: Power Class 8 (20.0W Max)
Extended RateSelect Compliance: N/A
Expand Down Expand Up @@ -690,6 +696,12 @@
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
CMIS Rev: 4.1
Connector: LC
E1 Active Firmware: X.X
E1 Inactive Firmware: Y.Y
E1 Server Firmware: A.B.C.D
E2 Active Firmware: X.X
E2 Inactive Firmware: Y.Y
E2 Server Firmware: A.B.C.D
Encoding: N/A
Extended Identifier: Power Class 8 (20.0W Max)
Extended RateSelect Compliance: N/A
Expand Down Expand Up @@ -780,6 +792,12 @@
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
CMIS Rev: 4.1
Connector: LC
E1 Active Firmware: X.X
E1 Inactive Firmware: Y.Y
E1 Server Firmware: A.B.C.D
E2 Active Firmware: X.X
E2 Inactive Firmware: Y.Y
E2 Server Firmware: A.B.C.D
Encoding: N/A
Extended Identifier: Power Class 8 (20.0W Max)
Extended RateSelect Compliance: N/A
Expand Down
8 changes: 7 additions & 1 deletion utilities_common/sfp_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@
'supported_max_tx_power': 'Supported Max TX Power',
'supported_min_tx_power': 'Supported Min TX Power',
'supported_max_laser_freq': 'Supported Max Laser Frequency',
'supported_min_laser_freq': 'Supported Min Laser Frequency'
'supported_min_laser_freq': 'Supported Min Laser Frequency',
'e1_active_firmware': 'E1 Active Firmware',
'e1_inactive_firmware': 'E1 Inactive Firmware',
'e1_server_firmware': 'E1 Server Firmware',
'e2_active_firmware': 'E2 Active Firmware',
'e2_inactive_firmware': 'E2 Inactive Firmware',
'e2_server_firmware': 'E2 Server Firmware'
}

CMIS_DATA_MAP = {**QSFP_DATA_MAP, **QSFP_CMIS_DELTA_DATA_MAP}
Expand Down

0 comments on commit d52dc8e

Please sign in to comment.