Skip to content

Conversation

@longhuan-cisco
Copy link
Contributor

Note

Will update/add UT code later

Description

  1. To fix Bug: [CMIS][Port-Breakout] Subport speed change is affecting the other subport in the same breakout group. sonic-buildimage#23006, enhance cmis_mgr to decommission individual data path(s) (i.e. logical port) independently:
    For each logical port, identify the configured data path(s) (in Active Control Set) that share host lanes with this logical port and have conflicting appl codes. Then mark as decomm_pending for the lanes belonging to the conflicting data path(s), and this would be the minimal set of host lanes that require decommissioning to allow the given logical port to apply its new appl code without facing config error. If other logical ports are already in the progress of decommission on the lanes overlapping with this logical port, put it on hold util other logical ports' done decommissioning.
  2. Fix PortChangeObserver: DEL event can get dropped by port_event_cache in the case of back-to-back [...,DEL, SET] event sequence, which might lead to stale data not getting cleaned up if user of PortChangeObserver relies on DEL event to do cleanup actions.(e.g. cmis_mgr)

Motivation and Context

How Has This Been Tested?

Additional Information (Optional)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@longhuan-cisco longhuan-cisco changed the title Enhance CMIS DP decommissioning to be one a per-logical-port basis Enhance CMIS DP decommissioning to be on a per-logical-port basis Aug 17, 2025
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin
Copy link

wangxin commented Aug 18, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mihirpat1 mihirpat1 requested a review from Copilot August 20, 2025 05:43
Copilot

This comment was marked as outdated.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mihirpat1 mihirpat1 requested a review from Copilot August 22, 2025 23:48
Copy link

Copilot AI left a comment

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 enhances CMIS decommissioning to operate on a per-logical-port basis instead of per-physical-port, and fixes a port event caching issue that could drop DEL events.

  • Implements per-logical-port decommissioning by identifying minimal host lanes requiring decommission for each logical port
  • Fixes PortChangeObserver event caching to prevent DEL events from being dropped in back-to-back DEL/SET sequences
  • Adds validation to check Active Control Set for correct application code updates

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
sonic-xcvrd/xcvrd/xcvrd_utilities/port_event_helper.py Updates event caching to use deque with maxlen=2 and preserves DEL events followed by SET events
sonic-xcvrd/xcvrd/xcvrd.py Refactors decommissioning logic to work per-logical-port, adds new methods for host lane mask calculation and active application validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@longhuan-cisco
Copy link
Contributor Author

Hi @prgeor @mihirpat1 could you please review, thanks

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: [CMIS][Port-Breakout] Subport speed change is affecting the other subport in the same breakout group.

3 participants