[arista] Limit eeprom reads to 512 bytes#990
Conversation
|
@dzarista - how much improvement are you seeing in platform set up time with this change? |
nevermind. I see "platform_manager reload time reduced by 15-20 seconds across arista platforms" |
somasun
left a comment
There was a problem hiding this comment.
Can you add test coverage for this new 512-byte limit
|
@dzarista - any update on the PR ? |
|
@dzarista has updated the pull request. You must reimport the pull request before landing. |
@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. |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
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