Skip to content

Implement get_transceiver_dom_flags for SFF-8636 modules - #730

Open
lotus-nexthop wants to merge 2 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 2 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.

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.

How Has This Been Tested?

Validated live on hardware

Before fix

$ show platform temperature
                      Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
...
         xSFP module 35 Temp          0            N/A       N/A             N/A            N/A        N/A  20260731 23:38:42
         xSFP module 36 Temp          0            N/A       N/A             N/A            N/A        N/A  20260731 23:38:42
         xSFP module 37 Temp          0            N/A       N/A             N/A            N/A        N/A  20260731 23:38:42
         xSFP module 38 Temp          0            N/A       N/A             N/A            N/A        N/A  20260731 23:38:42

After fix

$ show platform temperature
                     Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
----------------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
...
         xSFP module 36 Temp          0            N/A       N/A             N/A            N/A      False  20260801 00:46:25
         xSFP module 37 Temp          0            N/A       N/A             N/A            N/A      False  20260801 00:46:25
         xSFP module 38 Temp          0            N/A       N/A             N/A            N/A      False  20260801 00:46:25

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).

Signed-off-by: lotus-nexthop <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 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 on lines +309 to +311
# The flag latches clear on read: each byte must be read exactly
# once per call, in a single whole-byte access.
assert self.api.xcvr_eeprom.read.call_count == 2
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