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

CLI to skip polling for periodic information for a port in DomInfoUpdateTask thread #3187

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

mihirpat1
Copy link
Contributor

@mihirpat1 mihirpat1 commented Mar 3, 2024

MSFT ADO - 26801913

What I did

Created a CLI to enable/disable periodic polling through DomInfoUpdateTask thread in XCVRD.
The CLI handler related code changes in xcvrd can be found at sonic-net/sonic-platform-daemons#443

Why I did this

With sonic-net/sonic-platform-daemons#443, the DomInfoUpdateTask thread in xcvrd now polls periodically for reading CDB firmware version of transceiver to update the TRANSCEIVER_FIRMWARE_INFO table.
However, transceivers cannot handle multiple CDB commands issued from different sources at the same time.
This scenario is likely to occur during CDB firmware upgrade (triggered through sfputil firmware download/run/commit) and while issuing sfputil show fwversion PORT_NAME CLI wherein 1 or more CDB commands are issued to the transceiver. At the same time, the DomInfoUpdateTask thread can issue a CDB command to read the firmware version as part of its periodic polling.
Hence, in order to ensure that only one process accesses the CDB command feature on transceivers at a time, the config interface transceiver dom PORT_NAME enable/disable CLI has been created to allow user to disable background polling of DomInfoUpdateTask thread for the particular port before upgrading the CDB firmware or before issuing sfputil show fwversion PORT_NAME CLI.

How I did it

With the execution of config interface transceiver dom PORT_NAME enable/disable CLI, the dom_polling field in PORT table of CONFIG_DB will be modified with the below value

  1. Upon executing config interface transceiver dom PORT_NAME enable CLI, the dom_polling field will be set to enabled
  2. Upon executing config interface transceiver dom PORT_NAME disable CLI, the dom_polling field will be set to disabled

For breakout ports, this CLI should always be executed for the first subport (subport = 1) of a breakout port group (even though, CDB access is required for subport > 1 ).

How to verify it

Please refer to the test details attached to sonic-net/sonic-platform-daemons#443

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

…ateTask thread

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mihirpat1 mihirpat1 marked this pull request as ready for review March 4, 2024 06:44
@mihirpat1 mihirpat1 requested a review from prgeor March 5, 2024 01:15
@prgeor
Copy link
Contributor

prgeor commented Mar 6, 2024

@mihirpat1 can you explain "Why I did this" too in the PR description

@mihirpat1
Copy link
Contributor Author

@mihirpat1 can you explain "Why I did this" too in the PR description

@prgeor I have added this section now.

@mihirpat1 mihirpat1 changed the title CLI to skip polling for periodic infomration for a port in DomInfoUpdateTask thread CLI to skip polling for periodic information for a port in DomInfoUpdateTask thread Mar 7, 2024
config/main.py Outdated Show resolved Hide resolved
prgeor
prgeor previously approved these changes Mar 7, 2024
@prgeor prgeor merged commit 995a797 into sonic-net:master Mar 7, 2024
5 checks passed
@mihirpat1
Copy link
Contributor Author

@StormLiangMS @yxieca - Can you please help with cherry-pick to 202305 and 202311?
MSFT ADO - 26801913

mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 8, 2024
…ateTask thread (sonic-net#3187)

* CLI to skip polling for periodic infomration for a port in DomInfoUpdateTask thread

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

* Fixed unit-test failure

* Modified dom_status to dom_polling

* Modified comment for failing the command

---------

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

Cherry-pick PR to 202311: #3200

mssonicbld pushed a commit that referenced this pull request Mar 8, 2024
…ateTask thread (#3187)

* CLI to skip polling for periodic infomration for a port in DomInfoUpdateTask thread

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

* Fixed unit-test failure

* Modified dom_status to dom_polling

* Modified comment for failing the command

---------

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

hi @mihirpat1 could you run test with 202305 image with this PR?

qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 11, 2024
…18277)

### Why I did it
Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI.

The `dom_polling` field was added through sonic-net/sonic-utilities#3187. Please refer to this PR for the details on the reason for adding `dom_polling` field.

### How I did it
Added `dom_polling` field to CONFIG_DB PORT table.

#### How to verify it
Added unit tests for both valid and invalid options for controlling `dom_polling`.
Valid values for for `dom_polling` are `enabled` and `disabled`
Any other value is treated as an invalid value
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Mar 12, 2024
…ateTask thread (sonic-net#3187)

* CLI to skip polling for periodic infomration for a port in DomInfoUpdateTask thread

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

* Fixed unit-test failure

* Modified dom_status to dom_polling

* Modified comment for failing the command

---------

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

Cherry-pick PR to 202305: #3211

mssonicbld pushed a commit that referenced this pull request Mar 12, 2024
…ateTask thread (#3187)

* CLI to skip polling for periodic infomration for a port in DomInfoUpdateTask thread

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

* Fixed unit-test failure

* Modified dom_status to dom_polling

* Modified comment for failing the command

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
saksarav-nokia pushed a commit to saksarav-nokia/sonic-buildimage that referenced this pull request Mar 12, 2024
…onic-net#18277)

### Why I did it
Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI.

The `dom_polling` field was added through sonic-net/sonic-utilities#3187. Please refer to this PR for the details on the reason for adding `dom_polling` field.

### How I did it
Added `dom_polling` field to CONFIG_DB PORT table.

#### How to verify it
Added unit tests for both valid and invalid options for controlling `dom_polling`.
Valid values for for `dom_polling` are `enabled` and `disabled`
Any other value is treated as an invalid value
mihirpat1 added a commit to mihirpat1/sonic-buildimage that referenced this pull request Mar 12, 2024
…onic-net#18277)

Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI.

The `dom_polling` field was added through sonic-net/sonic-utilities#3187. Please refer to this PR for the details on the reason for adding `dom_polling` field.

Added `dom_polling` field to CONFIG_DB PORT table.

Added unit tests for both valid and invalid options for controlling `dom_polling`.
Valid values for for `dom_polling` are `enabled` and `disabled`
Any other value is treated as an invalid value
mihirpat1 added a commit to mihirpat1/sonic-buildimage that referenced this pull request Mar 12, 2024
…onic-net#18277)

Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI.

The `dom_polling` field was added through sonic-net/sonic-utilities#3187. Please refer to this PR for the details on the reason for adding `dom_polling` field.

Added `dom_polling` field to CONFIG_DB PORT table.

Added unit tests for both valid and invalid options for controlling `dom_polling`.
Valid values for for `dom_polling` are `enabled` and `disabled`
Any other value is treated as an invalid value
StormLiangMS pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 18, 2024
…18277) (#18343)

Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI.

The `dom_polling` field was added through sonic-net/sonic-utilities#3187. Please refer to this PR for the details on the reason for adding `dom_polling` field.

Added `dom_polling` field to CONFIG_DB PORT table.

Added unit tests for both valid and invalid options for controlling `dom_polling`.
Valid values for for `dom_polling` are `enabled` and `disabled`
Any other value is treated as an invalid value
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 21, 2024
…18277) (#18344)

Added YANG related changes for adding `dom_polling` field in PORT table of CONFIG_DB. This field can be set with `config interface transceiver dom PORT_NAME (enable|disable)` CLI.

The `dom_polling` field was added through sonic-net/sonic-utilities#3187. Please refer to this PR for the details on the reason for adding `dom_polling` field.

Added `dom_polling` field to CONFIG_DB PORT table.

Added unit tests for both valid and invalid options for controlling `dom_polling`.
Valid values for for `dom_polling` are `enabled` and `disabled`
Any other value is treated as an invalid value
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.

5 participants