Skip to content
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

Fix the sfputil treats page number as decimal instead of hexadecimal #3153

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

keboliu
Copy link
Collaborator

@keboliu keboliu commented Feb 5, 2024

Fix the sfputil treats page number as decimal instead of hexadecimal

What I did

#3009 breaks the number base rule, treats the page number CLI input as decimal rather than hex, this is used to fix it.

it also containes a redundancy function definition, so remove it.

How I did it

How to verify it

unit test and manually test

Previous command output (if the output of a command-line utility has changed)

sudo sfputil show eeprom-hexdump -n 10 -p Ethernet32
EEPROM hexdump for port Ethernet32 page 10h
        Lower page 0h
        00000000 0d 06 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 0d 00 23 88 00 00 00 00  00 00 00 00 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 1f 00 02 c9  4d 43 50 31 36 30 30 2d |    ....MCP1600-|
        000000b0 45 30 30 41 20 20 20 20  41 33 02 03 04 06 46 85 |E00A    A3....F.|
        000000c0 0b 00 00 00 4d 54 31 37  30 38 56 53 30 36 35 36 |....MT1708VS0656|
        000000d0 36 20 20 20 31 36 31 31  31 35 20 20 00 00 67 62 |6   161115  ..gb|
        000000e0 31 39 32 32 36 32 36 41  5a 34 30 50 00 00 00 00 |1922626AZ40P....|
        000000f0 00 00 00 00 00 00 00 00  00 00 00 00 00 30 00 00 |.............0..|

        Upper page ah
        00000080 0d 00 23 88 00 00 00 00  00 00 00 00 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 1f 00 02 c9  4d 43 50 31 36 30 30 2d |    ....MCP1600-|
        000000b0 45 30 30 41 20 20 20 20  41 33 02 03 04 06 46 85 |E00A    A3....F.|
        000000c0 0b 00 00 00 4d 54 31 37  30 38 56 53 30 36 35 36 |....MT1708VS0656|
        000000d0 36 20 20 20 31 36 31 31  31 35 20 20 00 00 67 62 |6   161115  ..gb|
        000000e0 31 39 32 32 36 32 36 41  5a 34 30 50 00 00 00 00 |1922626AZ40P....|
        000000f0 00 00 00 00 00 00 00 00  00 00 00 00 00 30 00 00 |.............0..|

New command output (if the output of a command-line utility has changed)

sudo sfputil show eeprom-hexdump -n 10 -p Ethernet32
EEPROM hexdump for port Ethernet32 page 10h
        Lower page 0h
        00000000 11 06 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 00 00  00 00 00 05 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 30 30 2d |    ....MCP1600-|
        000000b0 43 30 30 41 45 33 30 4e  41 34 02 03 04 06 46 e4 |C00AE30NA4....F.|
        000000c0 0d 00 00 00 4d 54 31 39  35 32 56 42 30 33 38 38 |....MT1952VB0388|
        000000d0 30 20 20 20 31 39 31 32  32 38 20 20 00 00 67 58 |0   191228  ..gX|
        000000e0 32 34 30 32 39 34 35 43  39 31 4c 30 00 1e 00 00 |2402945C91L0....|
        000000f0 00 00 00 00 00 00 00 00  00 00 00 00 00 30 00 00 |.............0..|

        Upper page 10h
        00000080 11 00 23 88 00 00 00 00  00 00 00 05 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 30 30 2d |    ....MCP1600-|
        000000b0 43 30 30 41 45 33 30 4e  41 34 02 03 04 06 46 e4 |C00AE30NA4....F.|
        000000c0 0d 00 00 00 4d 54 31 39  35 32 56 42 30 33 38 38 |....MT1952VB0388|
        000000d0 30 20 20 20 31 39 31 32  32 38 20 20 00 00 67 58 |0   191228  ..gX|
        000000e0 32 34 30 32 39 34 35 43  39 31 4c 30 00 1e 00 00 |2402945C91L0....|
        000000f0 00 00 00 00 00 00 00 00  00 00 00 00 00 30 00 00 |.............0..|

…22)

Fix the sfputil treats page number as decimal instead of hexadecimal

Signed-off-by: Kebo Liu <[email protected]>
Signed-off-by: Kebo Liu <[email protected]>
@prgeor prgeor merged commit a3cf5c0 into sonic-net:master Feb 7, 2024
5 checks passed
@mihirpat1
Copy link
Contributor

mihirpat1 commented Feb 7, 2024

@yxieca - Can you please help to cherry-pick this to 202311?
ADO - 26729886

dgsudharsan pushed a commit to dgsudharsan/sonic-utilities that referenced this pull request Feb 8, 2024
…decimal (sonic-net#3153)

* Fix the sfputil treats page number as decimal instead of hexadecimal (#22)

Fix the sfputil treats page number as decimal instead of hexadecimal

Signed-off-by: Kebo Liu <[email protected]>

* remove unreachable code

Signed-off-by: Kebo Liu <[email protected]>

---------

Signed-off-by: Kebo Liu <[email protected]>
@dgsudharsan
Copy link
Collaborator

@mihirpat1 @yxieca Here is the manual cherry-pick PR #3160

yxieca pushed a commit that referenced this pull request Feb 9, 2024
…decimal (#3153) (#3160)

* Fix the sfputil treats page number as decimal instead of hexadecimal (#22)

Signed-off-by: Kebo Liu <[email protected]>
Co-authored-by: Kebo Liu <[email protected]>
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.

7 participants