Fix hardcoded lane masks when applying loopbacks#686
Merged
Conversation
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
reviewed
Jun 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the CMIS transceiver loopback implementation to avoid using a hardcoded 0xFF lane mask by deriving the “all lanes” mask from the currently active AppSel’s host/media lane counts, improving compatibility with 1-lane / smaller-lane-count modules.
Changes:
- Add APIs to resolve the active AppSel descriptor and fetch active host/media lane counts from Page 11h + application advertisement.
- Use the derived “all lanes” mask instead of
0xFFfor loopback operations (notably when disabling all loopbacks vialoopback_mode == 'none'). - Extend unit tests to cover the new active-lane-count APIs and updated loopback behaviors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| tests/sonic_xcvr/test_cmis.py | Adds tests for active AppSel lane count helpers; updates loopback tests to account for derived masks. |
| sonic_platform_base/sonic_xcvr/api/public/cmis.py | Introduces active AppSel lane-count helpers; replaces hardcoded lane masks in loopback paths; minor boolean conversion change for media loopback getters. |
Collaborator
|
@abhi-nexthop are you working on resolving the comments? |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
@prgeor Sorry Prince I was away and missed the response email notification. Fixed and tested |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
approved these changes
Jul 9, 2026
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
Certain transceivers expect exact lane masks for the active appsel when setting Media Side and Host side loopbacks respectively.
Currently, we have them hardcoded as 0xFF which works on certain transceivers but not others. On a 1 media lane transceiver, trying to disable loopback on it with 0xFF might fail depending on the device. We noticed this on several transceivers
Motivation and Context
How Has This Been Tested?
Tested on INPHI CORP IN-Q3JZ1-TC-M1 and Acacia DP04QSDD-E20-001
Acacia works with and without the fix
IN-Q3JZ1-TC-M1 fails to set any kind of media loopback without the fix
Additional Information (Optional)