Skip to content

Commit

Permalink
Add missing PM and VDM related EEPROM read (sonic-net#326)
Browse files Browse the repository at this point in the history
Signed-off-by: Mihir Patel <patelmi@microsoft.com>

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
  • Loading branch information
mihirpat1 authored Nov 21, 2022
1 parent 02dd597 commit f5ba0d0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions sonic_platform_base/sonic_xcvr/api/public/c_cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,9 @@ def get_transceiver_pm(self):
trans_pm['cfo_avg'] = PM_dict['rx_cfo_avg']
trans_pm['cfo_min'] = PM_dict['rx_cfo_min']
trans_pm['cfo_max'] = PM_dict['rx_cfo_max']
trans_pm['evm_avg'] = PM_dict['rx_evm_avg']
trans_pm['evm_min'] = PM_dict['rx_evm_min']
trans_pm['evm_max'] = PM_dict['rx_evm_max']
trans_pm['soproc_avg'] = PM_dict['rx_soproc_avg']
trans_pm['soproc_min'] = PM_dict['rx_soproc_min']
trans_pm['soproc_max'] = PM_dict['rx_soproc_max']
Expand Down
5 changes: 4 additions & 1 deletion sonic_platform_base/sonic_xcvr/api/public/cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ def get_transceiver_bulk_status(self):
try:
bulk_status['laser_temperature'] = laser_temp_dict['monitor value']
bulk_status['prefec_ber'] = self.vdm_dict['Pre-FEC BER Average Media Input'][1][0]
bulk_status['postfec_ber'] = self.vdm_dict['Errored Frames Average Media Input'][1][0]
bulk_status['postfec_ber_min'] = self.vdm_dict['Errored Frames Minimum Media Input'][1][0]
bulk_status['postfec_ber_max'] = self.vdm_dict['Errored Frames Maximum Media Input'][1][0]
bulk_status['postfec_ber_avg'] = self.vdm_dict['Errored Frames Average Media Input'][1][0]
bulk_status['postfec_curr_val'] = self.vdm_dict['Errored Frames Current Value Media Input'][1][0]
except (KeyError, TypeError):
pass
return bulk_status
Expand Down
2 changes: 2 additions & 0 deletions tests/sonic_xcvr/test_ccmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ def test_get_transceiver_status(self, get_transceiver_status_func, mock_response
'rx_osnr_avg': 28, 'rx_osnr_min': 26, 'rx_osnr_max': 30,
'rx_esnr_avg': 17, 'rx_esnr_min': 15, 'rx_esnr_max': 18,
'rx_cfo_avg': 200, 'rx_cfo_min': 150, 'rx_cfo_max': 250,
'rx_evm_avg': 15, 'rx_evm_min': 13, 'rx_evm_max': 18,
'tx_power_avg': -10, 'tx_power_min': -9.5, 'tx_power_max': -10.5,
'rx_power_avg': -8, 'rx_power_min': -7, 'rx_power_max': -9,
'rx_sigpwr_avg': -8, 'rx_sigpwr_min': -7, 'rx_sigpwr_max': -9,
Expand All @@ -599,6 +600,7 @@ def test_get_transceiver_status(self, get_transceiver_status_func, mock_response
'osnr_avg': 28, 'osnr_min': 26, 'osnr_max': 30,
'esnr_avg': 17, 'esnr_min': 15, 'esnr_max': 18,
'cfo_avg': 200, 'cfo_min': 150, 'cfo_max': 250,
'evm_avg': 15, 'evm_min': 13, 'evm_max': 18,
'tx_power_avg': -10, 'tx_power_min': -9.5, 'tx_power_max': -10.5,
'rx_tot_power_avg': -8, 'rx_tot_power_min': -7, 'rx_tot_power_max': -9,
'rx_sig_power_avg': -8, 'rx_sig_power_min': -7, 'rx_sig_power_max': -9,
Expand Down
8 changes: 7 additions & 1 deletion tests/sonic_xcvr/test_cmis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,10 @@ def test_get_transceiver_info(self, mock_response, expected):
{'monitor value': 40},
{
'Pre-FEC BER Average Media Input':{1:[0.001, 0.0125, 0, 0.01, 0, False, False, False, False]},
'Errored Frames Minimum Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
'Errored Frames Maximum Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
'Errored Frames Average Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
'Errored Frames Current Value Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
}
],
{
Expand All @@ -1250,7 +1253,10 @@ def test_get_transceiver_info(self, mock_response, expected):
'tx_disabled_channel': 0,
'laser_temperature': 40,
'prefec_ber': 0.001,
'postfec_ber': 0,
'postfec_ber_min': 0,
'postfec_ber_max': 0,
'postfec_ber_avg': 0,
'postfec_curr_val': 0,
}
),
(
Expand Down

0 comments on commit f5ba0d0

Please sign in to comment.