Skip to content

Conversation

@mssonicbld
Copy link
Collaborator

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:

Task PR
1) Move functions used across multiple files in xcvrd to utils/common.py #654
2) Move CmisManagerTask into cmis/cmis_manager_task.py #691
3) Split task_worker into process_lport #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
CMIS Refactor Flow

How Has This Been Tested?

  1. All unit tests pass
  2. tested on device with no issues, links all up.

Additional Information (Optional)

<!-- 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)
@mssonicbld
Copy link
Collaborator Author

Original PR: #701

@mssonicbld
Copy link
Collaborator Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

1 participant