Skip to content

Commit

Permalink
[202311] Collect module EEPROM data in dump (#3009) (#3124)
Browse files Browse the repository at this point in the history
* Collect module EEPROM data in dump
  • Loading branch information
Junchao-Mellanox authored Jan 18, 2024
1 parent 72b6c04 commit cb0fd42
Show file tree
Hide file tree
Showing 4 changed files with 582 additions and 111 deletions.
179 changes: 179 additions & 0 deletions doc/Command-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@
* [MACsec config command](#macsec-config-command)
* [MACsec show command](#macsec-show-command)
* [MACsec clear command](#macsec-clear-command)
* [SFP Utilities Commands](#sfp-utilities-commands)
* [SFP Utilities show commands](#sfp-utilities-show-commands)
* [SFP Utilities read command](#sfp-utilities-read-command)
* [SFP Utilities write command](#sfp-utilities-write-command)
* [Static DNS Commands](#static-dns-commands)
* [Static DNS config command](#static-dns-config-command)
* [Static DNS show command](#static-dns-show-command)
Expand Down Expand Up @@ -12937,6 +12941,181 @@ Clear MACsec counters which is to reset all MACsec counters to ZERO.
Go Back To [Beginning of the document](#) or [Beginning of this section](#macsec-commands)
# SFP Utilities Commands
This sub-section explains the list of commands available for SFP utilities feature.
## SFP Utilities show commands
- Show SFP EEPROM hex dump
```
admin@sonic:~$ sfputil show eeprom-hexdump --help
Usage: sfputil show eeprom-hexdump [OPTIONS]
Display EEPROM hexdump of SFP transceiver(s)
Options:
-p, --port <port_name> Display SFP EEPROM hexdump for port <port_name>
-n, --page <page_number> Display SFP EEEPROM hexdump for
<page_number_in_hex>
--help Show this message and exit.
```
```
admin@sonic:~$ sfputil show eeprom-hexdump --port Ethernet0 --page 0
EEPROM hexdump for port Ethernet0 page 0h
Lower page 0h
00000000 18 30 80 03 00 00 00 00 00 00 00 00 00 00 00 00 |.0..............|
00000010 00 00 00 00 00 00 00 00 00 00 08 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 03 1d 01 88 01 1c 01 44 11 1b 01 |............D...|
00000060 22 55 1a 01 44 11 18 01 11 ff 17 01 44 11 16 01 |"U..D.......D...|
00000070 11 ff 01 01 11 ff 00 00 00 00 00 00 00 00 00 00 |................|
Upper page 0h
00000080 18 4d 65 6c 6c 61 6e 6f 78 20 20 20 20 20 20 20 |.Mellanox |
00000090 20 00 02 c9 4d 43 50 31 36 36 30 2d 57 30 30 41 | ...MCP1660-W00A|
000000a0 45 33 30 20 41 32 4d 54 32 30 31 39 56 53 30 34 |E30 A2MT2019VS04|
000000b0 37 39 35 20 20 20 32 30 30 35 30 37 20 20 00 00 |795 200507 ..|
000000c0 00 00 00 00 00 00 00 00 00 01 05 23 04 05 07 15 |...........#....|
000000d0 00 00 00 02 0a 00 00 00 00 00 00 00 00 00 77 00 |..............w.|
000000e0 33 30 33 33 30 4b 34 33 34 31 30 44 00 00 00 00 |30330K43410D....|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
admin@sonic:~$ sfputil show eeprom-hexdump --port Ethernet0 --page 1
EEPROM hexdump for port Ethernet0 page 1h
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 1h
00000080 11 00 23 88 00 00 04 00 00 00 00 08 ff 00 00 00 |..#.............|
00000090 00 00 01 a0 4d 65 6c 6c 61 6e 6f 78 20 20 20 20 |....Mellanox |
000000a0 20 20 20 20 00 00 02 c9 4d 43 50 31 36 35 30 2d | ....MCP1650-|
000000b0 56 30 30 31 45 33 30 20 41 32 02 03 05 07 46 c5 |V001E30 A2....F.|
000000c0 40 00 00 00 4d 54 32 30 31 30 56 53 30 38 33 32 |@...MT2010VS0832|
000000d0 39 20 20 20 32 30 30 33 30 32 20 20 00 00 6a 84 |9 200302 ..j.|
000000e0 31 39 32 32 39 33 31 43 41 31 43 54 00 1e 00 00 |1922931CA1CT....|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 |.............0..|
admin@sonic:~$ sfputil show eeprom-hexdump
EEPROM hexdump for port Ethernet0
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
00000080 11 00 23 88 00 00 04 00 00 00 00 08 ff 00 00 00 |..#.............|
00000090 00 00 01 a0 4d 65 6c 6c 61 6e 6f 78 20 20 20 20 |....Mellanox |
000000a0 20 20 20 20 00 00 02 c9 4d 43 50 31 36 35 30 2d | ....MCP1650-|
000000b0 56 30 30 31 45 33 30 20 41 32 02 03 05 07 46 c5 |V001E30 A2....F.|
000000c0 40 00 00 00 4d 54 32 30 31 30 56 53 30 38 33 32 |@...MT2010VS0832|
000000d0 39 20 20 20 32 30 30 33 30 32 20 20 00 00 6a 84 |9 200302 ..j.|
000000e0 31 39 32 32 39 33 31 43 41 31 43 54 00 1e 00 00 |1922931CA1CT....|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 |.............0..|
EEPROM hexdump for port Ethernet8
Lower page 0h
00000000 18 30 80 03 00 00 00 00 00 00 00 00 00 00 00 00 |.0..............|
00000010 00 00 00 00 00 00 00 00 00 00 08 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 03 1d 01 88 01 1c 01 44 11 1b 01 |............D...|
00000060 22 55 1a 01 44 11 18 01 11 ff 17 01 44 11 16 01 |"U..D.......D...|
00000070 11 ff 01 01 11 ff 00 00 00 00 00 00 00 00 00 00 |................|
Upper page 0h
00000080 18 4d 65 6c 6c 61 6e 6f 78 20 20 20 20 20 20 20 |.Mellanox |
00000090 20 00 02 c9 4d 43 50 31 36 36 30 2d 57 30 30 41 | ...MCP1660-W00A|
000000a0 45 33 30 20 41 32 4d 54 32 30 31 39 56 53 30 34 |E30 A2MT2019VS04|
000000b0 37 39 35 20 20 20 32 30 30 35 30 37 20 20 00 00 |795 200507 ..|
000000c0 00 00 00 00 00 00 00 00 00 01 05 23 04 05 07 15 |...........#....|
000000d0 00 00 00 02 0a 00 00 00 00 00 00 00 00 00 77 00 |..............w.|
000000e0 33 30 33 33 30 4b 34 33 34 31 30 44 00 00 00 00 |30330K43410D....|
000000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
```
# SFP Utilities read command
- Read SFP EEPROM data
```
admin@sonic:~$ sfputil read-eeprom --help
Usage: sfputil read-eeprom [OPTIONS]
Read SFP EEPROM data
Options:
-p, --port <logical_port_name> Logical port name [required]
-n, --page <page> EEPROM page number [required]
-o, --offset <offset> EEPROM offset within the page [required]
-s, --size <size> Size of byte to be read [required]
--no-format Display non formatted data
--wire-addr TEXT Wire address of sff8472
--help Show this message and exit.
```
```
admin@sonic:~$ sfputil read-eeprom -p Ethernet0 -n 0 -o 100 -s 2
00000064 4a 44 |..|
admin@sonic:~$ sfputil read-eeprom --port Ethernet0 --page 0 --offset 0 --size 32
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 |................|
admin@sonic:~$ sfputil read-eeprom --port Ethernet0 --page 0 --offset 100 --size 2 --no-format
4a44
```
# SFP Utilities write command
- Write SFP EEPROM data
```
admin@sonic:~$ sfputil write-eeprom --help
Usage: sfputil write-eeprom [OPTIONS]
Write SFP EEPROM data
Options:
-p, --port <logical_port_name> Logical port name [required]
-n, --page <page> EEPROM page number [required]
-o, --offset <offset> EEPROM offset within the page [required]
-d, --data <data> Hex string EEPROM data [required]
--wire-addr TEXT Wire address of sff8472
--verify Verify the data by reading back
--help Show this message and exit.
```
- Write success
```
admin@sonic:~$ sfputil write-eeprom -p Ethernet0 -n 0 -o 100 -d 4a44
admin@sonic:~$ sfputil write-eeprom --port Etherent0 --page 0 --offset 100 --data 0000 --verify
```
- Write fail
```
admin@sonic:~$ sfputil write-eeprom -p Etherent0 -n 0 -o 100 -d 4a44 --verify
Error: Write data failed! Write: 4a44, read: 0000.
```
Go Back To [Beginning of the document](#) or [Beginning of this section](#sfp-utilities-commands)
# Static DNS Commands
This sub-section explains the list of the configuration options available for static DNS feature.
Expand Down
1 change: 1 addition & 0 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ main() {
save_cmd "show interface transceiver presence" "interface.xcvrs.presence" &
save_cmd "show interface transceiver eeprom --dom" "interface.xcvrs.eeprom" &
save_cmd "show ip interface -d all" "ip.interface" &
save_cmd "sfputil show eeprom-hexdump" "interface.xcvrs.eeprom.raw" &
wait

save_cmd "lldpctl" "lldpctl" &
Expand Down
Loading

0 comments on commit cb0fd42

Please sign in to comment.