Skip to content

Commit f5ba0d0

Browse files
authored
Add missing PM and VDM related EEPROM read (sonic-net#326)
Signed-off-by: Mihir Patel <[email protected]> Signed-off-by: Mihir Patel <[email protected]>
1 parent 02dd597 commit f5ba0d0

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

sonic_platform_base/sonic_xcvr/api/public/c_cmis.py

+3
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ def get_transceiver_pm(self):
911911
trans_pm['cfo_avg'] = PM_dict['rx_cfo_avg']
912912
trans_pm['cfo_min'] = PM_dict['rx_cfo_min']
913913
trans_pm['cfo_max'] = PM_dict['rx_cfo_max']
914+
trans_pm['evm_avg'] = PM_dict['rx_evm_avg']
915+
trans_pm['evm_min'] = PM_dict['rx_evm_min']
916+
trans_pm['evm_max'] = PM_dict['rx_evm_max']
914917
trans_pm['soproc_avg'] = PM_dict['rx_soproc_avg']
915918
trans_pm['soproc_min'] = PM_dict['rx_soproc_min']
916919
trans_pm['soproc_max'] = PM_dict['rx_soproc_max']

sonic_platform_base/sonic_xcvr/api/public/cmis.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ def get_transceiver_bulk_status(self):
216216
try:
217217
bulk_status['laser_temperature'] = laser_temp_dict['monitor value']
218218
bulk_status['prefec_ber'] = self.vdm_dict['Pre-FEC BER Average Media Input'][1][0]
219-
bulk_status['postfec_ber'] = self.vdm_dict['Errored Frames Average Media Input'][1][0]
219+
bulk_status['postfec_ber_min'] = self.vdm_dict['Errored Frames Minimum Media Input'][1][0]
220+
bulk_status['postfec_ber_max'] = self.vdm_dict['Errored Frames Maximum Media Input'][1][0]
221+
bulk_status['postfec_ber_avg'] = self.vdm_dict['Errored Frames Average Media Input'][1][0]
222+
bulk_status['postfec_curr_val'] = self.vdm_dict['Errored Frames Current Value Media Input'][1][0]
220223
except (KeyError, TypeError):
221224
pass
222225
return bulk_status

tests/sonic_xcvr/test_ccmis.py

+2
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ def test_get_transceiver_status(self, get_transceiver_status_func, mock_response
584584
'rx_osnr_avg': 28, 'rx_osnr_min': 26, 'rx_osnr_max': 30,
585585
'rx_esnr_avg': 17, 'rx_esnr_min': 15, 'rx_esnr_max': 18,
586586
'rx_cfo_avg': 200, 'rx_cfo_min': 150, 'rx_cfo_max': 250,
587+
'rx_evm_avg': 15, 'rx_evm_min': 13, 'rx_evm_max': 18,
587588
'tx_power_avg': -10, 'tx_power_min': -9.5, 'tx_power_max': -10.5,
588589
'rx_power_avg': -8, 'rx_power_min': -7, 'rx_power_max': -9,
589590
'rx_sigpwr_avg': -8, 'rx_sigpwr_min': -7, 'rx_sigpwr_max': -9,
@@ -599,6 +600,7 @@ def test_get_transceiver_status(self, get_transceiver_status_func, mock_response
599600
'osnr_avg': 28, 'osnr_min': 26, 'osnr_max': 30,
600601
'esnr_avg': 17, 'esnr_min': 15, 'esnr_max': 18,
601602
'cfo_avg': 200, 'cfo_min': 150, 'cfo_max': 250,
603+
'evm_avg': 15, 'evm_min': 13, 'evm_max': 18,
602604
'tx_power_avg': -10, 'tx_power_min': -9.5, 'tx_power_max': -10.5,
603605
'rx_tot_power_avg': -8, 'rx_tot_power_min': -7, 'rx_tot_power_max': -9,
604606
'rx_sig_power_avg': -8, 'rx_sig_power_min': -7, 'rx_sig_power_max': -9,

tests/sonic_xcvr/test_cmis.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,10 @@ def test_get_transceiver_info(self, mock_response, expected):
12311231
{'monitor value': 40},
12321232
{
12331233
'Pre-FEC BER Average Media Input':{1:[0.001, 0.0125, 0, 0.01, 0, False, False, False, False]},
1234+
'Errored Frames Minimum Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
1235+
'Errored Frames Maximum Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
12341236
'Errored Frames Average Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
1237+
'Errored Frames Current Value Media Input':{1:[0, 1, 0, 1, 0, False, False, False, False]},
12351238
}
12361239
],
12371240
{
@@ -1250,7 +1253,10 @@ def test_get_transceiver_info(self, mock_response, expected):
12501253
'tx_disabled_channel': 0,
12511254
'laser_temperature': 40,
12521255
'prefec_ber': 0.001,
1253-
'postfec_ber': 0,
1256+
'postfec_ber_min': 0,
1257+
'postfec_ber_max': 0,
1258+
'postfec_ber_avg': 0,
1259+
'postfec_curr_val': 0,
12541260
}
12551261
),
12561262
(

0 commit comments

Comments
 (0)