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

[SfpUtil] sfp eeprom with option dom is not working on Xcvrs with flat memory #3385

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

mihirpat1
Copy link
Contributor

@mihirpat1 mihirpat1 commented Jun 25, 2024

What I did

fixes sonic-net/sonic-buildimage#19032

sfputil show eeprom -d -p Ethernet0 command is failing for CMIS flat memory modules with a traceback.

root@switch/home/admin# sfputil show eeprom -d -p Ethernet0
Traceback (most recent call last):
  File "/usr/local/bin/sfputil", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/sfputil/main.py", line 677, in eeprom
    xcvr_dom_info = platform_chassis.get_sfp(physical_port).get_transceiver_bulk_status()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/sonic_platform_base/sonic_xcvr/sfp_optoe_base.py", line 32, in get_transceiver_bulk_status
    return api.get_transceiver_bulk_status() if api is not None else None
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/sonic_platform_base/sonic_xcvr/api/public/cmis.py", line 233, in get_transceiver_bulk_status
    self.vdm_dict = self.get_vdm(self.vdm.VDM_REAL_VALUE)
                                 ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'VDM_REAL_VALUE'

MSFT ADO - 28363057

How I did it

After sonic-net/sonic-platform-common#397 was merged, the below line was added
self.vdm_dict = self.get_vdm(self.vdm.VDM_REAL_VALUE).
However, for certain CMIS flat memory modules, self.vdm could be None due to https://github.com/sonic-net/sonic-platform-common/blob/8e673d5cfcb9ee184950f4fb1d32f999cbb39735/sonic_platform_base/sonic_xcvr/api/public/cmis.py#L31
Hence, since such flat memory modules do not have DOM information, we need to skip displaying DOM information for such modules (similar to the fix done via sonic-net/sonic-platform-daemons#458).

How to verify it

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

root@sonic:/var/log# sfputil show eeprom -d -p Ethernet4
Ethernet4: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: 64B/66B
        Extended Identifier: Power Class 1 Module (1.5W max.), No CLEI code present in Page 02h, No CDR in TX, No CDR in RX
        Extended RateSelect Compliance: Unknown
        Identifier: QSFP28 or later
        Length Cable Assembly(m): 1.0
        Nominal Bit Rate(100Mbs): 255
        Specification compliance:
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Extended Specification Compliance: 100GBASE-CR4, 25GBASE-CR CA-25G-L or 50GBASE-CR2 with RS
                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): 2019-10-23   
        Vendor Name: AAAA    
        Vendor OUI: 78-a7-14
        Vendor PN: YYYY   
        Vendor Rev: P 
        Vendor SN: XXXX
        ChannelMonitorValues:
                TX1Bias: 0.0mA
                TX2Bias: 0.0mA
                TX3Bias: 0.0mA
                TX4Bias: 0.0mA
        ChannelThresholdValues:
        ModuleMonitorValues:
        ModuleThresholdValues:


root@sonic:/var/log# 

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

root@sonic:/var/log# sfputil show eeprom -d -p Ethernet4
Ethernet4: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: No separable connector
        Encoding: 64B/66B
        Extended Identifier: Power Class 1 Module (1.5W max.), No CLEI code present in Page 02h, No CDR in TX, No CDR in RX
        Extended RateSelect Compliance: Unknown
        Identifier: QSFP28 or later
        Length Cable Assembly(m): 1.0
        Nominal Bit Rate(100Mbs): 255
        Specification compliance:
                10/40G Ethernet Compliance Code: 40GBASE-CR4
                Extended Specification Compliance: 100GBASE-CR4, 25GBASE-CR CA-25G-L or 50GBASE-CR2 with RS
                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): 2019-10-23   
        Vendor Name: AAAA    
        Vendor OUI: 78-a7-14
        Vendor PN: YYYY   
        Vendor Rev: P 
        Vendor SN: XXXX
DOM values not supported for flat memory module

root@sonic:/var/log# 

@mihirpat1 mihirpat1 added the Bug label Jun 25, 2024
Copy link
Contributor

@prgeor prgeor left a comment

Choose a reason for hiding this comment

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

@prgeor PR looks OK, but its in draft

@mihirpat1 mihirpat1 marked this pull request as ready for review July 18, 2024 22:47
@mihirpat1
Copy link
Contributor Author

@prgeor PR looks OK, but its in draft

@prgeor I have published the PR now.

@prgeor prgeor merged commit f2b7621 into sonic-net:master Jul 18, 2024
7 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Jul 19, 2024
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #3434

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.

[SfpUtil] sfp eeprom with option dom is not working on Xcvrs with flat memory
5 participants