[code sync] Merge code from sonic-net/sonic-utilities:202511 to 202603#308
Merged
Conversation
mssonicbld
commented
Apr 11, 2026
Collaborator
When a single EEPROM page fails to read during `sfputil show eeprom-hexdump`, the command no longer aborts. It continues dumping the remaining pages and returns success (exit 0), with the failed page’s error message included in the output. #### What I did - **Bug**: On some modules, `sfputil show eeprom-hexdump` failed with "Failed to read EEPROM for page" and exited with an error, so no EEPROM data was shown and techsupport dumps did not contain `dump/interface.xcvrs.eeprom.RAW`. - **Fix**: Treat a single-page read failure as non-fatal: append the error line to the output and continue with the next pages. The command still exits 0 so techsupport and scripts get a full/ partial dump. #### How I did it - **sfputil/main.py** - `eeprom_hexdump_pages_general()`: Removed early `return return_code, output` on page read failure. Always append `output` and continue, then return `(0, '\n'.join(lines))`. - `eeprom_hexdump_pages_sff8472()`: Same behavior for SFF8472 (A0h / A2h pages): no early return on failure, append output and continue. - **tests/sfputil_test.py** - `test_eeprom_hexdump_all_falure`: Updated to expect exit 0 and that both ports’ headers and error messages appear in output (continue-on-failure behavior). - Added `test_eeprom_hexdump_pages_general_continues_on_single_page_failure`: one page fails, others succeed, asserts rc == 0 and output contains both error and successful page content. - Added `test_eeprom_hexdump_pages_sff8472_continues_on_single_page_failure`: same for SFF8472 (A0h ok, A2h lower fail, A2h upper ok). #### How to verify it - Unit tests: new and updated tests in `tests/sfputil_test.py` for continue-on-single-page-failure behavior. - Manual: `sfputil show eeprom-hexdump` and `show techsupport` on some modules to confirm partial EEPROM dump and presence of `interface.xcvrs.eeprom.RAW`. On EEPROM page read failure, log which page failed and continue dumping other pages instead of returning. Fixes modules where e.g. some page fails but other pages are readable. Allows techsupport dumps to include interface.xcvrs.eeprom.RAW. #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [x] 202511 ##### **Before this change:** Run "sfputil show eeprom-hexdump": Error "Failed to read EEPROM for page 10h", and stopped there. Run "show techsupport": In the generated dumps, the file dump/interface.xcvrs.eeprom.RAW does not exist. ##### **After this change:** Run "sfputil show eeprom-hexdump": ```bash EEPROM hexdump for port Ethernet0 Lower page 0h 00000000 80 53 45 07 00 00 00 00 00 00 00 00 00 00 00 00 |.SE.............| 00000010 00 00 00 00 00 00 00 00 00 00 40 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 03 00 00 00 00 00 80 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 00 00 00 02 4c 14 11 ff 4b 14 11 ff 4e 1c |......L...K...N.| 00000060 22 55 4d 1c 22 55 50 1c 44 11 4f 1c 44 11 ff 00 |"UM."UP.D.O.D...| 00000070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| Upper page 0h 00000080 80 4e 56 49 44 49 41 20 20 20 20 20 20 20 20 20 |.NVIDIA | 00000090 20 00 00 00 56 4d 4f 44 5f 53 50 43 35 5f 43 50 | ...VMOD_SPC5_CP| 000000a0 4f 20 20 20 00 00 56 4d 4f 44 5f 53 50 43 35 5f |O ..VMOD_SPC5_| 000000b0 43 50 4f 20 30 30 00 00 00 00 00 00 00 00 20 20 |CPO 00........ | 000000c0 20 20 20 20 20 20 20 20 50 00 00 00 00 00 00 00 | P.......| 000000d0 00 00 00 00 04 00 00 00 00 00 00 00 00 00 d1 00 |................| 000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| Upper page 1h 00000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000090 00 80 46 00 00 00 9d 00 00 00 00 00 00 00 00 03 |..F.............| 000000a0 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 69 |...............i| Upper page 2h 00000080 5f 00 f6 00 5a 00 05 00 88 b8 79 18 87 5a 7a 76 |_...Z.....y..Zzv| 00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000b0 fc 35 27 10 ea 91 3d f9 00 00 00 00 00 00 00 00 |.5'...=.........| 000000c0 62 20 09 d0 4d ee 0c 5a 00 00 00 00 00 00 00 00 |b ..M..Z........| 000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 6b |...............k| Upper page 10h Error: Failed to read EEPROM for page 10h, flat_offset 2176, page_offset 128, size 128! Upper page 11h Error: Failed to read EEPROM for page 11h, flat_offset 2304, page_offset 128, size 128! ``` Read Upper page 10h fail, but can continue to read latter page 11h, previously it will return directly. Multiple pages read failure are shown in page 10h and 11h. Run "show techsupport": In the generated dumps, the file dump/interface.xcvrs.eeprom.RAW exist. Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
* mertirc and vnetname code into 202511 Signed-off-by: alawing <alawing@gmail.com> * fix merge issue Signed-off-by: alawing <alawing@gmail.com> --------- Signed-off-by: alawing <alawing@gmail.com>
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.