Repository navigation
fix(ipmi): read the SDR record count as one 16-bit value - #8012
Open
viniciusferrao wants to merge 6 commits into
Open
viniciusferrao wants to merge 6 commits into
viniciusferrao wants to merge 6 commits into
Conversation
When Get Device ID or a step of the SDR read failed, the plugin reported the error through sendoutput. Seven of these calls passed an array reference, which sendoutput takes as its return code, so the error was dropped. The other five named the node BADCODE. A refused SDR reservation also went on to read records with no reservation ID. Report these errors with sendmsg against the node, as the rest of the plugin does, and stop after a refused reservation.
Each step of the device ID and SDR read reports a timeout as an error of the node and stops, and a refused SDR reservation sends no Get SDR request.
rinv, rvitals and reventlog stopped with "SDR reservation unsupported." when Get SDR Repository Info did not set the reservation bit. An OpenBMC build clears that bit but grants Reserve SDR Repository, so these commands failed on a server that ipmitool reads. Send Reserve SDR Repository in every case. When the bit is clear and the BMC rejects the command as invalid, the error stays "SDR reservation unsupported." Other refusals report their completion code.
Replay the Get SDR Repository Info reply of an OpenBMC build that clears the reservation bit. The read asks for the reservation and uses the ID it gets. An invalid command refusal still reports "SDR reservation unsupported." against the node, a busy or privilege refusal reports its completion code, and a BMC that sets the bit is asked as before.
got_sdr_rep_info computed the record count as ($returnd[1] + $returnd[2]) << 8, because Perl gives + a higher precedence than <<. The count names the SDR cache of a BMC. Counts whose two bytes have the same sum, such as 39 and 294, shared a cache. A BMC that went from one count to the other reused the old SDR. Shift only the MS byte, and raise the SDR cache version to 5. A cache file from the old encoding can have the name of a new count: the file for 257 records is named 512. The version makes each BMC model read its SDR again once after the update.
Check that got_sdr_rep_info selects another SDR cache when the record count changes from 39 to 294 or from 1 to 256. Check that the same count keeps the same cache. Check that loadsdrcache does not load a cache file of an earlier release, and still loads a file that storsdrcache wrote.
This branch has not been deployed
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.
got_sdr_rep_infocomputed the SDR record count as($returnd[1] + $returnd[2]) << 8, because Perl gives+a higher precedence than<<. The count names the SDR cache of a BMC. Record counts whose two bytes have the same sum, such as 39 and 294, shared a cache. A BMC that changed from one count to the other reused its old SDR.Only the MS byte is shifted now, and the SDR cache version is 5. A cache file of an earlier release can have the name of a new count. With the new version, each BMC model reads its SDR again once after the update.
Depends on #8000 and includes its commits.