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

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

Merged
merged 19 commits into from
Dec 8, 2023

Conversation

Junchao-Mellanox
Copy link
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

sfputil/main.py Outdated Show resolved Hide resolved
mihirpat1
mihirpat1 previously approved these changes Oct 20, 2023
@keboliu
Copy link
Collaborator

keboliu commented Nov 23, 2023

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

doc/Command-Reference.md Outdated Show resolved Hide resolved
@Junchao-Mellanox
Copy link
Collaborator Author

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

sfputil/main.py Outdated Show resolved Hide resolved
sfputil/main.py Outdated Show resolved Hide resolved
mihirpat1
mihirpat1 previously approved these changes Nov 30, 2023
sfputil/main.py Outdated Show resolved Hide resolved
sfputil/main.py Outdated Show resolved Hide resolved
@liat-grozovik
Copy link
Collaborator

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

@Junchao-Mellanox
Copy link
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
5 checks passed
@prgeor
Copy link
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
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
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