[Mellanox] Add functionality to handle empty EEPROM files#25
Closed
[Mellanox] Add functionality to handle empty EEPROM files#25
Conversation
noaOrMlnx
approved these changes
Sep 8, 2024
tshalvi
pushed a commit
that referenced
this pull request
Mar 12, 2025
…tically (sonic-net#733) #### Why I did it src/sonic-sairedis ``` * c29f53d - (HEAD -> 202412, origin/HEAD, origin/202412) Optimize counter initialization by reducing the number of bulk counter poll calls and communication between swss/sairedis (#25) (9 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
tshalvi
pushed a commit
that referenced
this pull request
Mar 12, 2025
…tomatically (sonic-net#761) #### Why I did it src/sonic-linux-kernel ``` * b905a55 - (HEAD -> 202412, origin/HEAD, origin/202412) [code sync] Merge code from sonic-net/sonic-linux-kernel:202411 to 202412 (#25) (21 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
tshalvi
pushed a commit
that referenced
this pull request
Mar 12, 2025
…omatically (sonic-net#780) #### Why I did it src/sonic-swss-common ``` * c84a342 - (HEAD -> 202412, origin/HEAD, origin/202412) [FC] remove FLEX_COUNTER_DELAY_STATUS_FIELD (sonic-net#982) (#25) (20 hours ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
tshalvi
pushed a commit
that referenced
this pull request
Aug 25, 2025
…test HEAD automatically (sonic-net#1311) #### Why I did it src/sonic-platform-daemons ``` * 91781ee - (HEAD -> 202412, origin/202412) Catch the xcvrd exception returned by get_transceiver_info (#25) (7 days ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
It was decided that a good way to simulate an I2C stuck scenario would be to have the files representing the module's EEPROM remain empty. When these files are empty, module initialization will not complete because the read_eeprom() function gets stuck in an infinite loop (
while num_bytes > 0:will never evaluate to False as the decrement operationnum_bytes -= read_lengthhas no effect). This happens because 0 bytes are always read from the EEPROM when it is empty. This PR addresses this issue.Work item tracking
How I did it
I added a validation check to ensure that if an attempt to read from the EEPROM results in 0 bytes read, the _read_eeprom() function exits and returns None.
How to verify it
Simulate the empty EEPROM (can be done as described in the script below), update _get_eeprom_path() to redirect to the empty EEPROM location, config reload, and verify that not all ports are down.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)