[xcvrd] Separate VDM basic and statistic observables#750
Merged
prgeor merged 8 commits intosonic-net:masterfrom Feb 19, 2026
Merged
[xcvrd] Separate VDM basic and statistic observables#750prgeor merged 8 commits intosonic-net:masterfrom
prgeor merged 8 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates xcvrd’s VDM (Vendor Diagnostic Monitoring) collection flow to separate “basic” (instantaneous) observables from “statistic/PM” observables, minimizing freeze/unfreeze usage and improving compatibility with modules that don’t support freeze.
Changes:
- Split VDM reads into basic vs statistic paths and conditionally freeze only when needed (and not in low-power mode).
- Add a DB utility method to post pre-merged VDM values in a single write with one
last_update_time. - Update and extend unit tests to cover the new VDM flow and freeze conditions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sonic-xcvrd/xcvrd/dom/utilities/vdm/utils.py | Adds new VDM capability + read helpers for basic/statistic observables. |
| sonic-xcvrd/xcvrd/dom/utilities/vdm/db_utils.py | Adds a new method to post merged VDM real-values dict directly to DB. |
| sonic-xcvrd/xcvrd/dom/dom_mgr.py | Restructures VDM polling into conditional freeze + merge + post + COR flag read. |
| sonic-xcvrd/tests/test_xcvrd.py | Updates existing tests and adds new cases validating freeze conditions and new APIs. |
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
reviewed
Feb 19, 2026
prgeor
reviewed
Feb 19, 2026
Signed-off-by: Mihir Patel <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
approved these changes
Feb 19, 2026
Collaborator
|
Cherry-pick PR to 202511: #753 |
mssonicbld
added a commit
to mssonicbld/sonic-platform-common
that referenced
this pull request
Feb 19, 2026
<!-- Provide a general summary of your changes in the Title above --> This PR must be merged along with sonic-net/sonic-platform-daemons#750 #### Description <!-- Describe your changes in detail --> Currently, the CMIS API treats all VDM observables uniformly, requiring freeze operations for all reads. However, CMIS specification distinguishes between: - Basic observables (instantaneous values like current BER, temperature) - Statistic observables (min/max/avg values that require freeze to capture consistently) This prevents optimization in xcvrd, which currently requires freeze operation even for modules that only support basic observables (where freeze may not be supported or necessary). Additionally, the API performs repeated EEPROM reads to check VDM support status, even though this capability bit is static for a given module. #### Motivation and Context <!-- Why is this change required? What problem does it solve? If this pull request closes/resolves an open Issue, make sure you include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here --> 1. VDM_TYPE Enhancement (codes/public/cmis.py) ---------------------------------------------- - Added 4th element to VDM_TYPE tuples: 'B' (basic) or 'S' (statistic) - Serves as single source of truth for observable classification 2. Observable Type Constants (api/public/cmisVDM.py) -------------------------------------------------- - VDM_OBSERVABLE_BASIC = 0x1 - VDM_OBSERVABLE_STATISTIC = 0x2 - VDM_OBSERVABLE_ALL = 0x3 3. New CmisApi Methods (api/public/cmis.py) ----------------------------------------- a) get_transceiver_vdm_real_value_basic() - Reads only basic (instantaneous) VDM observables - No freeze required b) get_transceiver_vdm_real_value_statistic() - Reads only statistic (min/max/avg) VDM observables - Requires freeze operation (caller responsible) c) is_vdm_statistic_supported() - Checks if module supports VDM statistic observables - Uses @read_only_cached_api_return for performance 4. Enhanced get_vdm_page() (api/public/cmisVDM.py) ------------------------------------------------ - Added optional observable_type parameter - Filters VDM observables based on type (basic/statistic/all) 5. Performance Optimization ------------------------- - Added @read_only_cached_api_return to is_transceiver_vdm_supported() - Prevents repeated EEPROM access for static capability bits #### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> Please refer to the test details in sonic-net/sonic-platform-daemons#750 #### Additional Information (Optional) MSFT ADO - 36798630
mssonicbld
added a commit
to mssonicbld/sonic-platform-common
that referenced
this pull request
Feb 27, 2026
<!-- Provide a general summary of your changes in the Title above --> This PR must be merged along with sonic-net/sonic-platform-daemons#750 #### Description <!-- Describe your changes in detail --> Currently, the CMIS API treats all VDM observables uniformly, requiring freeze operations for all reads. However, CMIS specification distinguishes between: - Basic observables (instantaneous values like current BER, temperature) - Statistic observables (min/max/avg values that require freeze to capture consistently) This prevents optimization in xcvrd, which currently requires freeze operation even for modules that only support basic observables (where freeze may not be supported or necessary). Additionally, the API performs repeated EEPROM reads to check VDM support status, even though this capability bit is static for a given module. #### Motivation and Context <!-- Why is this change required? What problem does it solve? If this pull request closes/resolves an open Issue, make sure you include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here --> 1. VDM_TYPE Enhancement (codes/public/cmis.py) ---------------------------------------------- - Added 4th element to VDM_TYPE tuples: 'B' (basic) or 'S' (statistic) - Serves as single source of truth for observable classification 2. Observable Type Constants (api/public/cmisVDM.py) -------------------------------------------------- - VDM_OBSERVABLE_BASIC = 0x1 - VDM_OBSERVABLE_STATISTIC = 0x2 - VDM_OBSERVABLE_ALL = 0x3 3. New CmisApi Methods (api/public/cmis.py) ----------------------------------------- a) get_transceiver_vdm_real_value_basic() - Reads only basic (instantaneous) VDM observables - No freeze required b) get_transceiver_vdm_real_value_statistic() - Reads only statistic (min/max/avg) VDM observables - Requires freeze operation (caller responsible) c) is_vdm_statistic_supported() - Checks if module supports VDM statistic observables - Uses @read_only_cached_api_return for performance 4. Enhanced get_vdm_page() (api/public/cmisVDM.py) ------------------------------------------------ - Added optional observable_type parameter - Filters VDM observables based on type (basic/statistic/all) 5. Performance Optimization ------------------------- - Added @read_only_cached_api_return to is_transceiver_vdm_supported() - Prevents repeated EEPROM access for static capability bits #### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> Please refer to the test details in sonic-net/sonic-platform-daemons#750 #### Additional Information (Optional) MSFT ADO - 36798630 Signed-off-by: Sonic Build Admin <[email protected]>
mssonicbld
added a commit
to mssonicbld/sonic-platform-common
that referenced
this pull request
Feb 28, 2026
<!-- Provide a general summary of your changes in the Title above --> This PR must be merged along with sonic-net/sonic-platform-daemons#750 #### Description <!-- Describe your changes in detail --> Currently, the CMIS API treats all VDM observables uniformly, requiring freeze operations for all reads. However, CMIS specification distinguishes between: - Basic observables (instantaneous values like current BER, temperature) - Statistic observables (min/max/avg values that require freeze to capture consistently) This prevents optimization in xcvrd, which currently requires freeze operation even for modules that only support basic observables (where freeze may not be supported or necessary). Additionally, the API performs repeated EEPROM reads to check VDM support status, even though this capability bit is static for a given module. #### Motivation and Context <!-- Why is this change required? What problem does it solve? If this pull request closes/resolves an open Issue, make sure you include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here --> 1. VDM_TYPE Enhancement (codes/public/cmis.py) ---------------------------------------------- - Added 4th element to VDM_TYPE tuples: 'B' (basic) or 'S' (statistic) - Serves as single source of truth for observable classification 2. Observable Type Constants (api/public/cmisVDM.py) -------------------------------------------------- - VDM_OBSERVABLE_BASIC = 0x1 - VDM_OBSERVABLE_STATISTIC = 0x2 - VDM_OBSERVABLE_ALL = 0x3 3. New CmisApi Methods (api/public/cmis.py) ----------------------------------------- a) get_transceiver_vdm_real_value_basic() - Reads only basic (instantaneous) VDM observables - No freeze required b) get_transceiver_vdm_real_value_statistic() - Reads only statistic (min/max/avg) VDM observables - Requires freeze operation (caller responsible) c) is_vdm_statistic_supported() - Checks if module supports VDM statistic observables - Uses @read_only_cached_api_return for performance 4. Enhanced get_vdm_page() (api/public/cmisVDM.py) ------------------------------------------------ - Added optional observable_type parameter - Filters VDM observables based on type (basic/statistic/all) 5. Performance Optimization ------------------------- - Added @read_only_cached_api_return to is_transceiver_vdm_supported() - Prevents repeated EEPROM access for static capability bits #### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> Please refer to the test details in sonic-net/sonic-platform-daemons#750 #### Additional Information (Optional) MSFT ADO - 36798630 Signed-off-by: Sonic Build Admin <[email protected]>
mssonicbld
added a commit
to sonic-net/sonic-platform-common
that referenced
this pull request
Feb 28, 2026
<!-- Provide a general summary of your changes in the Title above --> This PR must be merged along with sonic-net/sonic-platform-daemons#750 #### Description <!-- Describe your changes in detail --> Currently, the CMIS API treats all VDM observables uniformly, requiring freeze operations for all reads. However, CMIS specification distinguishes between: - Basic observables (instantaneous values like current BER, temperature) - Statistic observables (min/max/avg values that require freeze to capture consistently) This prevents optimization in xcvrd, which currently requires freeze operation even for modules that only support basic observables (where freeze may not be supported or necessary). Additionally, the API performs repeated EEPROM reads to check VDM support status, even though this capability bit is static for a given module. #### Motivation and Context <!-- Why is this change required? What problem does it solve? If this pull request closes/resolves an open Issue, make sure you include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here --> 1. VDM_TYPE Enhancement (codes/public/cmis.py) ---------------------------------------------- - Added 4th element to VDM_TYPE tuples: 'B' (basic) or 'S' (statistic) - Serves as single source of truth for observable classification 2. Observable Type Constants (api/public/cmisVDM.py) -------------------------------------------------- - VDM_OBSERVABLE_BASIC = 0x1 - VDM_OBSERVABLE_STATISTIC = 0x2 - VDM_OBSERVABLE_ALL = 0x3 3. New CmisApi Methods (api/public/cmis.py) ----------------------------------------- a) get_transceiver_vdm_real_value_basic() - Reads only basic (instantaneous) VDM observables - No freeze required b) get_transceiver_vdm_real_value_statistic() - Reads only statistic (min/max/avg) VDM observables - Requires freeze operation (caller responsible) c) is_vdm_statistic_supported() - Checks if module supports VDM statistic observables - Uses @read_only_cached_api_return for performance 4. Enhanced get_vdm_page() (api/public/cmisVDM.py) ------------------------------------------------ - Added optional observable_type parameter - Filters VDM observables based on type (basic/statistic/all) 5. Performance Optimization ------------------------- - Added @read_only_cached_api_return to is_transceiver_vdm_supported() - Prevents repeated EEPROM access for static capability bits #### How Has This Been Tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> Please refer to the test details in sonic-net/sonic-platform-daemons#750 #### Additional Information (Optional) MSFT ADO - 36798630 Signed-off-by: Sonic Build Admin <[email protected]>
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.
This PR must be merged along with sonic-net/sonic-platform-common#624
Description
Currently, xcvrd performs freeze operation before reading ALL VDM observables,
then unfreezes after reading. This approach has following limitations:
support freeze/unfreeze functionality
Motivation and Context
This PR restructures the VDM monitoring flow in DOM manager to optimize freeze
operations and correctly handle different observable types.
CHANGES IMPLEMENTED:
Three-Step VDM Monitoring Flow (dom/dom_mgr.py)
Step 1: Conditional Freeze for Statistics/PM (only if NOT in lpmode)
a) Freeze VDM/PM statistics
b) Read VDM statistic observables (if supported)
c) Read PM data
d) Unfreeze VDM/PM statistics
Step 2: Read VDM Basic Observables
Step 3: Post Merged Data to DB, then Read COR Flags
How Has This Been Tested?
Following tests were executed to ensure that the VDM related tables are updated in line with expectation
a. Swap CCMIS optic with non-VDM supported optic
b. Swap non-VDM supported optic with DAC
c. Swap DAC with CCMIS optic
Additional Information (Optional)
MSFT ADO - 34227059