[ycabled][active-standby] Ignore transceiver updates for initialized MUX simulator. - #882
harjotsinghpawra wants to merge 1 commit into
Conversation
|
/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). |
|
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
|
|
@lolyu can you please help review this |
|
|
||
| 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.
| 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.
There was a problem hiding this comment.
@zjswhhh I am working on the hardware fix as well , there might some race conditions while maintaining instialized list looking into it
…MUX port. Signed-off-by: Harjot Singh <harjotpawrawork@gmail.com>
14f0a96 to
9705b6b
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@zjswhhh I have made changes for hardware also , it also uses y_cable_helper functions i have put ports in intialization there . Can you review and test on actual hardware if it breaks anything as i dont have actual hardware mux cable ? |
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: