Skip to content

Commit

Permalink
[xcvrd] Fix crashing due to missing fields of some module types (soni…
Browse files Browse the repository at this point in the history
…c-net#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.
  • Loading branch information
zzhiyuan authored and jleveque committed Aug 20, 2019
1 parent 04014b6 commit c011c73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sonic_platform_base/sonic_sfp/sfputilbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,8 @@ def get_transceiver_info_dict(self, port_num):
transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value']
transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value']
transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value']
transceiver_info_dict['cable_type'] = "Unknown"
transceiver_info_dict['cable_length'] = "Unknown"
if sfp_type == 'QSFP':
for key in qsfp_cable_length_tup:
if key in sfp_interface_bulk_data['data']:
Expand Down

0 comments on commit c011c73

Please sign in to comment.