-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable periodic polling of port in DomInfoUpdateTask thread during C…
…MIS init (#449) (#450) Cherry-pick for #449 Description We currently need to disable periodic DOM polling of a port through DomInfoUpdateTask thread during CMIS initialization. Motivation and Context Disabling of DOM polling during CMIS initialization is primarily needed to disable sending CDB commands to read FW version from DomInfoUpdateTask thread during CMIS initialization. For transceivers which do not support CDB background mode, any EEPROM access to the module can fail if a CDB command is executed at the same time. In order to disable DOM polling during CMIS initialization, the cmis_state from CmisManagerTask thread is now being updated in the TRANSCEIVER_STATUS table of STATE_DB. If the current cmis_state does not belong to CMIS_TERMINAL_STATES, DomInfoUpdateTask will disable DOM polling for the port to allow CmisManagerTask thread to complete CMIS initialization if required. For platforms with CmisManagerTask disabled, the function is_port_in_cmis_initialization_process will always return False to allow DOM polling. In case of device boot-up or transceiver insertion, the DomInfoUpdateTask thread will wait for the port to be in either of the CMIS_TERMINAL_STATES before proceeding with DOM polling. For non-CMIS transceivers, the expected cmis_state is CMIS_STATE_READY. Hence, once the corresponding port reaches CMIS_STATE_READY state, DOM polling will be enabled for such port. Also, the cmis_state is not planned to be modified by DomInfoUpdateTask thread at any time to prevent race condition with CmisManagerTask. How Has This Been Tested? Following is the summary of tests performed 1 Ensure DOM thread polls for non-CMIS transceivers 2 Ensure DOM thread polls for platform with CMIS manager disabled 3 Ensure DOM thread waits during CMIS initialization 4 Ensure DOM polling is resumed after transceiver insertion 4.1 After removal 4.2 After insertion 5. Ensured `show interface transceiver status` CLI works with the current changes Redis-db dump snippet to show `cmis_state` field in TRANSCEIVER_STATUS table root@sonic:/home/admin# redis-cli -n 6 hgetall "TRANSCEIVER_STATUS|Ethernet0" 1) "cmis_state" 2) "READY" Additional Information (Optional) MSFT ADO - 26993372
- Loading branch information
Showing
2 changed files
with
185 additions
and
61 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.