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

Add transceiver-info items advertised for cmis-supported moddules #2135

Conversation

qinchuanares
Copy link
Contributor

@qinchuanares qinchuanares commented Apr 13, 2022

General purpose

This PR intends to include the recent changes made in the following two PRs from sonic-platform-common into sfputil CLI

sonic-net/sonic-platform-common#228
sonic-net/sonic-platform-common#235

Description

The update transceiver info can be referenced to the HLD here.

What I did

Include more transceiver info items for module supporting CMIS and C-CMIS.
After we introduce the support for CMIS and C-CMIS memory map in xcvr_api in sonic-platform-common, we want to adopt the changes in sfputil by starting with updating the transceiver info output. After update, the new CLI output include:

  • Active Firmware Version
  • Inactive Firmware Version
  • Hardware Revision
  • Media Interface Code
  • Host Electrical Interface
  • Host Lane Count
  • Media Lane Count
  • Host Lane Assignment Options
  • Media Lane Assignment Options
  • Active App Selection Host Lane 1
  • Active App Selection Host Lane 2
  • Active App Selection Host Lane 3
  • Active App Selection Host Lane 4
  • Active App Selection Host Lane 5
  • Active App Selection Host Lane 6
  • Active App Selection Host Lane 7
  • Active App Selection Host Lane 8
  • Media Interface Technology
  • CMIS Revision
  • Supported Max TX Power (C-CMIS specific)
  • Supported Min TX Power (C-CMIS specific)
  • Supported Max Laser Frequency (C-CMIS specific)
  • Supported Max Laser Frequency (C-CMIS specific)

How I did it

I introduced a new data map dictionary QSFP_DD_DATA_MAP, and modified convert_sfp_info_to_output_string() in sfputil/main.py to adopt both non-CMIS- and CMIS-compliant module types.

How to verify it

I tried on both non-CMIS- and CMIS-compliant module types on Arista 7060DX4 switch.

Previous command output (if the output of a command-line utility has changed)

This is an example of a non-CMIS-compliant InPhi DWDM module:

admin@sonic:~$ sudo sfputil show eeprom -d -p Ethernet192
Ethernet192: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: LC
        Encoding: PAM4
        Extended Identifier: Unknown, No CLEI code present in Page 02h, CDR present in TX, CDR present in RX
        Extended RateSelect Compliance: Unknown
        Identifier: QSFP28 or later
        Length(km): 80.0
        Nominal Bit Rate(100Mbs): 255
        Specification compliance:
                10/40G Ethernet Compliance Code: Extended
                Extended Specification Compliance: 100GE-DWDM2
                Fibre Channel Link Length: Unknown
                Fibre Channel Speed: Unknown
                Fibre Channel Transmission Media: Unknown
                Fibre Channel Transmitter Technology: Unknown
                Gigabit Ethernet Compliant Codes: Unknown
                SAS/SATA Compliance Codes: Unknown
                SONET Compliance Codes: Unknown
        Vendor Date Code(YYYY-MM-DD Lot): 2017-02-08   
        Vendor Name: INPHI CORP      
        Vendor OUI: 00-21-b8
        Vendor PN: IN-Q2AY2-45-M1  
        Vendor Rev: 10
        Vendor SN: L164200324      
        ChannelMonitorValues:
                RX1Power: 0.0dBm
                RX2Power: 0.0dBm
                RX3Power: 0.0dBm
                RX4Power: 0.0dBm
                TX1Bias: 0.0mA
                TX1Power: 0.0dBm
                TX2Bias: 0.0mA
                TX2Power: 0.0dBm
                TX3Bias: 0.0mA
                TX3Power: 0.0dBm
                TX4Bias: 0.0mA
                TX4Power: 0.0dBm
        ChannelThresholdValues:
                RxPowerHighAlarm  : 8.165dBm
                RxPowerHighWarning: 7.0dBm
                RxPowerLowAlarm   : -5.0dBm
                RxPowerLowWarning : -3.0dBm
                TxBiasHighAlarm   : 131.0mA
                TxBiasHighWarning : 120.0mA
                TxBiasLowAlarm    : 30.0mA
                TxBiasLowWarning  : 35.0mA
        ModuleMonitorValues:
                Temperature: 0.0C
                Vcc: 3.407Volts
        ModuleThresholdValues:
                TempHighAlarm  : 72.0C
                TempHighWarning: 67.0C
                TempLowAlarm   : 18.0C
                TempLowWarning : 23.0C
                VccHighAlarm   : 3.564Volts
                VccHighWarning : 3.465Volts
                VccLowAlarm    : 3.036Volts
                VccLowWarning  : 3.135Volts

This is an example of a non-CMIS-compliant Molex DR module:

admin@sonic:~$ sudo sfputil show eeprom -d -p Ethernet224 Ethernet224: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: LC
        Encoding: 64B/66B
        Extended Identifier: Power Class 6 Module (4.5W max.), No CLEI code present in Page 02h, CDR present in TX, CDR present in RX
        Extended RateSelect Compliance: Unknown
        Identifier: QSFP28 or later
        Length(km): 1.0
        Nominal Bit Rate(100Mbs): 255
        Specification compliance:
                10/40G Ethernet Compliance Code: Extended
                Extended Specification Compliance: 100GBASE-DR
                Fibre Channel Link Length: Unknown
                Fibre Channel Speed: Unknown
                Fibre Channel Transmission Media: Unknown
                Fibre Channel Transmitter Technology: Unknown
                Gigabit Ethernet Compliant Codes: Unknown
                SAS/SATA Compliance Codes: Unknown
                SONET Compliance Codes: Unknown
        Vendor Date Code(YYYY-MM-DD Lot): 2021-02-22   
        Vendor Name: MOLEX           
        Vendor OUI: 00-09-3a
        Vendor PN: 1064273500      
        Vendor Rev: 11
        Vendor SN: G21081R1177     
        ChannelMonitorValues:
                RX1Power: 0.0dBm
                RX2Power: 0.0dBm
                RX3Power: 0.0dBm
                RX4Power: 0.0dBm
                TX1Bias: 0.0mA
                TX1Power: 0.0dBm
                TX2Bias: 0.0mA
                TX2Power: 0.0dBm
                TX3Bias: 0.0mA
                TX3Power: 0.0dBm
                TX4Bias: 0.0mA
                TX4Power: 0.0dBm
        ChannelThresholdValues:
                RxPowerHighAlarm  : 5.0dBm
                RxPowerHighWarning: 4.5dBm
                RxPowerLowAlarm   : -8.901dBm
                RxPowerLowWarning : -6.899dBm
                TxBiasHighAlarm   : 120.0mA
                TxBiasHighWarning : 116.0mA
                TxBiasLowAlarm    : 10.0mA
                TxBiasLowWarning  : 14.0mA
        ModuleMonitorValues:
                Temperature: 22.43C
                Vcc: 3.358Volts
        ModuleThresholdValues:
                TempHighAlarm  : 75.0C
                TempHighWarning: 72.0C
                TempLowAlarm   : -5.0C
                TempLowWarning : -2.0C
                VccHighAlarm   : 3.51Volts
                VccHighWarning : 3.495Volts
                VccLowAlarm    : 3.1Volts
                VccLowWarning  : 3.115Volts

New command output (if the output of a command-line utility has changed)

This is an example of CMIS-compliant XXX 400ZR module. To protect vendor proprietary info, I removed some of the information in the output.

admin@sonic:~$ sudo sfputil show eeprom -d -p Ethernet160
Ethernet160: SFP EEPROM detected
        Active App Selection Host Lane 1: 1
        Active App Selection Host Lane 2: 1
        Active App Selection Host Lane 3: 1
        Active App Selection Host Lane 4: 1
        Active App Selection Host Lane 5: 1
        Active App Selection Host Lane 6: 1
        Active App Selection Host Lane 7: 1
        Active App Selection Host Lane 8: 1
        Active Firmware Version: x.x
        CMIS Revision: 5.0
        Connector: LC
        Encoding: N/A
        Extended Identifier: Power Class 8 (18.0W Max)
        Extended RateSelect Compliance: N/A
        Hardware Revision: 0.0
        Host Electrical Interface: 400GAUI-8 C2M (Annex 120E)
        Host Lane Assignment Options: 1
        Host Lane Count: 8
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        Inactive Firmware Version: 0.0
        Length Cable Assembly(m): 0.0
        Media Interface Code: 400ZR, DWDM, amplified
        Media Interface Technology: C-band tunable laser
        Media Lane Assignment Options: 1
        Media Lane Count: 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: sm_media_interface
        Supported Max Laser Frequency: 196100GHz
        Supported Max TX Power: -9.8dBm
        Supported Min Laser Frequency: 191300GHz
        Supported Min TX Power: -14.0dBm
        Vendor Date Code(YYYY-MM-DD Lot): 2020-10-20 
        Vendor Name: XXXXXX    
        Vendor OUI: XX-XX-XX
        Vendor PN: XXXXXX  
        Vendor Rev: 01
        Vendor SN: XXXXXX
        ChannelMonitorValues:
                RX1Power: -36.98970004336019dBm
                RX2Power: -infdBm
                RX3Power: -infdBm
                RX4Power: -infdBm
                RX5Power: -infdBm
                RX6Power: -infdBm
                RX7Power: -infdBm
                RX8Power: -infdBm
                TX1Bias: 250.696mA
                TX1Power: -9.863203027088074dBm
                TX2Bias: 0.0mA
                TX2Power: -infdBm
                TX3Bias: 0.0mA
                TX3Power: -infdBm
                TX4Bias: 0.0mA
                TX4Power: -infdBm
                TX5Bias: 0.0mA
                TX5Power: -infdBm
                TX6Bias: 0.0mA
                TX6Power: -infdBm
                TX7Bias: 0.0mA
                TX7Power: -infdBm
                TX8Bias: 0.0mA
                TX8Power: -infdBm
        ChannelThresholdValues:
                RxPowerHighAlarm  : 2.0dBm
                RxPowerHighWarning: 0.0dBm
                RxPowerLowAlarm   : -21.024dBm
                RxPowerLowWarning : -18.013dBm
                TxBiasHighAlarm   : 450.0mA
                TxBiasHighWarning : 420.0mA
                TxBiasLowAlarm    : 100.0mA
                TxBiasLowWarning  : 110.0mA
                TxPowerHighAlarm  : -5.0dBm
                TxPowerHighWarning: -6.0dBm
                TxPowerLowAlarm   : -16.99dBm
                TxPowerLowWarning : -16.003dBm
        ModuleMonitorValues:
                Temperature: 73.957C
                Vcc: 3.347Volts
        ModuleThresholdValues:
                TempHighAlarm  : 80.0C
                TempHighWarning: 75.0C
                TempLowAlarm   : -5.0C
                TempLowWarning : 0.0C
                VccHighAlarm   : 3.45Volts
                VccHighWarning : 3.4Volts
                VccLowAlarm    : 3.1Volts
                VccLowWarning  : 3.15Volts

This is an example of CMIS-compliant Molex DR4 module.

admin@sonic:~$ sudo sfputil show eeprom -d -p Ethernet16
Ethernet16: SFP EEPROM detected
        Active App Selection Host Lane 1: 1
        Active App Selection Host Lane 2: 1
        Active App Selection Host Lane 3: 1
        Active App Selection Host Lane 4: 1
        Active App Selection Host Lane 5: 1
        Active App Selection Host Lane 6: 1
        Active App Selection Host Lane 7: 1
        Active App Selection Host Lane 8: 1
        Active Firmware Version: 3.1
        CMIS Revision: 4.0
        Connector: MPO 1x12
        Encoding: N/A
        Extended Identifier: Power Class 6 (12.0W Max)
        Extended RateSelect Compliance: N/A
        Hardware Revision: 1.1
        Host Electrical Interface: 400GAUI-8 C2M (Annex 120E)
        Host Lane Assignment Options: 1
        Host Lane Count: 8
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        Inactive Firmware Version: 3.1
        Length Cable Assembly(m): 0.0
        Media Interface Code: 400GBASE-DR4 (Cl 124)
        Media Interface Technology: 1310 nm DFB
        Media Lane Assignment Options: 1
        Media Lane Count: 4
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: sm_media_interface
        Supported Max Laser Frequency: N/A
        Supported Max TX Power: N/A
        Supported Min Laser Frequency: N/A
        Supported Min TX Power: N/A
        Vendor Date Code(YYYY-MM-DD Lot): 2021-05-24   
        Vendor Name: MOLEX           
        Vendor OUI: 00-09-3a
        Vendor PN: 1064281000      
        Vendor Rev: 11
        Vendor SN: G21211B3113     
        ChannelMonitorValues:
                RX1Power: -40.0dBm
                RX2Power: -40.0dBm
                RX3Power: -40.0dBm
                RX4Power: -40.0dBm
                RX5Power: -infdBm
                RX6Power: -infdBm
                RX7Power: -infdBm
                RX8Power: -infdBm
                TX1Bias: 185.72mA
                TX1Power: 2.5227034598832154dBm
                TX2Bias: 150.848mA
                TX2Power: 3.0436125422530793dBm
                TX3Bias: 186.008mA
                TX3Power: 2.9280966541729017dBm
                TX4Bias: 184.784mA
                TX4Power: 2.9187922391469745dBm
                TX5Bias: 0.0mA
                TX5Power: -infdBm
                TX6Bias: 0.0mA
                TX6Power: -infdBm
                TX7Bias: 0.0mA
                TX7Power: -infdBm
                TX8Bias: 0.0mA
                TX8Power: -infdBm
        ChannelThresholdValues:
                RxPowerHighAlarm  : 5.0dBm
                RxPowerHighWarning: 4.5dBm
                RxPowerLowAlarm   : -8.901dBm
                RxPowerLowWarning : -6.899dBm
                TxBiasHighAlarm   : 380.0mA
                TxBiasHighWarning : 352.0mA
                TxBiasLowAlarm    : 32.0mA
                TxBiasLowWarning  : 40.0mA
                TxPowerHighAlarm  : 5.0dBm
                TxPowerHighWarning: 4.5dBm
                TxPowerLowAlarm   : -3.401dBm
                TxPowerLowWarning : -2.901dBm
        ModuleMonitorValues:
                Temperature: 53.355C
                Vcc: 3.341Volts
        ModuleThresholdValues:
                TempHighAlarm  : 75.0C
                TempHighWarning: 72.0C
                TempLowAlarm   : -5.0C
                TempLowWarning : -2.0C
                VccHighAlarm   : 3.51Volts
                VccHighWarning : 3.495Volts
                VccLowAlarm    : 3.1Volts
                VccLowWarning  : 3.115Volts

@prgeor
Copy link
Contributor

prgeor commented May 9, 2022

@qinchuanares could you add the unit for these:-

 Supported Max Laser Frequency: 196100
 Supported Max TX Power: -9.8
 Supported Min Laser Frequency: 191300
 Supported Min TX Power: -14.0

Comment on lines +363 to +366
if sfp_info_dict['type'] == "QSFP-DD Double Density 8X Pluggable Transceiver" or \
sfp_info_dict['type'] == "OSFP 8X Pluggable Transceiver" or \
sfp_info_dict['type'] == "QSFP+ or later with CMIS":
output += '{}{}: {}\n'.format(indent, QSFP_DATA_MAP[key], sfp_info_dict[key])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this if condition will never be it because of if check at line 320

@prgeor prgeor merged commit 083ebcc into sonic-net:master May 10, 2022
@prgeor
Copy link
Contributor

prgeor commented May 10, 2022

@qinchuanares I just realized that this PR can result in Sfputil crash for non-ZR CMIS compliant modules https://github.com/Azure/sonic-platform-common/blob/cd692122cd3a7eaf0420121559f48aa937d37a8c/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py#L301 is NOT applicable for non-ZR. Can you fix this crash?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants