Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable periodic polling of TRANSCEIVER_FIRMWARE_INFO table in DomInfoUpdateTask #443

Merged
merged 6 commits into from
Mar 6, 2024

Conversation

mihirpat1
Copy link
Contributor

@mihirpat1 mihirpat1 commented Mar 3, 2024

MSFT ADO - 26801871

Description

We need to enable periodic update of TRANSCEIVER_FIRMWARE_INFO table so that the active_firmware and inactive_firmware fields are periodically updated in the redis-db. Periodic polling of firmware version will enable XCVRD to update firmware version for all breakout ports of a physical port after performing firmware upgrade using any one of the breakout port.

Also, a new CLI (config interface transceiver dom PORT_NAME enable/disable) has been created to allow user enable/disable DOM monitoring. XCVRD needs to handle this CLI so that periodic polling through DomInfoUpdateTask thread is enabled/disabled for a particular port.
The new CLI will set dom_polling field in PORT|<logical_port> table of CONFIG_DB. The possible values of this field are enabled and disabled
Please refer to sonic-net/sonic-utilities#3187 for further details.

Note for DOM config CLI execution on breakout ports
While handling the first subport of a physical port, DomInfoUpdateTask thread will read data from EEPROM and update firmware_info_cache. All other subports of the physical ports will have the data retrieved from firmware_info_cache in that iteration. Hence, we need to ensure that user always disables DOM monitoring through the CLI only for the first subport (even though, the user is accessing CDB commands using subport > 1).

DOM monitoring should be disabled before executing sfputil show fwversion PORT_NAME to ensure that DomInfoUpdateTask thread does not send a CDB command parallelly to retrieve the FW version.

Motivation and Context

How Has This Been Tested?

Following are the testcases which were tested and passed successfully

1	Device with non-breakout ports
1.1	Disable DOM monitoring for port
1.2	Enable DOM monitoring for port
2	Device with breakout ports
2.1	Disable DOM monitoring for subport 1
2.2	Enable DOM monitoring for subport 1
2.3	Disable DOM monitoring for subport 2
2.4	Enable DOM monitoring for subport 2
3	Multi-asic device - The CLI handler in xcvrd was not tested since all the available multi-asic devices currently support 202205 image and the TRANSCEIVER_FIRMWARE_INFO table is supported 202305 image onwards.
4	Firmware upgrade
5	Help options for DOM CLI
sonic:/home/admin# config interface transceiver dom --help
Usage: config interface transceiver dom [OPTIONS] <interface_name>
                                        (enable|disable)

  Enable/disable DOM monitoring for SFP transceiver module

Options:
  -?, -h, --help  Show this message and exit.

Additional Information (Optional)

…UpdateTask

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@prgeor
Copy link
Collaborator

prgeor commented Mar 4, 2024

@keboliu can you review

@@ -530,8 +531,15 @@ def post_port_sfp_firmware_info_to_db(logical_port_name, port_mapping, table,
continue

try:
transceiver_firmware_info_dict = _wrapper_get_transceiver_firmware_info(physical_port)
if transceiver_firmware_info_dict is not None:
if firmware_info_cache is not None and physical_port in firmware_info_cache:
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mihirpat1 what is this optimization? My understanding is the dom is going to read the firmware version from the EEPROM every polling interval

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prgeor - Upon further looking into the code after our discussion, I found that the current code reads data from EERPOM for the first subport for every poll. However, the remaining subports of that physical port in that iteration have their data retrieved from the relevant cache.
In the current case, the firmware_info_cache is a dictionary with physical_port as the key. Hence, DomInfoUpdateTask will clear the entire firmware_info_cache dictionary (line 1642) before it starts retrieving data for all ports. While handling the first subport of a physical port, DomInfoUpdateTask will read data from EEPROM and update firmware_info_cache. All other subports of the physical ports will have the data retrieved from firmware_info_cache in that iteration.

sonic-xcvrd/xcvrd/xcvrd.py Outdated Show resolved Hide resolved
@prgeor prgeor merged commit 8829614 into sonic-net:master Mar 6, 2024
5 checks passed
mihirpat1 added a commit to mihirpat1/sonic-platform-daemons that referenced this pull request Mar 6, 2024
…UpdateTask (sonic-net#443)

* Enable periodic polling of TRANSCEIVER_FIRMWARE_INFO table in DomInfoUpdateTask

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Addressed testcase failure

* Renamed dom_status to dom_polling

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mihirpat1
Copy link
Contributor Author

@StormLiangMS - I have created the below PR for 202305 cherry-pick. It will be great if you can help in merging it.
#445

MSFT ADO - 26801871

prgeor pushed a commit that referenced this pull request Mar 7, 2024
…UpdateTask (#443) (#445)

* Enable periodic polling of TRANSCEIVER_FIRMWARE_INFO table in DomInfoUpdateTask



* Addressed testcase failure

* Renamed dom_status to dom_polling

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
mssonicbld pushed a commit to mssonicbld/sonic-platform-daemons that referenced this pull request Mar 15, 2024
…UpdateTask (sonic-net#443)

* Enable periodic polling of TRANSCEIVER_FIRMWARE_INFO table in DomInfoUpdateTask

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Addressed testcase failure

* Renamed dom_status to dom_polling

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #448

mssonicbld pushed a commit that referenced this pull request Mar 15, 2024
…UpdateTask (#443)

* Enable periodic polling of TRANSCEIVER_FIRMWARE_INFO table in DomInfoUpdateTask

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Addressed testcase failure

* Renamed dom_status to dom_polling

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
yuazhe pushed a commit to yuazhe/sonic-platform-daemons that referenced this pull request Jul 2, 2024
…UpdateTask (sonic-net#443)

* Enable periodic polling of TRANSCEIVER_FIRMWARE_INFO table in DomInfoUpdateTask

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Addressed testcase failure

* Renamed dom_status to dom_polling

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
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.

4 participants