Skip to content

Commit c011c73

Browse files
zzhiyuanjleveque
authored andcommitted
[xcvrd] Fix crashing due to missing fields of some module types (#54)
From SFF-8436 regarding cable length fields: "A value of zero means that the Module does not support (this mode) or that the length information must be determined from the Module technology." It is possible that all cable length fields in eeprom are 0, and this would lead to xcvrd crashing due to fetching of this data. Fallback is added in this case.
1 parent 04014b6 commit c011c73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sonic_platform_base/sonic_sfp/sfputilbase.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,8 @@ def get_transceiver_info_dict(self, port_num):
876876
transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value']
877877
transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value']
878878
transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value']
879+
transceiver_info_dict['cable_type'] = "Unknown"
880+
transceiver_info_dict['cable_length'] = "Unknown"
879881
if sfp_type == 'QSFP':
880882
for key in qsfp_cable_length_tup:
881883
if key in sfp_interface_bulk_data['data']:

0 commit comments

Comments
 (0)