Skip to content

Support reading/writing module EEPROM data by page and offset#3008

Merged
prgeor merged 19 commits intosonic-net:masterfrom
Junchao-Mellanox:master_rw_eeprom
Dec 8, 2023
Merged

Support reading/writing module EEPROM data by page and offset#3008
prgeor merged 19 commits intosonic-net:masterfrom
Junchao-Mellanox:master_rw_eeprom

Conversation

@Junchao-Mellanox
Copy link
Copy Markdown
Collaborator

@Junchao-Mellanox Junchao-Mellanox commented Oct 10, 2023

What I did

Add two CLIs:

  • sfputil read-eeprom
  • sfputil write-eeprom

Allow user to read/write EEPROM by page and offset

How I did it

See design:
sonic-net/SONiC#1475

How to verify it

Unit test

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

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

sfputil read-eeprom Ethernet0 0 100 2
00000064 4a 44                                            |..|
sfputil read-eeprom Ethernet0 0 0 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 |................|
sfputil read-eeprom Ethernet0 0 100 2 --no-format
4a44

Comment thread sfputil/main.py Outdated
mihirpat1
mihirpat1 previously approved these changes Oct 20, 2023
@keboliu
Copy link
Copy Markdown
Collaborator

keboliu commented Nov 23, 2023

@mihirpat1 @prgeor would you please help to review again?

Comment thread doc/Command-Reference.md
@Junchao-Mellanox
Copy link
Copy Markdown
Collaborator Author

@mihirpat1 , I fixed the comments, could you please review again?

Comment thread doc/Command-Reference.md
Comment thread sfputil/main.py Outdated
Comment thread sfputil/main.py Outdated
mihirpat1
mihirpat1 previously approved these changes Nov 30, 2023
Comment thread sfputil/main.py Outdated
Comment thread sfputil/main.py Outdated
@liat-grozovik
Copy link
Copy Markdown
Collaborator

@Junchao-Mellanox is the dependency is still valid? I see the PR is closed.

@Junchao-Mellanox
Copy link
Copy Markdown
Collaborator Author

@Junchao-Mellanox is the dependency is still valid? I see the PR is closed.

Thanks for reminder. This dependency is no longer needed.

@prgeor prgeor merged commit 50380e1 into sonic-net:master Dec 8, 2023
@prgeor
Copy link
Copy Markdown
Contributor

prgeor commented Dec 8, 2023

@liat-grozovik @Junchao-Mellanox there is cherry pick conflict so need separate pr for 202311

Junchao-Mellanox added a commit to Junchao-Mellanox/sonic-utilities that referenced this pull request Dec 8, 2023
…net#3008)

* Support reading/writing module EEPROM data by page and offset

* Fix unit test issue

* Fix unit test issue

* Fix review comment

* Update command ref

* Fix format

* Update main.py

* Fix review comments

* Fix review comment

* Remove un-intended change

* Update Command-Reference.md

* Update Command-Reference.md

* Fix review comments

* Fix review comments

* User click.IntRange to avoid duplicate validation

* Fix review comments

* Update sfputil_test.py
Junchao-Mellanox added a commit to Junchao-Mellanox/sonic-utilities that referenced this pull request Dec 8, 2023
…net#3008)

* Support reading/writing module EEPROM data by page and offset

* Fix unit test issue

* Fix unit test issue

* Fix review comment

* Update command ref

* Fix format

* Update main.py

* Fix review comments

* Fix review comment

* Remove un-intended change

* Update Command-Reference.md

* Update Command-Reference.md

* Fix review comments

* Fix review comments

* User click.IntRange to avoid duplicate validation

* Fix review comments

* Update sfputil_test.py
@Junchao-Mellanox
Copy link
Copy Markdown
Collaborator Author

PR for 202311: #3073

@Junchao-Mellanox Junchao-Mellanox deleted the master_rw_eeprom branch December 14, 2023 02:21
Junchao-Mellanox added a commit to Junchao-Mellanox/sonic-utilities that referenced this pull request Dec 14, 2023
…net#3008)

* Support reading/writing module EEPROM data by page and offset

* Fix unit test issue

* Fix unit test issue

* Fix review comment

* Update command ref

* Fix format

* Update main.py

* Fix review comments

* Fix review comment

* Remove un-intended change

* Update Command-Reference.md

* Update Command-Reference.md

* Fix review comments

* Fix review comments

* User click.IntRange to avoid duplicate validation

* Fix review comments

* Update sfputil_test.py
yxieca pushed a commit that referenced this pull request Jan 19, 2024
#3008) (#3073)

* Support reading/writing module EEPROM data by page and offset (#3008)
* Support reading/writing module EEPROM data by page and offset
nmoray pushed a commit to nmoray/sonic-utilities that referenced this pull request Jun 25, 2025
…net#3008)

* Support reading/writing module EEPROM data by page and offset

* Fix unit test issue

* Fix unit test issue

* Fix review comment

* Update command ref

* Fix format

* Update main.py

* Fix review comments

* Fix review comment

* Remove un-intended change

* Update Command-Reference.md

* Update Command-Reference.md

* Fix review comments

* Fix review comments

* User click.IntRange to avoid duplicate validation

* Fix review comments

* Update sfputil_test.py
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.

8 participants