Skip to content

Commit df94636

Browse files
authored
Display target firmware version through CLI (#3274)
Signed-off-by: Mihir Patel <[email protected]>
1 parent cd5c058 commit df94636

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

scripts/sfpshow

+3
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ class SFPShow(object):
334334
output += covert_application_advertisement_to_output_string(indent, sfp_info_dict)
335335
elif key == 'active_firmware' or key == 'inactive_firmware':
336336
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_firmware_info_dict[key] if key in sfp_firmware_info_dict else 'N/A')
337+
elif key.startswith(('e1_', 'e2_')):
338+
if key in sfp_firmware_info_dict:
339+
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_firmware_info_dict[key])
337340
else:
338341
output += '{}{}: {}\n'.format(indent, data_map[key], sfp_info_dict[key])
339342

tests/mock_tables/asic1/state_db.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@
7070
},
7171
"TRANSCEIVER_FIRMWARE_INFO|Ethernet64": {
7272
"active_firmware": "X.X",
73-
"inactive_firmware": "X.X"
73+
"inactive_firmware": "X.X",
74+
"e1_active_firmware" : "X.X",
75+
"e1_inactive_firmware" : "Y.Y",
76+
"e1_server_firmware" : "A.B.C.D",
77+
"e2_active_firmware" : "X.X",
78+
"e2_inactive_firmware" : "Y.Y",
79+
"e2_server_firmware" : "A.B.C.D"
7480
},
7581
"CHASSIS_INFO|chassis 1": {
7682
"psu_num": "2"

tests/mock_tables/state_db.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,13 @@
674674
},
675675
"TRANSCEIVER_FIRMWARE_INFO|Ethernet64": {
676676
"active_firmware": "X.X",
677-
"inactive_firmware": "X.X"
677+
"inactive_firmware": "X.X",
678+
"e1_active_firmware" : "X.X",
679+
"e1_inactive_firmware" : "Y.Y",
680+
"e1_server_firmware" : "A.B.C.D",
681+
"e2_active_firmware" : "X.X",
682+
"e2_inactive_firmware" : "Y.Y",
683+
"e2_server_firmware" : "A.B.C.D"
678684
},
679685
"TRANSCEIVER_INFO|Ethernet72": {
680686
"active_apsel_hostlane4": "N/A",

tests/sfp_test.py

+18
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@
600600
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
601601
CMIS Rev: 4.1
602602
Connector: LC
603+
E1 Active Firmware: X.X
604+
E1 Inactive Firmware: Y.Y
605+
E1 Server Firmware: A.B.C.D
606+
E2 Active Firmware: X.X
607+
E2 Inactive Firmware: Y.Y
608+
E2 Server Firmware: A.B.C.D
603609
Encoding: N/A
604610
Extended Identifier: Power Class 8 (20.0W Max)
605611
Extended RateSelect Compliance: N/A
@@ -690,6 +696,12 @@
690696
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
691697
CMIS Rev: 4.1
692698
Connector: LC
699+
E1 Active Firmware: X.X
700+
E1 Inactive Firmware: Y.Y
701+
E1 Server Firmware: A.B.C.D
702+
E2 Active Firmware: X.X
703+
E2 Inactive Firmware: Y.Y
704+
E2 Server Firmware: A.B.C.D
693705
Encoding: N/A
694706
Extended Identifier: Power Class 8 (20.0W Max)
695707
Extended RateSelect Compliance: N/A
@@ -780,6 +792,12 @@
780792
100GAUI-2 C2M (Annex 135G) - Host Assign (0x55) - 400ZR, DWDM, amplified - Media Assign (0x1)
781793
CMIS Rev: 4.1
782794
Connector: LC
795+
E1 Active Firmware: X.X
796+
E1 Inactive Firmware: Y.Y
797+
E1 Server Firmware: A.B.C.D
798+
E2 Active Firmware: X.X
799+
E2 Inactive Firmware: Y.Y
800+
E2 Server Firmware: A.B.C.D
783801
Encoding: N/A
784802
Extended Identifier: Power Class 8 (20.0W Max)
785803
Extended RateSelect Compliance: N/A

utilities_common/sfp_helper.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
'supported_max_tx_power': 'Supported Max TX Power',
3939
'supported_min_tx_power': 'Supported Min TX Power',
4040
'supported_max_laser_freq': 'Supported Max Laser Frequency',
41-
'supported_min_laser_freq': 'Supported Min Laser Frequency'
41+
'supported_min_laser_freq': 'Supported Min Laser Frequency',
42+
'e1_active_firmware': 'E1 Active Firmware',
43+
'e1_inactive_firmware': 'E1 Inactive Firmware',
44+
'e1_server_firmware': 'E1 Server Firmware',
45+
'e2_active_firmware': 'E2 Active Firmware',
46+
'e2_inactive_firmware': 'E2 Inactive Firmware',
47+
'e2_server_firmware': 'E2 Server Firmware'
4248
}
4349

4450
CMIS_DATA_MAP = {**QSFP_DATA_MAP, **QSFP_CMIS_DELTA_DATA_MAP}

0 commit comments

Comments
 (0)