[ycabled][active-standby] Ignore transceiver updates for initialized MUX simulator. - #882
Open
harjotsinghpawra wants to merge 1 commit into
Open
Conversation
…MUX simulator. Signed-off-by: Harjot Singh <harjotpawrawork@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
Author
|
@lolyu can you please help review this |
zjswhhh
reviewed
Aug 26, 2026
|
|
||
| port_dict = {} | ||
| if op == swsscommon.SET_COMMAND: | ||
| if y_cable_helper.is_initialized_simulated_y_cable(port): |
There was a problem hiding this comment.
Please make sure the initialized flag will be reset for actual unplug/insert.
zjswhhh
reviewed
Aug 26, 2026
| Failed or incomplete initialization must return False so a later SET can | ||
| retry normal discovery after the simulator configuration becomes available. | ||
| """ | ||
| if not os.path.exists(MUX_SIMULATOR_CONFIG_FILE): |
There was a problem hiding this comment.
The fix is applicable to both simulated and physical mux scenario.
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
TRANSCEIVER_INFO SET notifications contain the complete table row and are
generated for both transceiver insertion and CMIS maintenance updates. After
a simulated Y-cable is initialized, treating every SET as an insertion causes
ycabled to reread the simulator direction and publish stale HW MUX state.
Ignore SET notifications only when the simulator configuration exists and the
port already has a fully initialized simulated Y-cable instance. Continue to
process initial discovery, failed-initialization retries, and DEL notifications.
Add unit tests for initialized, missing, incomplete, and unconfigured simulator
instances and for the corresponding state-update behavior.
Motivation and Context
Problem
xcvrd publishes
TRANSCEIVER_INFOSETnotifications for CMIS maintenance updates during downlink admin-down. ycabled treats everySETas an SFP insertion. For an active-standby simulated Y-cable this rereads the simulator MUX direction and updatesSTATE_HW_MUX_CABLEwith a direction that may lag linkmgrd's requested state. The stale update can cause active/standby MUX ping-pong and exceed the dual-ToR traffic disruption budget.Root cause
SubscriberStateTablereturns the complete current table row for aSET, not only the changed fields. Consequently, filtering the event based on the fields present in the returned dictionary cannot reliably distinguish insertion from a CMIS-only update.Fix
For simulator-backed ports, treat a
SETas an insertion only until the simulated Y-cable driver is fully initialized. Once the driver instance exists and_initializedisTrue, ignore subsequentTRANSCEIVER_INFOSETnotifications.The guard is deliberately limited to the MUX simulator by requiring
/etc/sonic/mux_simulator.json. Physical Y-cable behavior remains unchanged.DELnotifications remain unchanged and remove the saved driver instance, so a later insertion can initialize again. Missing or partially initialized instances returnFalse, allowing later notifications to retry initialization.How Has This Been Tested?
SETprocessing.DELtest.The ycabled wheel build automatically ran the complete component test suite inside the SONiC build container:
New tests recorded as passing: