[action] [PR:701] Xcvrd Refactor 3/13: Breakup task_worker into separate functions - 1#725
Merged
mssonicbld merged 1 commit intosonic-net:202511from Dec 11, 2025
Merged
Conversation
<!-- Provide a general summary of your changes in the Title above -->
#### Description
<!--
Describe your changes in detail
-->
No logic changes. This change looks like a huge diff but its just moving all of the CMIS logic into a new function process_single_lport. This is needed to make the following diffs with logic split up more readable
#### 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
-->
xcvrd has gotten to 4000 lines long. To make things easier, we'd like to refactor it. This is the second PR in a series that aims to do the following:
| Task | PR |
|------|-------------|
| 1) Move functions used across multiple files in xcvrd to utils/common.py | sonic-net#654 |
| 2) Move CmisManagerTask into cmis/cmis_manager_task.py | sonic-net#691 |
| 3) Split task_worker into process_lport | sonic-net#701 |
| 4) Rename xcvrd/xcvrd_utilities to xcvrd/utils | bobby-nexthop#3 |
| 5) Add handle_cmis_inserted_state function | bobby-nexthop#4 |
| 6) Add handle_cmis_dp_pre_init_check_state function | bobby-nexthop#5 |
| 7) Add handle_cmis_dpdeinit_state function | bobby-nexthop#6 |
| 8) Add handle_cmis_ap_conf_state function | bobby-nexthop#7 |
| 9) Add handle_cmis_dp_init_state | bobby-nexthop#8 |
| 10) Add handle_cmis_txon_state | bobby-nexthop#9 |
| 11) Add handle_cmis_activate_state | bobby-nexthop#10 |
The new flow will go from calling `task_worker()` to
<img width="1000" height="333" alt="CMIS Refactor Flow" src="https://github.com/user-attachments/assets/e9dfa22c-bc40-41d4-b4cb-9a39f02ff440" />
#### How Has This Been Tested?
1) All unit tests pass
2) tested on device with no issues, links all up.
<!--
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.
-->
#### Additional Information (Optional)
Collaborator
Author
|
Original PR: #701 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/azpw run |
Collaborator
Author
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
No logic changes. This change looks like a huge diff but its just moving all of the CMIS logic into a new function process_single_lport. This is needed to make the following diffs with logic split up more readable
Motivation and Context
xcvrd has gotten to 4000 lines long. To make things easier, we'd like to refactor it. This is the second PR in a series that aims to do the following:
The new flow will go from calling

task_worker()toHow Has This Been Tested?
Additional Information (Optional)