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 #3147

Closed
wants to merge 1 commit into from

Conversation

yuazhe
Copy link
Contributor

@yuazhe yuazhe commented Feb 2, 2024

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..|

@keboliu keboliu requested a review from prgeor February 2, 2024 03:42
Copy link
Contributor

@mihirpat1 mihirpat1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yuazhe - Can you please help in addressing the code coverage check failure.

Copy link
Contributor

@mihirpat1 mihirpat1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please attach the CLI output with hex page number as 10 and 11

@yuazhe
Copy link
Contributor Author

yuazhe commented Feb 2, 2024

Please attach the CLI output with hex page number as 10 and 11

updated.

sonic-net#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.

Signed-off-by: Yuanzhe, Liu <[email protected]>
@prgeor prgeor added the Bug label Feb 2, 2024
@keboliu keboliu closed this Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants