Xcvrd crash and restart should not cause link flap on platforms needing custom NPU SI settings#541
Merged
prgeor merged 3 commits intoOct 8, 2024
Conversation
…ng custom SI settings Signed-off-by: Mihir Patel <patelmi@microsoft.com>
prgeor
reviewed
Oct 1, 2024
| break | ||
|
|
||
| """ | ||
| Initialize NPU_SI_SETTINGS_SYNC_STATUS_KEY field in STATE_DB PORT_TABLE|<lport> |
Collaborator
There was a problem hiding this comment.
@mihirpat1 where do we delete the key when optics is removed?
Contributor
Author
There was a problem hiding this comment.
@prgeor We don't delete the key when optics is removed. We instead mark it as NPU_SI_SETTINGS_DEFAULT.
This change is at line 2163-2164 in xcvrd.py.
prgeor
approved these changes
Oct 1, 2024
prgeor
reviewed
Oct 1, 2024
Junchao-Mellanox
approved these changes
Oct 8, 2024
Contributor
Author
|
@bingwang-ms Can you please help to cherry-pick this PR to 202405 branch? |
mssonicbld
pushed a commit
to mssonicbld/sonic-platform-daemons
that referenced
this pull request
Oct 8, 2024
…ng custom NPU SI settings (sonic-net#541) * Xcvrd crash and restart should not cause link flap on platforms needing custom SI settings Signed-off-by: Mihir Patel <patelmi@microsoft.com> * Improved code coverage --------- Signed-off-by: Mihir Patel <patelmi@microsoft.com>
Collaborator
|
Cherry-pick PR to 202405: #547 |
mssonicbld
pushed a commit
that referenced
this pull request
Oct 8, 2024
…ng custom NPU SI settings (#541) * Xcvrd crash and restart should not cause link flap on platforms needing custom SI settings Signed-off-by: Mihir Patel <patelmi@microsoft.com> * Improved code coverage --------- Signed-off-by: Mihir Patel <patelmi@microsoft.com>
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
Ensure Xcvrd crash and restart should be handled gracefully on platforms that need custom SI settings.
The goal is to avoid link flap on platforms that need custom SI settings during xcvrd restart.
Motivation and Context
Changeset 1
The changeset is partial implementation of the changes required for sonic-net/SONiC#1432.
Specifically, the current change adds
NPU_SI_SETTINGS_SYNC_STATUSkey to the PORT_TABLE of STATE_DB. Following is the usage ofNPU_SI_SETTINGS_SYNC_STATUSkeyPlease note that the above table needs to be further modified while implementing complete OA crash HLD. The table assumes NPU SI settings are applied from SfpStateUpdateTask thread always (unlike the HLD wherein CMIS transceivers have the NPU SI settings being sent from CmisManagerTask).
Changeset 2
In addition to the above change,
TRANSCEIVER_INFOtable will not be deleted as part of xcvrd deinit.On some platforms,
TRANSCEIVER_INFOtable is used to detect transceiver presence to handlehost_tx_readybehavior and hence, deletingTRANSCEIVR_INFOtable will causehost_tx_readyto change tofalseduring xcvrd shutdown.Impact due to skipping TRANSCEIVER_INFO table deletion
Changeset 3
PHYSICAL_PORT_NOT_EXISThas been defined in media_settings_parser.py to prevent crash due to undefined value.When the media_settings_parser.py file was created, the below line was moved from xcvrd.py. However, the definition of
PHYSICAL_PORT_NOT_EXISTwas never ported. Hence, adding the definition now.sonic-platform-daemons/sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py
Line 280 in 8c89f6b
How Has This Been Tested?
On platforms which do not restart xcvrd upon swss/syncd crash/restart, following behavior is observed
The first xcvrd crash after swss/syncd restarts will cause a link flap for ports which require NPU SI settings.
This is expected since as part of swss crash handling, the entire PORT_TABLE of STATE_DB is deleted.
Since xcvrd is not restarted as part of swss/syncd crash handling, the NPU_SI_SETTINGS_SYNC_STATUS field is never populated. Hence, when xcvrd crashes/restarts first time after swss/syncd crash is triggered, xcvrd will update the NPU SI settings in the APPL_DB which in turn forces the port to go through a link flap while OA configures the NPU SI settings
Test summary
Additional Information (Optional)
MSFT ADO - 29278409