Skip to content

[code sync] Merge code from sonic-net/sonic-utilities:202511 to 202603#308

Merged
mssonicbld merged 3 commits into
Azure:202603from
mssonicbld:sonicbld/202603-merge
Apr 11, 2026
Merged

[code sync] Merge code from sonic-net/sonic-utilities:202511 to 202603#308
mssonicbld merged 3 commits into
Azure:202603from
mssonicbld:sonicbld/202603-merge

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator
* 902205a7 - (origin/202511) Show vnet route cli update on 202511 (#4448) (2026-04-10) [David Zhang]
* 080ebf66 - Sfputil: don't abort eeprom-hexdump on single page read failure (#4447) (2026-04-11) [mssonicbld]<br>```

mssonicbld and others added 3 commits April 11, 2026 07:13
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>
@mssonicbld mssonicbld merged commit 8d21a03 into Azure:202603 Apr 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants