Skip to content

[CMIS] Fix VDM freeze/unfreeze as per CMIS 5.4 - #757

Merged
prgeor merged 4 commits into
sonic-net:masterfrom
prgeor:vdmfreeze
Sep 17, 2026
Merged

prgeor merged 4 commits into
sonic-net:masterfrom
prgeor:vdmfreeze

Conversation

@prgeor

@prgeor prgeor commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix VDM Freeze/Unfreeze as per CMIS 5.4

Motivation and Context

VDM Freeze/Unfreeze is NOT working in modules following 5.4 spec

How Has This Been Tested?

Tested this on module following CMIS 5.3 and 5.4

Additional Information (Optional)

@prgeor
prgeor requested review from mihirpat1 and a lite review from Copilot September 16, 2026 01:07
@azure-pipelines

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

@prgeor prgeor added the Bug label Sep 16, 2026
@prgeor
prgeor marked this pull request as ready for review September 16, 2026 01:07
@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).

@prgeor prgeor changed the title Vdmfreeze [CMIS] Fix VDM freeze/unfreeze as per CMIS 5.4 Sep 16, 2026

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.

🟡 Changes recommended

Unresolved critical and moderate findings affect map loading, backward compatibility, and test coverage.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request updates CMIS VDM freeze/unfreeze handling for CMIS 5.4 by modeling the Page 2F control register fields.

Changes:

  • Adds VDM control bit-field definitions and constants.
  • Updates freeze/unfreeze operations to use the freeze-request field.
  • Adds reserved, power-saving, and duty-cycle mappings.
File summaries
File Reviewed changes and findings
sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page2f.py Defines Page 2F VDM fields. Critical (2 votes): the duty-cycle field mapping uses an invalid bit position and prevents map loading. Moderate (2 votes): making VDM_CONTROL read-only breaks existing callers. Moderate (1 vote): tests do not verify the field name or bit layout.
sonic_platform_base/sonic_xcvr/fields/consts.py Adds constants for the VDM control fields.
sonic_platform_base/sonic_xcvr/api/public/cmis.py Updates freeze/unfreeze to target VDM_FREEZE_REQUEST. Moderate (2 votes): existing tests do not exercise nested-field lookup or read-modify-write behavior.
Review details

Suppressed comments (1)

sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page2f.py:30

  • The existing VDM tests only mock xcvr_eeprom.write and check its return value, so they do not verify the new field name/value or the Page 2F bit layout. Add a focused memory-map/API test that checks freeze writes bit 7 through VDM_FREEZE_REQUEST and preserves the other control bits; otherwise a wrong mapping can pass the suite.
                RegBitsField(consts.VDM_FREEZE_REQUEST, bitpos=7, size=1, ro=False),
                RegBitsField(consts.VDM_POWER_SAVING_MODE, bitpos=6, size=1, ro=False),
                RegBitsField(consts.VDM_MON_DUTY_CYCLE, bitpos=5, size=4, ro=False),
                RegBitsField(consts.VDM_RESERVED, bitpos=0, size=2, ro=True)
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

NumberRegField(consts.VDM_CONTROL, self.getaddr(144),
RegBitsField(consts.VDM_FREEZE_REQUEST, bitpos=7, size=1, ro=False),
RegBitsField(consts.VDM_POWER_SAVING_MODE, bitpos=6, size=1, ro=False),
RegBitsField(consts.VDM_MON_DUTY_CYCLE, bitpos=5, size=4, ro=False),
Comment thread sonic_platform_base/sonic_xcvr/api/public/cmis.py
Comment on lines +30 to +31
RegBitsField(consts.VDM_RESERVED, bitpos=0, size=2, ro=True)
),
Signed-off-by: Prince George <prgeor@microsoft.com>
@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: Prince George <prgeor@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request label(s) for branch(es): 202605, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202605: <test result>) in the Test result section as well in your PR description.

---Powered by SONiC BuildBot

Comment thread sonic_platform_base/sonic_xcvr/api/public/cmis.py
@mihirpat1

Copy link
Copy Markdown
Contributor

@prgeor Can you please help to fix the test failure?

Signed-off-by: Prince George <prgeor@microsoft.com>
@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: Prince George <prgeor@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@prgeor
prgeor merged commit d404291 into sonic-net:master Sep 17, 2026
6 checks passed
@thisptr-sh

Copy link
Copy Markdown
Contributor

Hi @vaibhavhd can you help take this 202605 please? Thanks!

@thisptr-sh

Copy link
Copy Markdown
Contributor

@mihirpat1 @prgeor can you please help share the testing done on the 202605 branch as well?

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.

5 participants