Skip to content

fix(ipmi): read the SDR record count as one 16-bit value - #8012

Open
viniciusferrao wants to merge 6 commits into
xcat2:masterfrom
VersatusHPC:fix/ipmi-sdr-record-count
Open

viniciusferrao wants to merge 6 commits into
xcat2:masterfrom
VersatusHPC:fix/ipmi-sdr-record-count

Conversation

@viniciusferrao

Copy link
Copy Markdown
Member

got_sdr_rep_info computed 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.

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.
@viniciusferrao
viniciusferrao requested a review from dhilst October 31, 2026 03:44
@viniciusferrao viniciusferrao self-assigned this Oct 31, 2026
@viniciusferrao viniciusferrao added this to the 2.20 milestone Oct 31, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant