-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support collecting module EEPROM pages in show techsupport command #1476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4452311
Support collecting module EEPROM pages in show techsupport command
Junchao-Mellanox e81e60c
Only dump A2h offset 0-128
Junchao-Mellanox 8ff93e4
Fix review comments
Junchao-Mellanox a70cf25
Update dump_sfp_eeprom.md
Junchao-Mellanox fc94b62
Update dump_sfp_eeprom.md
Junchao-Mellanox 3938bd6
Update dump_sfp_eeprom.md
Junchao-Mellanox a0a8690
Fix review comments
Junchao-Mellanox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| # Dump SFP EEPROM page data in show techsupport command # | ||
|
|
||
| ## Table of Content | ||
|
|
||
| ### Revision | ||
|
|
||
| ### Scope | ||
|
|
||
| SONiC show techsupport command provides the ability to collect system dump for debug purpose. Module EEPROM data is important information for PHY issue debugging, but it is not part of show techsupport command. This design will enhance show techsupport command to contain module EEPROM data. | ||
|
|
||
| ### Definitions/Abbreviations | ||
|
|
||
| N/A | ||
|
|
||
| ### Overview | ||
|
|
||
| 1. Existing CLI `sfputil show eeprom-hexdump` shall be extended to dump EEPROM pages in a single call. | ||
| 2. Show techsupport command shall be extended to call `sfputil show eeprom-hexdump` command to collect module EEPROM data. | ||
|
|
||
| ### Requirements | ||
|
|
||
| 1. Show techsupport command shall collect module EEPROM raw data | ||
| 2. All existing cable types shall be supported except RJ45 | ||
| 3. Vendor specific implementation is not required but still possible. | ||
|
|
||
| ### Architecture Design | ||
|
|
||
| The current architecture is not changed | ||
|
|
||
| ### High-Level Design | ||
|
|
||
| Submodule sonic-utilities shall be changed. By default, vendor platform API implementation is not required. | ||
|
|
||
| #### sonic-utilities | ||
|
|
||
| ##### generate_dump change | ||
|
|
||
| 1. New subcommand `sfputil show eeprom-hexdump` shall be used to dump module EEPROM data | ||
| 2. EEPROM data shall be saved to path `$TARDIR/dump/` | ||
|
|
||
| Sample code: | ||
| ``` | ||
| save_cmd "sfputil show eeprom-hexdump" "interface.xcvrs.eeprom.raw" & | ||
| ``` | ||
|
|
||
| Note: dumping EEPROM data might cause firmware busy, the command shall not be run parallel with save_saidump to avoid hardware access conflict. | ||
|
|
||
| ##### sfputil change | ||
|
|
||
| Existing subcommand `eeprom-hexdump` shall be extended to dump eeprom data for all existing cables except RJ45. Currently, `sfputil show eeprom-hexdump` accept two options `--port` and `--page`. It shall be extended like this: | ||
|
|
||
| 1. `sfputil show eeprom-hexdump --port <port> --page <page>`: dump given page for given port | ||
| 2. `sfputil show eeprom-hexdump --port <port>`: dump page 0 for given port (to keep backwardcompatible) | ||
| 3. `sfputil show eeprom-hexdump --page <page>`: dump given page for all ports, validate that page must be in range [0,255]. User is repsonsible for making sure the page existence. | ||
| 4. `sfputil show eeprom-hexdump`: dump available pages for all ports. Available pages for different cable types are described below. | ||
|
|
||
| `sfputil show eeprom-hexdump` shall dump pages based on cable type: | ||
|
|
||
| - CMIS | ||
| - copper: page 0h (0-255) | ||
| - optical: pages 0h (0-255), 1h, 2h, 10h, 11h (128-255), CDB page 0x9f if available (128-255), 400G ZR pages 30h, 31h, 32h, 33h, 34h, 35h, 38h, 39h, 3ah, 3bh if available (128-255) | ||
Junchao-Mellanox marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - sff8436 | ||
| - copper: page 0h (0-255) | ||
| - optical: pages 0h (0-255), 1h, 2h, 3h (128-255) | ||
| - sff8472 | ||
| - passive: page 0h (0-127) if flat memory else (0-255) | ||
| - active: page 0h (0-127) if flat memory else (0-255), 1h, 2h (128-255) | ||
| - sff8636 | ||
| - copper: page 0h (0-255) | ||
| - optical: pages 0h (0-255), 1h, 2h, 3h (128-255) | ||
|
|
||
| > Note: it is very complicated to dump all possible pages. So, only basic pages shall be dumped in the current implementation. | ||
|
|
||
| Sample output: | ||
|
|
||
| ``` | ||
| sfputil show eeprom-hexdump | ||
| EEPROM hexdump for module 1 | ||
| Lower page 0h | ||
| 00000000 11 08 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 01 08 00 |................| | ||
| 00000070 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
|
|
||
| Upper page 0h | ||
| 00000000 11 08 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 01 08 00 |................| | ||
| 00000070 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
|
|
||
| Page 1h | ||
| 00000000 11 08 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 01 08 00 |................| | ||
| 00000070 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| | ||
|
|
||
| ... | ||
|
|
||
| EEPROM hexdump for module 2 | ||
|
|
||
| ... | ||
| ``` | ||
|
|
||
| #### | ||
|
|
||
| ### SAI API | ||
|
|
||
| N/A | ||
|
|
||
| ### Configuration and management | ||
|
|
||
| #### Manifest (if the feature is an Application Extension) | ||
|
|
||
| N/A | ||
|
|
||
| #### CLI/YANG model Enhancements | ||
|
|
||
| No YANG model changes. CLI changes has been described in section #### sfputil change | ||
|
|
||
| #### Config DB Enhancements | ||
|
|
||
| N/A | ||
|
|
||
| ### Warmboot and Fastboot Design Impact | ||
|
|
||
| N/A | ||
|
|
||
| ### Memory Consumption | ||
|
|
||
| No memory consumption is expected when the feature is disabled via compilation and no growing memory consumption while feature is disabled by configuration. | ||
Junchao-Mellanox marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Restrictions/Limitations | ||
|
|
||
| Vendor should support platform API `sfp.read_eeprom` to support this feature. | ||
|
|
||
| ### Testing Requirements/Design | ||
|
|
||
| #### Unit Test cases | ||
|
|
||
| - sonic-utilities unit test shall be extended to cover changes for subcommand `sfputil show eeprom-dump` | ||
|
|
||
| #### System Test cases | ||
|
|
||
| ### Open/Action items - if any | ||
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.
Uh oh!
There was an error while loading. Please reload this page.