Skip to content

Implement get_transceiver_dom_flags for SFF-8636 modules - #730

Open
lotus-nexthop wants to merge 3 commits into
sonic-net:masterfrom
nexthop-ai:implement-get-transceiver-dom-flags-sff
Open

Implement get_transceiver_dom_flags for SFF-8636 modules#730
lotus-nexthop wants to merge 3 commits into
sonic-net:masterfrom
nexthop-ai:implement-get-transceiver-dom-flags-sff

Conversation

@lotus-nexthop

@lotus-nexthop lotus-nexthop commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Implement get_transceiver_dom_flags() on Sff8636Api, reading the latched free side monitor interrupt flags (SFF-8636 Rev 2.12 Table 6-6, lower page 00h byte 6 = temperature, byte 7 = supply voltage, bits 7–4). The returned dict uses the same key schema as the CMIS implementation.

Gate temperature flags behind temperature monitoring support.
Gate Vcc flags behind voltage monitoring support.

Fixes sonic-net/sonic-buildimage#28779

Motivation and Context

show platform temperature reports Warning=N/A for every xSFP row backed by a non-CMIS (SFF-8636/QSFP28) module.
get_transceiver_dom_flags() was only ever implemented for CMIS/eLSFP; for SFF-8636 the base class raises NotImplementedError, so xcvrd silently skips writing TRANSCEIVER_DOM_FLAG for those ports. This gap was latent until two upstream changes merged 2026-05-13 moved the Warning column's source onto that table:

  • sonic-net/sonic-platform-daemons#808 removed per-SFP rows from thermalctld's TEMPERATURE_INFO (perf fix). thermalctld had computed warning_status leniently — missing data defaulted to False.
  • sonic-net/sonic-utilities#4522 made tempershow build xSFP rows from xcvrd's DOM tables, deriving Warning from TRANSCEIVER_DOM_FLAG and rendering N/A when absent.

Spec here:
https://members.snia.org/document/dl/26418
Screenshot 2026-08-05 at 2 00 31 PM

How Has This Been Tested?

Valiated on the following optical 8636 modules:

  • Ethernet0 (module 1) supports temperature and voltage monitoring
  • Ethernet64 (module 17) does not support temperature and does not support voltage monitoring.
Ethernet0: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: MPO 1x12
        Encoding: NRZ
        Extended Identifier: Power Class 4 Module (3.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): 2.0
        Nominal Bit Rate(100Mbs): 255
        Specification compliance:
                10/40G Ethernet Compliance Code: Extended
                Extended Specification Compliance: 100G PSM4 Parallel SMF
                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): 2025-05-01 19
        Vendor Name: INNOLIGHT
        Vendor OUI: 44-7c-7f
        Vendor PN: TR-VC13T-N00
        Vendor Rev: 4A
        Vendor SN: IWPAQ3770297
        dom_capability: N/A
        is_replaceable: True


Ethernet64: SFP EEPROM detected
        Application Advertisement: N/A
        Connector: MPO 1x12
        Encoding: NRZ
        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: 100G PSM4 Parallel SMF
                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): 2025-09-04
        Vendor Name: CISCO-AXIOM
        Vendor OUI: 18-f6-97
        Vendor PN: Q-100G-PSM4-S-AX
        Vendor Rev: 0M
        Vendor SN: AXMPQ28A13316
        dom_capability: N/A
        is_replaceable: True

Before fix

admin@humm171:~$ sonic-db-cli STATE_DB hgetall "TRANSCEIVER_DOM_FLAG|Ethernet0"
{}
admin@humm171:~$ sonic-db-cli STATE_DB hgetall "TRANSCEIVER_DOM_FLAG|Ethernet64"
{}

admin@humm171:~$ show platform temperature
                      Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
…
          xSFP module 1 Temp         22.5           70       0.0            75.0           -5.0        N/A  20260806 01:47:36
…
         xSFP module 17 Temp          0             75      -5.0            80.0          -10.0        N/A  20260806 01:47:36
…

After fix

admin@humm171:~$ sonic-db-cli STATE_DB hgetall "TRANSCEIVER_DOM_FLAG|Ethernet0"
{'tempHAlarm': 'False', 'tempLAlarm': 'False', 'tempHWarn': 'False', 'tempLWarn': 'False', 'vccHAlarm': 'False', 'vccLAlarm': 'False', 'vccHWarn': 'False', 'vccLWarn': 'False', 'last_update_time': 'Thu Aug 06 01:56:55 2026'}
admin@humm171:~$ sonic-db-cli STATE_DB hgetall "TRANSCEIVER_DOM_FLAG|Ethernet64"
{}

admin@humm171:~$ show platform temperature
                      Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
…
          xSFP module 1 Temp         21.562         70       0.0            75.0           -5.0      False  20260806 02:09:08
…
         xSFP module 17 Temp          0             75      -5.0            80.0          -10.0        N/A  20260806 02:09:08

Additional Information (Optional)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@lotus-nexthop
lotus-nexthop marked this pull request as draft August 1, 2026 00:07
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@lotus-nexthop
lotus-nexthop force-pushed the implement-get-transceiver-dom-flags-sff branch from a5ac335 to 3c35d77 Compare August 1, 2026 19:52
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@lotus-nexthop
lotus-nexthop force-pushed the implement-get-transceiver-dom-flags-sff branch from 3c35d77 to ef8cc05 Compare August 1, 2026 19:57
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@lotus-nexthop
lotus-nexthop marked this pull request as ready for review August 1, 2026 20:10
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@lotus-nexthop
lotus-nexthop requested a review from prgeor August 1, 2026 20:13
@prgeor

prgeor commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

@lotus-nexthop why are these fields still showing NA? Don't we need to fix?

Temperature High TH Low TH Crit High TH Crit Low TH

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the sonic_platform_base transceiver abstraction by implementing get_transceiver_dom_flags() for SFF-8636 (QSFP28) modules, aligning its returned flag schema with the existing CMIS implementation so higher-level consumers can uniformly populate TRANSCEIVER_DOM_FLAG.

Changes:

  • Implement Sff8636Api.get_transceiver_dom_flags() by reading and decoding the latched interrupt flag bytes for temperature and Vcc.
  • Add new EEPROM field definitions (TempFlags, VccFlags) to the SFF-8636 public memory map and constants.
  • Add pytest coverage for the new DOM-flag decoding behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/sonic_xcvr/test_sff8636.py Adds unit tests validating SFF-8636 DOM flag decoding and EEPROM read behavior.
sonic_platform_base/sonic_xcvr/mem_maps/public/sff8636.py Adds whole-byte fields for the latched temp/Vcc flag bytes to avoid per-bit clearing reads.
sonic_platform_base/sonic_xcvr/fields/consts.py Introduces new field-name constants used by the SFF-8636 mem map and API.
sonic_platform_base/sonic_xcvr/api/public/sff8636.py Implements DOM flag retrieval/decoding for SFF-8636 modules using the CMIS-compatible key schema.

Comment thread tests/sonic_xcvr/test_sff8636.py Outdated
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@lotus-nexthop

lotus-nexthop commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@lotus-nexthop why are these fields still showing NA? Don't we need to fix?

Temperature High TH Low TH Crit High TH Crit Low TH

thanks @prgeor, I updated the PR to now gate behind whether the module supports temperature monitoring before reporting the temperature flags, same for the Vcc flags.

Previously I tested on passive DAC, hence the N/A.

Please take a look at the updated PR descripton with testing on SFF-8636 optics which support reading temperature.

Signed-off-by: lotus-nexthop <lotus@nexthop.ai>
Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
Signed-off-by: Lotus Fenn <lotus@nexthop.ai>
@lotus-nexthop
lotus-nexthop force-pushed the implement-get-transceiver-dom-flags-sff branch from 4c24f55 to 9ffaa52 Compare August 6, 2026 02:24
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

Bug: SFF-8636 modules reporting warning=N/A in show platform temperature

4 participants