Sfputil: Add the optional use-lpmode-pin flag to lpmode #4511
Open
abhi-nexthop wants to merge 12 commits into
Open
Sfputil: Add the optional use-lpmode-pin flag to lpmode #4511abhi-nexthop wants to merge 12 commits into
abhi-nexthop wants to merge 12 commits into
Conversation
Signed-off-by: abhi-nexthop <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
reviewed
May 8, 2026
prgeor
reviewed
May 8, 2026
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
reviewed
May 8, 2026
prgeor
reviewed
May 8, 2026
prgeor
reviewed
May 8, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the sfputil CLI to optionally control/report low-power mode via the transceiver LPMode pin instead of the EEPROM-based method, while keeping the existing default behavior unchanged.
Changes:
- Add
--use-lpmode-pinflag toshow lpmodeto callget_lpmode_via_pin()when requested. - Add
--use-lpmode-pinflag tolpmode on/offto callset_lpmode_via_pin()when requested. - Add unit tests covering the new flag behavior (including
NotImplementedErrorhandling).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sfputil/main.py |
Adds the --use-lpmode-pin flag to show/set LPMode flows and wires it into platform SFP APIs. |
tests/sfputil_test.py |
Adds test coverage for the new CLI flag paths for both show and set operations. |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
mihirpat1
reviewed
May 14, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
mihirpat1
previously approved these changes
May 21, 2026
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
What I did
Added the ability to use the --lpmode-pin flag.
How I did it
This will pass the flag down to sfp.get_lpmode and set_lpmode, only when it is explicitly certified and throws an error if the flag is not supported by the sfp class.
The default functionality (without the new flag) will not change whatsoever.
How to verify it
Replace your sfputil main.py and run as usual. The behavior, CMIS register values should remain exactly the same.
When this flag is provided, if your platform supports the software and hardware distinction, it should assert/deassert hardware lpmode on the transceiver.
This PR is gated on sonic-net/sonic-platform-common#663 being submitted
One such implementation has been made in pddf sfp here: sonic-net/sonic-buildimage#27278
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
When flag is not supported:
LPMode pin flag not implemented for this platform
When supported: It remains the same