Skip to content

[arista] Limit eeprom reads to 512 bytes#990

Open
dzarista wants to merge 5 commits intofacebook:mainfrom
dzarista:fix-weutil-upstream
Open

[arista] Limit eeprom reads to 512 bytes#990
dzarista wants to merge 5 commits intofacebook:mainfrom
dzarista:fix-weutil-upstream

Conversation

@dzarista
Copy link
Contributor

@dzarista dzarista commented Mar 9, 2026

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

Currently, when reading eeproms, the entire memory space is read, which can take a lot of time. This PR proposes reducing reads to a maximum of 512 bytes. The primary motivation is to reduce platform manager initialization time as well as weutil time.

ParserUtils::loadEeprom() is changed to read a fixed 512-byte region instead of the full file, and IoctlSmbusEepromReader::readEeprom() is updated to accept a length parameter capped at the same limit.

Test Plan

Build passes.
sw_tests pass
weutil_hw_test and platform_manager_hw_test passes across arista platforms
platform_manager reload time reduced by 15-20 seconds across arista platforms

@meta-cla meta-cla bot added the CLA Signed label Mar 9, 2026
@dzarista dzarista changed the title Limit eeprom reads to 512 bytes [proposal] Limit eeprom reads to 512 bytes Mar 9, 2026
@dzarista dzarista changed the title [proposal] Limit eeprom reads to 512 bytes [arista] Limit eeprom reads to 512 bytes Mar 9, 2026
@github-actions github-actions bot added the arista label Mar 9, 2026
@dzarista dzarista marked this pull request as ready for review March 9, 2026 20:51
@dzarista dzarista requested a review from a team as a code owner March 9, 2026 20:51
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Mar 12, 2026

@somasun has imported this pull request. If you are a Meta employee, you can view this in D96379392.

@somasun
Copy link
Contributor

somasun commented Mar 12, 2026

@dzarista - how much improvement are you seeing in platform set up time with this change?

@somasun
Copy link
Contributor

somasun commented Mar 12, 2026

platform_manager reload time reduced by 15-20 seconds across arista platforms

nevermind. I see "platform_manager reload time reduced by 15-20 seconds across arista platforms"

Copy link
Contributor

@somasun somasun left a comment

Choose a reason for hiding this comment

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

Can you add test coverage for this new 512-byte limit

@somasun
Copy link
Contributor

somasun commented Mar 16, 2026

@dzarista - any update on the PR ?

@dzarista dzarista requested a review from a team as a code owner March 16, 2026 20:06
@facebook-github-tools
Copy link

@dzarista has updated the pull request. You must reimport the pull request before landing.

@dzarista
Copy link
Contributor Author

@dzarista - any update on the PR ?

@somasun, apologies for the delay, I've addressed your comments. Regarding testing, I ended up adding a new test file ParserUtilsTest.cpp, which specifically tests that only 512 bytes were read. I opted not to put this in FbossEepromInterfaceTest.cpp as I found it difficult to work it in to that file's format which works with eeproms that are less than 512 bytes.

The test gets built as weuitl_parser_utils_test, and I tested that it passed.

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.

3 participants