-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Mellanox] Use sdk sysfs instead of ethtool #12480
Conversation
@Junchao-Mellanox now that PR #12542 is merged, should this PR be ready for review? |
@Junchao-Mellanox do you mind testing your changes with sonic-net/sonic-utilities#2379 ? |
Sure |
Hi @prgeor , I ran some tests based on sonic-net/sonic-utilities#2379. I did not find issue on the current bug, but I found sonic-net/sonic-utilities#2379 itself contains some issues:
if id[0] == 0x3:
output = eeprom_hexdump_sff8472(port, physical_port, page)
else:
output = eeprom_hexdump_sff8636(port, physical_port, page)
page_dump = platform_chassis.get_sfp(physical_port).read_eeprom(SFF8472_A0_SIZE, PAGE_SIZE)
if page_dump is None:
click.echo("Error: Failed to read EEPROM for A2h!")
sys.exit(ERROR_NOT_IMPLEMENTED) |
Conflicts: platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py
No clean cherry-pick, will create PR to 202205 |
Why I did it
Currently, implementation:
The problem is that spawning new process of ethtool/mlxreg is very slow. To optimize the performance, this PR will use SDK provided sys fs for EEPROM reading/writing.
How I did it
Replace the logic of
sfp.read_eeprom
andsfp.write_eeprom
by SDK sys fs.How to verify it
Manual test
Unit test cases (new test case added)
sonic-mgmt regression
Which release branch to backport (provide reason below if selected)
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)