[Mellanox] Fix typo "xSFP_VLOT_OFFSET" (#3118)
Variables SFP_VLOT_OFFSET and QSFP_VLOT_OFFSET containing the typo are originally defined in repo sonic-platform-common. The typo has been fixed in PR #33. However, some Mellanox-specific code hasn't updated correspondingly, which results in xcvrd fail to start. This PR updates the variable name in Mellanox-specific code correspondingly to fix that.
This commit is contained in:
parent
cf063bd3af
commit
20e4547dbc
@ -464,7 +464,7 @@ class SfpUtil(SfpUtilBase):
|
|||||||
else:
|
else:
|
||||||
return transceiver_dom_info_dict
|
return transceiver_dom_info_dict
|
||||||
|
|
||||||
dom_voltage_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_VLOT_OFFSET), QSFP_VOLT_WIDTH)
|
dom_voltage_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH)
|
||||||
if dom_voltage_raw is not None:
|
if dom_voltage_raw is not None:
|
||||||
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
||||||
else:
|
else:
|
||||||
@ -533,7 +533,7 @@ class SfpUtil(SfpUtilBase):
|
|||||||
dom_temperature_raw = eeprom_domraw[SFP_TEMPE_OFFSET:SFP_TEMPE_OFFSET+SFP_TEMPE_WIDTH]
|
dom_temperature_raw = eeprom_domraw[SFP_TEMPE_OFFSET:SFP_TEMPE_OFFSET+SFP_TEMPE_WIDTH]
|
||||||
dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0)
|
dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0)
|
||||||
|
|
||||||
dom_voltage_raw = eeprom_domraw[SFP_VLOT_OFFSET:SFP_VLOT_OFFSET+SFP_VOLT_WIDTH]
|
dom_voltage_raw = eeprom_domraw[SFP_VOLT_OFFSET:SFP_VOLT_OFFSET+SFP_VOLT_WIDTH]
|
||||||
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
||||||
|
|
||||||
dom_channel_monitor_raw = eeprom_domraw[SFP_CHANNL_MON_OFFSET:SFP_CHANNL_MON_OFFSET+SFP_CHANNL_MON_WIDTH]
|
dom_channel_monitor_raw = eeprom_domraw[SFP_CHANNL_MON_OFFSET:SFP_CHANNL_MON_OFFSET+SFP_CHANNL_MON_WIDTH]
|
||||||
|
@ -76,7 +76,7 @@ QSFP_DOM_REV_OFFSET = 1
|
|||||||
QSFP_DOM_REV_WIDTH = 1
|
QSFP_DOM_REV_WIDTH = 1
|
||||||
QSFP_TEMPE_OFFSET = 22
|
QSFP_TEMPE_OFFSET = 22
|
||||||
QSFP_TEMPE_WIDTH = 2
|
QSFP_TEMPE_WIDTH = 2
|
||||||
QSFP_VLOT_OFFSET = 26
|
QSFP_VOLT_OFFSET = 26
|
||||||
QSFP_VOLT_WIDTH = 2
|
QSFP_VOLT_WIDTH = 2
|
||||||
QSFP_VERSION_COMPLIANCE_OFFSET = 1
|
QSFP_VERSION_COMPLIANCE_OFFSET = 1
|
||||||
QSFP_VERSION_COMPLIANCE_WIDTH = 1
|
QSFP_VERSION_COMPLIANCE_WIDTH = 1
|
||||||
@ -102,7 +102,7 @@ QSFP_OPTION_VALUE_WIDTH = 4
|
|||||||
|
|
||||||
SFP_TEMPE_OFFSET = 96
|
SFP_TEMPE_OFFSET = 96
|
||||||
SFP_TEMPE_WIDTH = 2
|
SFP_TEMPE_WIDTH = 2
|
||||||
SFP_VLOT_OFFSET = 98
|
SFP_VOLT_OFFSET = 98
|
||||||
SFP_VOLT_WIDTH = 2
|
SFP_VOLT_WIDTH = 2
|
||||||
SFP_CHANNL_MON_OFFSET = 100
|
SFP_CHANNL_MON_OFFSET = 100
|
||||||
SFP_CHANNL_MON_WIDTH = 6
|
SFP_CHANNL_MON_WIDTH = 6
|
||||||
@ -617,7 +617,7 @@ class SFP(SfpBase):
|
|||||||
transceiver_dom_info_dict['temperature'] = 'N/A'
|
transceiver_dom_info_dict['temperature'] = 'N/A'
|
||||||
|
|
||||||
if self.dom_volt_supported:
|
if self.dom_volt_supported:
|
||||||
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + QSFP_VLOT_OFFSET), QSFP_VOLT_WIDTH)
|
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH)
|
||||||
if dom_voltage_raw is not None:
|
if dom_voltage_raw is not None:
|
||||||
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
||||||
volt = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value'])
|
volt = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value'])
|
||||||
@ -677,7 +677,7 @@ class SFP(SfpBase):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + SFP_VLOT_OFFSET), SFP_VOLT_WIDTH)
|
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH)
|
||||||
if dom_voltage_raw is not None:
|
if dom_voltage_raw is not None:
|
||||||
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
||||||
else:
|
else:
|
||||||
@ -979,7 +979,7 @@ class SFP(SfpBase):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if self.dom_volt_supported:
|
if self.dom_volt_supported:
|
||||||
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + QSFP_VLOT_OFFSET), QSFP_VOLT_WIDTH)
|
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH)
|
||||||
if dom_voltage_raw is not None:
|
if dom_voltage_raw is not None:
|
||||||
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
||||||
voltage = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value'])
|
voltage = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value'])
|
||||||
@ -996,7 +996,7 @@ class SFP(SfpBase):
|
|||||||
|
|
||||||
sfpd_obj._calibration_type = self.calibration
|
sfpd_obj._calibration_type = self.calibration
|
||||||
|
|
||||||
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + SFP_VLOT_OFFSET), SFP_VOLT_WIDTH)
|
dom_voltage_raw = self._read_eeprom_specific_bytes((offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH)
|
||||||
if dom_voltage_raw is not None:
|
if dom_voltage_raw is not None:
|
||||||
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0)
|
||||||
voltage = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value'])
|
voltage = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value'])
|
||||||
|
Loading…
Reference in New Issue
Block a user