[sfputil] Add loopback sub-command for debugging and module diagnosti…#3369
Merged
prgeor merged 2 commits intosonic-net:masterfrom Jul 12, 2024
Merged
[sfputil] Add loopback sub-command for debugging and module diagnosti…#3369prgeor merged 2 commits intosonic-net:masterfrom
prgeor merged 2 commits intosonic-net:masterfrom
Conversation
6ded6a7 to
d88fcb6
Compare
mihirpat1
reviewed
Jun 18, 2024
Contributor
mihirpat1
left a comment
There was a problem hiding this comment.
@xinyulin In the PR description, can you please add the results of the following test done manually on E0 and E1/E2 side.
- Setup loopback (any 2 types of loopback)
- Dump the loopback register using
sfputil show eeprom-hexdump -n <PAGE_NUM> -p PORT_NAME - clear the loopback
- Dump the loopback register
d88fcb6 to
4364283
Compare
c3786b7 to
6b4f056
Compare
…c control Signed-off-by: xinyu <[email protected]>
6b4f056 to
53a500e
Compare
mihirpat1
reviewed
Jul 11, 2024
doc/Command-Reference.md
Outdated
|
|
||
| - Example: | ||
| ``` | ||
| admin@sonic:~$ sfputil firmware target Ethernet88 host-side-input |
Contributor
There was a problem hiding this comment.
Suggested change
| admin@sonic:~$ sfputil firmware target Ethernet88 host-side-input | |
| admin@sonic:~$ sfputil debug loopback Ethernet88 host-side-input |
Contributor
Author
There was a problem hiding this comment.
oops! I copied it from other example, let me fix it!
doc/Command-Reference.md
Outdated
|
|
||
| - Usage: | ||
| ``` | ||
| sfputil debug loopback [OPTIONS] PORT_NAME LOOPBACK_MODE |
Contributor
There was a problem hiding this comment.
What do you mean by "[options]" here?
Contributor
Author
…command Signed-off-by: xinyu <[email protected]>
mihirpat1
approved these changes
Jul 11, 2024
prgeor
approved these changes
Jul 12, 2024
Contributor
|
@bingwang-ms Can you please help to merge this to 202405? |
mssonicbld
pushed a commit
to mssonicbld/sonic-utilities
that referenced
this pull request
Jul 12, 2024
sonic-net#3369) * [sfputil] Add loopback sub-command for debugging and module diagnostic control Signed-off-by: xinyu <[email protected]> * [sfputil] Correct and update the reference of sfputil debug loopback command Signed-off-by: xinyu <[email protected]> --------- Signed-off-by: xinyu <[email protected]>
Collaborator
|
Cherry-pick PR to 202405: #3416 |
mssonicbld
pushed a commit
that referenced
this pull request
Jul 12, 2024
#3369) * [sfputil] Add loopback sub-command for debugging and module diagnostic control Signed-off-by: xinyu <[email protected]> * [sfputil] Correct and update the reference of sfputil debug loopback command Signed-off-by: xinyu <[email protected]> --------- Signed-off-by: xinyu <[email protected]>
Contributor
|
@lguohan add the request for 202311 branch |
nmoray
pushed a commit
to nmoray/sonic-utilities
that referenced
this pull request
Jun 25, 2025
sonic-net#3369) * [sfputil] Add loopback sub-command for debugging and module diagnostic control Signed-off-by: xinyu <[email protected]> * [sfputil] Correct and update the reference of sfputil debug loopback command Signed-off-by: xinyu <[email protected]> --------- Signed-off-by: xinyu <[email protected]>
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
Add a debug group and a sub-command loopback under the sfputil command for debugging and module diagnostic purposes.
How I did it
Implement the loopback command by directly calling the set_loopback_mode() API.
How to verify it
Tested under Cisco8111 with Credo C1 cable.
sfputil debug loopback Ethernet88 nonesfputil debug loopback Ethernet88 host-side-inputPrevious command output (if the output of a command-line utility has changed)
The loopback command is not supported in previous version.
New command output (if the output of a command-line utility has changed)
Test logs
local end (E0) with toggling host side input loopback mode

page 0x00, byte 0x40 = 0 // target mode register set to E0
page 0x13, byte 0xB7 = 0xFF // turn on host side input loopback on lane 1 ~ 8
remote end1 (E1) with toggling media side input loopback mode

page 0x00, byte 0x40 = 1 // target mode register set to E1
page 0x13, byte 0xB5 = 0x0F // turn on media side input loopback on lane 1 ~ 4