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

Gracefully handle CMIS APIs for passive modules #238

Merged
merged 6 commits into from
Nov 27, 2021

Conversation

prgeor
Copy link
Collaborator

@prgeor prgeor commented Nov 22, 2021

Signed-off-by: Prince George prgeor@microsoft.com

Description

QSFP-DD modules' upper page read fails resulting in failure to read various fields in upper page.
Ensured APIs reading upper page is only for Active modules.

Motivation and Context

Fixes #234

How Has This Been Tested?

sfputil show eeprom -d

  1. For AOC
root@sonic:~# sfputil show eeprom -d -p Ethernet32
WARNING: api_use_sfpoptoe attr type changed: old <class 'bool'>, new <class 'str'>
Ethernet32: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: LC
        Encoding: N/A
        Extended Identifier: Power Class 8 (18.0W Max)
        Extended RateSelect Compliance: N/A
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        Length Cable Assembly(m): 0.0
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: Single Mode Fiber (SMF)
        Vendor Date Code(YYYY-MM-DD Lot): 2020-11-19 
        Vendor Name: INPHI CORP      
        Vendor OUI: 00-21-b8
        Vendor PN: IN-Q3JZ1-TC     
        Vendor Rev: 0.0
        Vendor SN: L2047D0067A     
        ChannelMonitorValues:
                RX1Power: 0.0dBm
                RX2Power: 0.0dBm
                RX3Power: 0.0dBm
                RX4Power: 0.0dBm
                RX5Power: 0.0dBm
                RX6Power: 0.0dBm
                RX7Power: 0.0dBm
                RX8Power: 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
                TX5Bias: 0.0mA
                TX5Power: 0.0dBm
                TX6Bias: 0.0mA
                TX6Power: 0.0dBm
                TX7Bias: 0.0mA
                TX7Power: 0.0dBm
                TX8Bias: 0.0mA
                TX8Power: 0.0dBm
        ChannelThresholdValues:
                RxPowerHighAlarm  : 2.0dBm
                RxPowerHighWarning: 0.0dBm
                RxPowerLowAlarm   : -21.024dBm
                RxPowerLowWarning : -18.013dBm
                TxBiasHighAlarm   : 62.5mA
                TxBiasHighWarning : 57.5mA
                TxBiasLowAlarm    : 42.5mA
                TxBiasLowWarning  : 47.5mA
                TxPowerHighAlarm  : -5.0dBm
                TxPowerHighWarning: -6.0dBm
                TxPowerLowAlarm   : -16.99dBm
                TxPowerLowWarning : -16.003dBm
        ModuleMonitorValues:
                Temperature: 2.352C
                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


root@sonic:~# 
  1. For DAC
root@str2-z9332f-05:~# sfputil show eeprom -d -p Ethernet0
Ethernet0: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: N/A
        Extended Identifier: Power Class 1 (0.5W Max)
        Extended RateSelect Compliance: N/A
        Identifier: QSFP-DD Double Density 8X Pluggable Transceiver
        Length Cable Assembly(m): 1
        Nominal Bit Rate(100Mbs): 0
        Specification compliance: N/A
        Vendor Date Code(YYYY-MM-DD Lot): 2020-06-20   
        Vendor Name: DELL EMC        
        Vendor OUI: 3c-18-a0
        Vendor PN: 22V6R           
        Vendor Rev: 0.0
        Vendor SN: CN0LXD0006KI957 
        ChannelMonitorValues:
        ChannelThresholdValues:
        ModuleMonitorValues:
        ModuleThresholdValues:


root@str2-z9332f-05:~# 
```

#### Additional Information (Optional)

Signed-off-by: Prince George <prgeor@microsoft.com>
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
Signed-off-by: Prince George <prgeor@microsoft.com>
@prgeor prgeor added the Bug label Nov 23, 2021
aravindmani-1
aravindmani-1 previously approved these changes Nov 23, 2021
@prgeor
Copy link
Collaborator Author

prgeor commented Nov 24, 2021

@lguohan can you review/approve?

lguohan
lguohan previously approved these changes Nov 24, 2021
vdahiya12
vdahiya12 previously approved these changes Nov 24, 2021
sonic_platform_base/sonic_xcvr/fields/consts.py Outdated Show resolved Hide resolved
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
sonic_platform_base/sonic_xcvr/api/public/cmis.py Outdated Show resolved Hide resolved
@prgeor prgeor dismissed stale reviews from vdahiya12 and lguohan via 4f77aa6 November 25, 2021 16:22
@prgeor prgeor merged commit c1f317d into sonic-net:master Nov 27, 2021
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this pull request Oct 25, 2024
Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com

Description
This PR refactors some of the message handling for CLI transactions' by ycabled for muxcable
Particularly these CLI commands handling is refactored

show mux hwmode mux <port>
show mux hwmode switchmode <port>
config mux hwmode state <port>
config mux hwmode setswitchmode <port>
config mux firmware download/activate/rollback <port>
show mux firmware version <port>
With this PR all these notifications will be covered by Unit-Tests in our code

Motivation and Context
This PR is required to increase the code coverage of ycabled and attain a coverage of > 75%
This PR also removes refactors some code blocks which were not covered by UT

How Has This Been Tested?
Ran the Unit-tests to the corresponding changes
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SFP-refactor] xcvrd crashes while trying to read CMIS passive cables
5 participants