forked from sonic-net/sonic-platform-daemons
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add deterministic bringup for SFF compliant modules #4
Open
longhuan-cisco
wants to merge
26
commits into
master
Choose a base branch
from
sff_mgr
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+840
−66
Conversation
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
longhuan-cisco
commented
Jun 21, 2023
sonic-xcvrd/xcvrd/xcvrd.py
Outdated
# Thread wrapper class for SFF compliant transceiver management | ||
|
||
|
||
class SffManagerTask(threading.Thread): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move into new file
longhuan-cisco
changed the title
Add initial support for sff_mgr
Add deterministic bringup for SFF compliant modules
Jun 21, 2023
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.
Note
For review internally only
PLEASE DO NOT MERGE.
Description
According to Interface-Link-bring-up-sequence.md, add a new thread sff_mgr under xcvrd for deterministic bringup on SFF compliant modules (100G/40G).
By default sff_mgr is disabled, to enable sff_mgr on a platform, add and set 'enable_xcvrd_sff_mgr' to true in pmon_daemon_ctrl json file.
Motivation and Context
Scope of sff_mgr: 100G/40G optics (copper/aoc not in the scope)
Why sff_mgr
The goal of sff_mgr is to make sure SFF compliant modules are brought up
in a deterministc way, meaning TX is enabled only after host_tx_ready
becomes True, and TX will be disabled when host_tx_ready becomes False.
This will help eliminate link stability issue and potential interface
flap, also turning off TX reduces the power consumption and avoid any
lab hazard for admin shut interface.
What sff_mgr does
sff_mgr is a new thread inside Xcvrd.
sff_mgr will only proceed at two events: transceiver insertion event
(including bootup and hot plugin) and host_tx_ready change event, all
other cases are ignored. If either of these two events is detected,
sff_mgr will determine the target tx_disable value based on
host_tx_ready, and also check the current HW value of tx_disable/enable,
if it's already in target tx_disable/enable value, no need to take
action, otherwise, sff_mgr will set the target tx_disable/enable value
to HW.
To detect these two events, sff_mgr listens to below DB tables, and
mantains a local copy of those DB values, stored in self.port_dict. In
each round of task_worker while loop, sff_mgr will calculate the delta
between current self.port_dict and previous self.port_dict (i.e.
self.port_dict_prev), and determine whether there is a change event.
1. STATE_DB PORT_TABLE's 'host_tx_ready' field for host_tx_ready
change event.
2. STATE_DB TRANSCEIVER_INFO table's 'type' field for insesrtion
event. Since TRANSCEIVER_INFO table has the same life cycle of
transceiver module insertion/removal, its DB entry will get
created at xcvr insertion, and will get deleted at xcvr removal.
TRANSCEIVER_STATUS table can also be used to detect
insertion/removal event, but 'type' field of TRANSCEIVER_INFO
table can also be used to filter out unwanted xcvr type, thus
TRANSCEIVER_INFO table is used here.
On the other hand, sff_mgr also listens to CONFIG_DB PORT_TABLE for info
such as 'index'/etc.
For platforms/vendors:
There is a behavior change (and requirement) for the platforms that
enable this sff_mgr feature: platform needs to keep TX in disabled state
after module coming out-of-reset, in either module insertion or bootup
cases. This is to make sure the module is not transmitting with TX
enabled before host_tx_ready is True. No impact for the platforms in
current deployment (since they don't enable it explictly.)
Platform can decide whether to enable sff_mgr via platform
enable_sff_mgr flag. If enable_sff_mgr is False, sff_mgr will not run.
How Has This Been Tested?
Additional Information (Optional)