Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tx_disable/tx_disabled_channel/rx_los/tx_fault to get_transceiver_status API #359

Merged
merged 5 commits into from
May 31, 2023
Merged

Move tx_disable/tx_disabled_channel/rx_los/tx_fault to get_transceiver_status API #359

merged 5 commits into from
May 31, 2023

Conversation

longhuan-cisco
Copy link
Contributor

@longhuan-cisco longhuan-cisco commented Apr 5, 2023

Description

Move tx_disable/tx_disabled_channel from get_transceiver_bulk_status API (which serves DOM_SENSOR table) to get_transceiver_status API (which serves STATUS table)
Also, add get_transceiver_status API for non-CMIS optics for the following fields: rx_los tx_fault tx_disable tx_disabled_channel

Note
Separate PR in SONiC repo will take care of the table schema change. sonic-net/SONiC#1316

Motivation and Context

According to updated schema of STATUS table in HLD, tx_disable/tx_disabled_channel should belong to STATUS table instead of DOM_SENSOR table.

How Has This Been Tested?

Verified on 400G optics, tx_disable/tx_disabled_channel are in the output of new status API, and in the DB as well.

>>> api35
<sonic_platform_base.sonic_xcvr.api.public.sff8636.Sff8636Api object at 0x7f4d97b67190>
>>> api35.get_transceiver_status()
{'rxlos1': False, 'rxlos2': False, 'rxlos3': False, 'rxlos4': False, 'txfault1': False, 'txfault2': False, 'txfault3': False, 'txfault4': False, 'tx1disable': False, 'tx2disable': False, 'tx3disable': False, 'tx4disable': False, 'tx_disabled_channel': 0}


>>> api34
<sonic_platform_base.sonic_xcvr.api.public.c_cmis.CCmisApi object at 0x7fe52cd11e50>
>>> api34.get_transceiver_status()
{'module_state': 'ModuleReady', 'module_fault_cause': 'No Fault detected', 'datapath_firmware_fault': False, 'module_firmware_fault': False, 'module_state_changed': True, 'temphighalarm_flag': False, 'templowalarm_flag': False, 'temphighwarning_flag': False, 'templowwarning_flag': False, 'vcchighalarm_flag': False, 'vcclowalarm_flag': False, 'vcchighwarning_flag': False, 'vcclowwarning_flag': False, 'lasertemphighalarm_flag': False, 'lasertemplowalarm_flag': False, 'lasertemphighwarning_flag': False, 'lasertemplowwarning_flag': False, 'DP1State': 'DataPathActivated', 'DP2State': 'DataPathActivated', 'DP3State': 'DataPathActivated', 'DP4State': 'DataPathActivated', 'DP5State': 'DataPathActivated', 'DP6State': 'DataPathActivated', 'DP7State': 'DataPathActivated', 'DP8State': 'DataPathActivated', 'txoutput_status1': False, 'txoutput_status2': False, 'txoutput_status3': False, 'txoutput_status4': False, 'txoutput_status5': False, 'txoutput_status6': False, 'txoutput_status7': False, 'txoutput_status8': False, 'rxoutput_status_hostlane1': True, 'rxoutput_status_hostlane2': True, 'rxoutput_status_hostlane3': True, 'rxoutput_status_hostlane4': True, 'rxoutput_status_hostlane5': True, 'rxoutput_status_hostlane6': True, 'rxoutput_status_hostlane7': True, 'rxoutput_status_hostlane8': True, 'tx_disabled_channel': 0, 'tx1disable': False, 'tx2disable': False, 'tx3disable': False, 'tx4disable': False, 'tx5disable': False, 'tx6disable': False, 'tx7disable': False, 'tx8disable': False, 'txfault1': False, 'txfault2': False, 'txfault3': False, 'txfault4': False, 'txfault5': False, 'txfault6': False, 'txfault7': False, 'txfault8': False, 'txlos_hostlane1': False, 'txlos_hostlane2': False, 'txlos_hostlane3': False, 'txlos_hostlane4': False, 'txlos_hostlane5': False, 'txlos_hostlane6': False, 'txlos_hostlane7': False, 'txlos_hostlane8': False, 'txcdrlol_hostlane1': False, 'txcdrlol_hostlane2': False, 'txcdrlol_hostlane3': False, 'txcdrlol_hostlane4': False, 'txcdrlol_hostlane5': False, 'txcdrlol_hostlane6': False, 'txcdrlol_hostlane7': False, 'txcdrlol_hostlane8': False, 'rxlos1': False, 'rxlos2': False, 'rxlos3': False, 'rxlos4': False, 'rxlos5': False, 'rxlos6': False, 'rxlos7': False, 'rxlos8': False, 'rxcdrlol1': False, 'rxcdrlol2': False, 'rxcdrlol3': False, 'rxcdrlol4': False, 'rxcdrlol5': False, 'rxcdrlol6': False, 'rxcdrlol7': False, 'rxcdrlol8': False, 'config_state_hostlane1': 'ConfigSuccess', 'config_state_hostlane2': 'ConfigSuccess', 'config_state_hostlane3': 'ConfigSuccess', 'config_state_hostlane4': 'ConfigSuccess', 'config_state_hostlane5': 'ConfigSuccess', 'config_state_hostlane6': 'ConfigSuccess', 'config_state_hostlane7': 'ConfigSuccess', 'config_state_hostlane8': 'ConfigSuccess', 'dpinit_pending_hostlane1': False, 'dpinit_pending_hostlane2': False, 'dpinit_pending_hostlane3': False, 'dpinit_pending_hostlane4': False, 'dpinit_pending_hostlane5': False, 'dpinit_pending_hostlane6': False, 'dpinit_pending_hostlane7': False, 'dpinit_pending_hostlane8': False, 'txpowerhighalarm_flag1': False, 'txpowerlowalarm_flag1': False, 'txpowerhighwarning_flag1': False, 'txpowerlowwarning_flag1': False, 'txpowerhighalarm_flag2': False, 'txpowerlowalarm_flag2': False, 'txpowerhighwarning_flag2': False, 'txpowerlowwarning_flag2': False, 'txpowerhighalarm_flag3': False, 'txpowerlowalarm_flag3': False, 'txpowerhighwarning_flag3': False, 'txpowerlowwarning_flag3': False, 'txpowerhighalarm_flag4': False, 'txpowerlowalarm_flag4': False, 'txpowerhighwarning_flag4': False, 'txpowerlowwarning_flag4': False, 'txpowerhighalarm_flag5': False, 'txpowerlowalarm_flag5': False, 'txpowerhighwarning_flag5': False, 'txpowerlowwarning_flag5': False, 'txpowerhighalarm_flag6': False, 'txpowerlowalarm_flag6': False, 'txpowerhighwarning_flag6': False, 'txpowerlowwarning_flag6': False, 'txpowerhighalarm_flag7': False, 'txpowerlowalarm_flag7': False, 'txpowerhighwarning_flag7': False, 'txpowerlowwarning_flag7': False, 'txpowerhighalarm_flag8': False, 'txpowerlowalarm_flag8': False, 'txpowerhighwarning_flag8': False, 'txpowerlowwarning_flag8': False, 'rxpowerhighalarm_flag1': False, 'rxpowerlowalarm_flag1': False, 'rxpowerhighwarning_flag1': False, 'rxpowerlowwarning_flag1': False, 'rxpowerhighalarm_flag2': False, 'rxpowerlowalarm_flag2': False, 'rxpowerhighwarning_flag2': False, 'rxpowerlowwarning_flag2': False, 'rxpowerhighalarm_flag3': False, 'rxpowerlowalarm_flag3': False, 'rxpowerhighwarning_flag3': False, 'rxpowerlowwarning_flag3': False, 'rxpowerhighalarm_flag4': False, 'rxpowerlowalarm_flag4': False, 'rxpowerhighwarning_flag4': False, 'rxpowerlowwarning_flag4': False, 'rxpowerhighalarm_flag5': False, 'rxpowerlowalarm_flag5': False, 'rxpowerhighwarning_flag5': False, 'rxpowerlowwarning_flag5': False, 'rxpowerhighalarm_flag6': False, 'rxpowerlowalarm_flag6': False, 'rxpowerhighwarning_flag6': False, 'rxpowerlowwarning_flag6': False, 'rxpowerhighalarm_flag7': False, 'rxpowerlowalarm_flag7': False, 'rxpowerhighwarning_flag7': False, 'rxpowerlowwarning_flag7': False, 'rxpowerhighalarm_flag8': False, 'rxpowerlowalarm_flag8': False, 'rxpowerhighwarning_flag8': False, 'rxpowerlowwarning_flag8': False, 'txbiashighalarm_flag1': False, 'txbiaslowalarm_flag1': False, 'txbiashighwarning_flag1': False, 'txbiaslowwarning_flag1': False, 'txbiashighalarm_flag2': False, 'txbiaslowalarm_flag2': False, 'txbiashighwarning_flag2': False, 'txbiaslowwarning_flag2': False, 'txbiashighalarm_flag3': False, 'txbiaslowalarm_flag3': False, 'txbiashighwarning_flag3': False, 'txbiaslowwarning_flag3': False, 'txbiashighalarm_flag4': False, 'txbiaslowalarm_flag4': False, 'txbiashighwarning_flag4': False, 'txbiaslowwarning_flag4': False, 'txbiashighalarm_flag5': False, 'txbiaslowalarm_flag5': False, 'txbiashighwarning_flag5': False, 'txbiaslowwarning_flag5': False, 'txbiashighalarm_flag6': False, 'txbiaslowalarm_flag6': False, 'txbiashighwarning_flag6': False, 'txbiaslowwarning_flag6': False, 'txbiashighalarm_flag7': False, 'txbiaslowalarm_flag7': False, 'txbiashighwarning_flag7': False, 'txbiaslowwarning_flag7': False, 'txbiashighalarm_flag8': False, 'txbiaslowalarm_flag8': False, 'txbiashighwarning_flag8': False, 'txbiaslowwarning_flag8': False, 'prefecberhighalarm_flag': False, 'prefecberlowalarm_flag': False, 'prefecberhighwarning_flag': False, 'prefecberlowwarning_flag': False, 'postfecberhighalarm_flag': False, 'postfecberlowalarm_flag': False, 'postfecberhighwarning_flag': False, 'postfecberlowwarning_flag': False, 'tuning_in_progress': False, 'wavelength_unlock_status': False, 'target_output_power_oor': False, 'fine_tuning_oor': False, 'tuning_not_accepted': False, 'invalid_channel_num': False, 'tuning_complete': False, 'biasxihighalarm_flag': False, 'biasxilowalarm_flag': False, 'biasxihighwarning_flag': False, 'biasxilowwarning_flag': False, 'biasxqhighalarm_flag': False, 'biasxqlowalarm_flag': False, 'biasxqhighwarning_flag': False, 'biasxqlowwarning_flag': False, 'biasxphighalarm_flag': False, 'biasxplowalarm_flag': False, 'biasxphighwarning_flag': False, 'biasxplowwarning_flag': False, 'biasyihighalarm_flag': False, 'biasyilowalarm_flag': False, 'biasyihighwarning_flag': False, 'biasyilowwarning_flag': False, 'biasyqhighalarm_flag': False, 'biasyqlowalarm_flag': False, 'biasyqhighwarning_flag': False, 'biasyqlowwarning_flag': False, 'biasyphighalarm_flag': False, 'biasyplowalarm_flag': False, 'biasyphighwarning_flag': False, 'biasyplowwarning_flag': False, 'cdshorthighalarm_flag': False, 'cdshortlowalarm_flag': False, 'cdshorthighwarning_flag': False, 'cdshortlowwarning_flag': False, 'cdlonghighalarm_flag': False, 'cdlonglowalarm_flag': False, 'cdlonghighwarning_flag': False, 'cdlonglowwarning_flag': False, 'dgdhighalarm_flag': False, 'dgdlowalarm_flag': False, 'dgdhighwarning_flag': False, 'dgdlowwarning_flag': False, 'pdlhighalarm_flag': False, 'pdllowalarm_flag': False, 'pdlhighwarning_flag': False, 'pdllowwarning_flag': False, 'osnrhighalarm_flag': False, 'osnrlowalarm_flag': False, 'osnrhighwarning_flag': False, 'osnrlowwarning_flag': False, 'esnrhighalarm_flag': False, 'esnrlowalarm_flag': False, 'esnrhighwarning_flag': False, 'esnrlowwarning_flag': False, 'cfohighalarm_flag': False, 'cfolowalarm_flag': False, 'cfohighwarning_flag': False, 'cfolowwarning_flag': False, 'txcurrpowerhighalarm_flag': False, 'txcurrpowerlowalarm_flag': False, 'txcurrpowerhighwarning_flag': False, 'txcurrpowerlowwarning_flag': False, 'rxtotpowerhighalarm_flag': False, 'rxtotpowerlowalarm_flag': False, 'rxtotpowerhighwarning_flag': False, 'rxtotpowerlowwarning_flag': False}

>>> api0
<sonic_platform_base.sonic_xcvr.api.public.cmis.CmisApi object at 0x7fe52cdc20d0>
>>> api0.get_transceiver_status()
{'module_state': 'ModuleReady', 'module_fault_cause': 'No Fault detected', 'datapath_firmware_fault': False, 'module_firmware_fault': False, 'module_state_changed': False, 'temphighalarm_flag': False, 'templowalarm_flag': False, 'temphighwarning_flag': False, 'templowwarning_flag': False, 'vcchighalarm_flag': False, 'vcclowalarm_flag': False, 'vcchighwarning_flag': False, 'vcclowwarning_flag': False, 'lasertemphighalarm_flag': False, 'lasertemplowalarm_flag': False, 'lasertemphighwarning_flag': False, 'lasertemplowwarning_flag': False, 'DP1State': 'DataPathActivated', 'DP2State': 'DataPathActivated', 'DP3State': 'DataPathActivated', 'DP4State': 'DataPathActivated', 'DP5State': 'DataPathActivated', 'DP6State': 'DataPathActivated', 'DP7State': 'DataPathActivated', 'DP8State': 'DataPathActivated', 'txoutput_status1': False, 'txoutput_status2': False, 'txoutput_status3': False, 'txoutput_status4': False, 'txoutput_status5': False, 'txoutput_status6': False, 'txoutput_status7': False, 'txoutput_status8': False, 'rxoutput_status_hostlane1': False, 'rxoutput_status_hostlane2': False, 'rxoutput_status_hostlane3': False, 'rxoutput_status_hostlane4': False, 'rxoutput_status_hostlane5': False, 'rxoutput_status_hostlane6': False, 'rxoutput_status_hostlane7': False, 'rxoutput_status_hostlane8': False, 'tx_disabled_channel': 0, 'tx1disable': False, 'tx2disable': False, 'tx3disable': False, 'tx4disable': False, 'tx5disable': False, 'tx6disable': False, 'tx7disable': False, 'tx8disable': False, 'txfault1': False, 'txfault2': False, 'txfault3': False, 'txfault4': False, 'txfault5': False, 'txfault6': False, 'txfault7': False, 'txfault8': False, 'txlos_hostlane1': False, 'txlos_hostlane2': False, 'txlos_hostlane3': False, 'txlos_hostlane4': False, 'txlos_hostlane5': False, 'txlos_hostlane6': False, 'txlos_hostlane7': False, 'txlos_hostlane8': False, 'txcdrlol_hostlane1': False, 'txcdrlol_hostlane2': False, 'txcdrlol_hostlane3': False, 'txcdrlol_hostlane4': False, 'txcdrlol_hostlane5': False, 'txcdrlol_hostlane6': False, 'txcdrlol_hostlane7': False, 'txcdrlol_hostlane8': False, 'rxlos1': False, 'rxlos2': False, 'rxlos3': False, 'rxlos4': False, 'rxlos5': False, 'rxlos6': False, 'rxlos7': False, 'rxlos8': False, 'rxcdrlol1': False, 'rxcdrlol2': False, 'rxcdrlol3': False, 'rxcdrlol4': False, 'rxcdrlol5': False, 'rxcdrlol6': False, 'rxcdrlol7': False, 'rxcdrlol8': False, 'config_state_hostlane1': 'ConfigSuccess', 'config_state_hostlane2': 'ConfigSuccess', 'config_state_hostlane3': 'ConfigSuccess', 'config_state_hostlane4': 'ConfigSuccess', 'config_state_hostlane5': 'ConfigSuccess', 'config_state_hostlane6': 'ConfigSuccess', 'config_state_hostlane7': 'ConfigSuccess', 'config_state_hostlane8': 'ConfigSuccess', 'dpinit_pending_hostlane1': False, 'dpinit_pending_hostlane2': False, 'dpinit_pending_hostlane3': False, 'dpinit_pending_hostlane4': False, 'dpinit_pending_hostlane5': False, 'dpinit_pending_hostlane6': False, 'dpinit_pending_hostlane7': False, 'dpinit_pending_hostlane8': False, 'txpowerhighalarm_flag1': False, 'txpowerlowalarm_flag1': False, 'txpowerhighwarning_flag1': False, 'txpowerlowwarning_flag1': False, 'txpowerhighalarm_flag2': False, 'txpowerlowalarm_flag2': False, 'txpowerhighwarning_flag2': False, 'txpowerlowwarning_flag2': False, 'txpowerhighalarm_flag3': False, 'txpowerlowalarm_flag3': False, 'txpowerhighwarning_flag3': False, 'txpowerlowwarning_flag3': False, 'txpowerhighalarm_flag4': False, 'txpowerlowalarm_flag4': False, 'txpowerhighwarning_flag4': False, 'txpowerlowwarning_flag4': False, 'txpowerhighalarm_flag5': False, 'txpowerlowalarm_flag5': False, 'txpowerhighwarning_flag5': False, 'txpowerlowwarning_flag5': False, 'txpowerhighalarm_flag6': False, 'txpowerlowalarm_flag6': False, 'txpowerhighwarning_flag6': False, 'txpowerlowwarning_flag6': False, 'txpowerhighalarm_flag7': False, 'txpowerlowalarm_flag7': False, 'txpowerhighwarning_flag7': False, 'txpowerlowwarning_flag7': False, 'txpowerhighalarm_flag8': False, 'txpowerlowalarm_flag8': False, 'txpowerhighwarning_flag8': False, 'txpowerlowwarning_flag8': False, 'rxpowerhighalarm_flag1': False, 'rxpowerlowalarm_flag1': False, 'rxpowerhighwarning_flag1': False, 'rxpowerlowwarning_flag1': False, 'rxpowerhighalarm_flag2': False, 'rxpowerlowalarm_flag2': False, 'rxpowerhighwarning_flag2': False, 'rxpowerlowwarning_flag2': False, 'rxpowerhighalarm_flag3': False, 'rxpowerlowalarm_flag3': False, 'rxpowerhighwarning_flag3': False, 'rxpowerlowwarning_flag3': False, 'rxpowerhighalarm_flag4': False, 'rxpowerlowalarm_flag4': False, 'rxpowerhighwarning_flag4': False, 'rxpowerlowwarning_flag4': False, 'rxpowerhighalarm_flag5': False, 'rxpowerlowalarm_flag5': False, 'rxpowerhighwarning_flag5': False, 'rxpowerlowwarning_flag5': False, 'rxpowerhighalarm_flag6': False, 'rxpowerlowalarm_flag6': False, 'rxpowerhighwarning_flag6': False, 'rxpowerlowwarning_flag6': False, 'rxpowerhighalarm_flag7': False, 'rxpowerlowalarm_flag7': False, 'rxpowerhighwarning_flag7': False, 'rxpowerlowwarning_flag7': False, 'rxpowerhighalarm_flag8': False, 'rxpowerlowalarm_flag8': False, 'rxpowerhighwarning_flag8': False, 'rxpowerlowwarning_flag8': False, 'txbiashighalarm_flag1': False, 'txbiaslowalarm_flag1': False, 'txbiashighwarning_flag1': False, 'txbiaslowwarning_flag1': False, 'txbiashighalarm_flag2': False, 'txbiaslowalarm_flag2': False, 'txbiashighwarning_flag2': False, 'txbiaslowwarning_flag2': False, 'txbiashighalarm_flag3': False, 'txbiaslowalarm_flag3': False, 'txbiashighwarning_flag3': False, 'txbiaslowwarning_flag3': False, 'txbiashighalarm_flag4': False, 'txbiaslowalarm_flag4': False, 'txbiashighwarning_flag4': False, 'txbiaslowwarning_flag4': False, 'txbiashighalarm_flag5': False, 'txbiaslowalarm_flag5': False, 'txbiashighwarning_flag5': False, 'txbiaslowwarning_flag5': False, 'txbiashighalarm_flag6': False, 'txbiaslowalarm_flag6': False, 'txbiashighwarning_flag6': False, 'txbiaslowwarning_flag6': False, 'txbiashighalarm_flag7': False, 'txbiaslowalarm_flag7': False, 'txbiashighwarning_flag7': False, 'txbiaslowwarning_flag7': False, 'txbiashighalarm_flag8': False, 'txbiaslowalarm_flag8': False, 'txbiashighwarning_flag8': False, 'txbiaslowwarning_flag8': False}

Additional Information (Optional)

@prgeor
Copy link
Collaborator

prgeor commented Apr 11, 2023

@longhuan-cisco could you please paste the sample output in the PR description?

@prgeor prgeor requested a review from keboliu April 11, 2023 19:53
@prgeor
Copy link
Collaborator

prgeor commented Apr 11, 2023

@keboliu
Copy link
Collaborator

keboliu commented Apr 13, 2023

How will the exiting CLI output will be impacted? for example: show interface transceiver eeprom -d ?

@longhuan-cisco
Copy link
Contributor Author

@longhuan-cisco could you please paste the sample output in the PR description?

sample output added.

@longhuan-cisco
Copy link
Contributor Author

@longhuan-cisco could you run the sonic-mgmt test https://github.com/sonic-net/sonic-mgmt/blob/master/tests/platform_tests/api/test_sfp.py

yea, verified it.

@longhuan-cisco
Copy link
Contributor Author

How will the exiting CLI output will be impacted? for example: show interface transceiver eeprom -d ?

today's eeprom --dom CLI doesn't display those rx_los/tx_fault/tx_disable/tx_disabled_channel fields, so no impact

@longhuan-cisco longhuan-cisco changed the title Move tx_disable/tx_disabled_channel to get_transceiver_status API Move tx_disable/tx_disabled_channel/rx_los/tx_fault to get_transceiver_status API May 10, 2023
@longhuan-cisco
Copy link
Contributor Author

@prgeor I've addressed the comments, could you take a look plz?

@prgeor
Copy link
Collaborator

prgeor commented May 31, 2023

@longhuan-cisco in the description i read two times the same API:-

Move tx_disable/tx_disabled_channel from get_transceiver_status API (which serves DOM_SENSOR table) to get_transceiver_status

did u mean get_transceiver_bulk_status?

For motiviation and context can you instead point to the HLD?

@prgeor prgeor merged commit 285a4dd into sonic-net:master May 31, 2023
3 checks passed
@mihirpat1
Copy link
Contributor

@yxieca @StormLiangMS - Can you please help with cherry-pick for this to 202205 and 202211
ADO - 24559386

longhuan-cisco added a commit to longhuan-cisco/sonic-platform-common that referenced this pull request Aug 21, 2023
yxieca pushed a commit that referenced this pull request Aug 23, 2023
…r_status API (#359) (#395)

Cherry pick below PR Move tx_disable/tx_disabled_channel/rx_los/tx_fault to get_transceiver_status API to 202205 branch.
Auto-cherry-pick has conflicts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants