[xcvrd] Skip VDM threshold DB update for flat memory transceivers#595
Merged
prgeor merged 4 commits intosonic-net:masterfrom Mar 18, 2025
Merged
[xcvrd] Skip VDM threshold DB update for flat memory transceivers#595prgeor merged 4 commits intosonic-net:masterfrom
prgeor merged 4 commits intosonic-net:masterfrom
Conversation
…vers Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR prevents updates of VDM threshold data in the DB for flat memory transceivers, addressing crashes caused when trying to read threshold values on optics that do not support VDM. Key changes include:
- Skipping DB updates in db_utils when a transceiver is flat memory
- Adding tests to verify behavior for both flat memory and non-flat memory transceivers
- Introducing the is_transceiver_flat_memory utility method in the common utilities
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| sonic-xcvrd/tests/test_xcvrd.py | Added tests for flat memory handling and verifying that no DB update occurs when transceiver is flat memory |
| sonic-xcvrd/xcvrd/xcvrd_utilities/utils.py | Introduced is_transceiver_flat_memory to determine flat memory condition based on the transceiver API |
| sonic-xcvrd/xcvrd/dom/utilities/vdm/db_utils.py | Modified DB update function to skip updating when a transceiver is flat memory |
Comments suppressed due to low confidence (2)
sonic-xcvrd/xcvrd/dom/utilities/vdm/db_utils.py:94
- [nitpick] Consider adding a log message before returning when a transceiver is identified as flat memory to provide better traceability in production.
if self.xcvrd_utils.is_transceiver_flat_memory(physical_port):
sonic-xcvrd/tests/test_xcvrd.py:622
- [nitpick] Consider adding an assertion to verify that VDM thresholds are correctly updated when the transceiver supports VDM (i.e. when is_transceiver_flat_memory returns False).
vdm_db_utils.xcvrd_utils.is_transceiver_flat_memory = MagicMock(return_value=False)
prgeor
approved these changes
Mar 18, 2025
Collaborator
|
Cherry-pick PR to msft-202412: Azure/sonic-platform-daemons.msft#11 |
mihirpat1
added a commit
to mihirpat1/sonic-platform-daemons
that referenced
this pull request
May 6, 2025
…nic-net#595) * Skip VDM threshold DB update for copper or flat memory based transceivers Signed-off-by: Mihir Patel <patelmi@microsoft.com> * Simplified if check * Removed is_copper check * Removed is_copper check from test case --------- Signed-off-by: Mihir Patel <patelmi@microsoft.com>
lotus-nexthop
pushed a commit
to lotus-nexthop/sonic-platform-daemons
that referenced
this pull request
Oct 28, 2025
…eric health ID for other brands (sonic-net#595) Description Fix health check for SSD vendors: add a parser for ATP, and add a generic health ID for other brands. Each vendor stores health information in different SMART attributes. ATP stores it in attribute ID 248, we add a parser for it. We also have SSDs use Attribute ID 231 and it is commonly used, so add it in the generic parser. Skip obtaining vendor SSD info for ATP and Virtium NVMe SSD because they are handle by parse_generic_ssd_info and parse_vendor_ssd_info will overwrite data with N/A. Add unit test cases for ATP SATA/NVMe SSD. Motivation and Context show platform ssdhealth shows N/A health for some qualified SSDs. Back port request 202412 202505 How Has This Been Tested? We have tested the code change on DUTs with different SSDs including all the qualified SSDs that show N/A in health and also on the ones that worked fine before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The following traceback is seen with the latest image for DAC cables.
Motivation and Context
With #582 merged, we are now updating the VDM threshold data for all types of transceivers.
However, for transceivers which are CMIS compliant but have flat memory, they don't have VDM support. The driver handler for fetching the VDM threshold data does not check if the CMIS transceiver supports VDM or not, which causes xcvrd to crash.
https://github.com/sonic-net/sonic-platform-common/blob/e5aedb6bab10a16d0167488eb9e291805c397c8f/sonic_platform_base/sonic_xcvr/api/public/cmis.py#L2619
To address this issue, ensure that a transceiver is flat memory based before reading the VDM threshold data from the transceiver.
How Has This Been Tested?
3.1 CMIS optics not supporting VDM + does not have flat memory
3.2 CMIS optics but has flat memory
3.3 10G SFP
Additional Information (Optional)
MSFT ADO - 31849344