-
Notifications
You must be signed in to change notification settings - Fork 20
vpd-tool: Add module VPD sanity check #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1120
Are you sure you want to change the base?
Conversation
05e6490
to
18f651e
Compare
ae32363
to
cf8e46d
Compare
cf8e46d
to
4ec2b49
Compare
4ec2b49
to
08cea7e
Compare
08cea7e
to
ce6efd2
Compare
ce6efd2
to
863203d
Compare
863203d
to
e55b3be
Compare
e55b3be
to
1d9024f
Compare
vpd-manager/include/parser.hpp
Outdated
* @throw Data Exception | ||
* @throw ECC Exception | ||
*/ | ||
void vpdSanityCheck(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can keep API name as performVpdSanityCheck or checkVpdSanity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use this term very frequently "sanityCheck" , so i have given this name.
1st level of function is named as performVpdSanityCheck , so can't use it again.
bb9077b
to
f25f592
Compare
why ~ file is being added ? |
vpd-manager/src/parser.cpp
Outdated
ParserFactory::getParser(m_vpdVector, l_eachPath, | ||
m_vpdStartOffset); | ||
|
||
auto rc1 = l_parser->sanityChecker(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can avoid this variable by using rc variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have used 2 rcs here .
I need both of them here.
- internal rc1 will collect immidiate return code for each eerpom call.
- Outer rc will be updated based on condition-
rc = success, rc1 = success, rc2 = success
rc = Failure, rc1 = Failure, rc2 = Failure
rc = Failure, rc1 = success, rc2 = Failure
rc = Failure, rc1 = Failure, rc2 = success
f25f592
to
5c6880d
Compare
5c6880d
to
8341ae6
Compare
{ | ||
try | ||
{ | ||
logging::logMessage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep necessary logs only. This log is not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not sure, it ran for 1 or more eeproms( redundant), in that case this log will be a proof.
Added new dbus API to perform the santity check for all the vpds. It takes one eeprom path at a time and checks for it's redundant paths. For each of them it checks for header, TOC and all it's records and their respective ECC. Test: busctl introspect com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager NAME TYPE SIGNATURE RESULT/VALUE FLAGS .CollectFRUVPD method o - - .GetExpandedLocationCode method sq s - .GetFRUsByExpandedLocationCode method s ao - .GetFRUsByUnexpandedLocationCode method sq ao - .GetHardwarePath method o s - .PerformVPDRecollection method - - - .ReadKeyword method sv v - .UpdateKeyword method sv i - .WriteKeyword method ossay i - .WriteKeywordOnHardware method sv i - .deleteFRUVPD method o - - .performVpdSanityCheck method s - - .CollectionStatus property s "Completed" emits-change writable $ busctl call com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager performVpdSanityCheck s "/sys/bus/spi/drivers/at25/spi12.0/eeprom" $vpd-tool --sanityCheck -P "/sys/bus/spi/drivers/at25/spi22.0/eeprom" DBG: validating eeprom - /sys/bus/spi/drivers/at25/spi22.0/eeprom DBG: Calling DBUS API for - /sys/bus/spi/drivers/at25/spi22.0/eeprom DBG: returned from DBUS API, return code - 0 VPD validation Successful. journal- Sep 10 21:09:53 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1006 Performing sanity check for file path: /sys/bus/spi/drivers/at25/spi22.0/eeprom Sep 10 21:09:53 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1019 SUCCESS Sep 10 21:09:53 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/parser.cpp, Line: 386 Sanity checker Passed for /sys/bus/spi/drivers/at25/spi22.0/eeprom Sep 10 21:09:54 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1006 Performing sanity check for file path: /sys/bus/spi/drivers/at25/spi23.0/eeprom Sep 10 21:09:54 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1019 SUCCESS Sep 10 21:09:54 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/parser.cpp, Line: 386 Sanity checker Passed for /sys/bus/spi/drivers/at25/spi23.0/eeprom Sep 10 21:11:10 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1006 Performing sanity check for file path: /sys/bus/spi/drivers/at25/spi22.0/eeprom Sep 10 21:11:10 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1019 SUCCESS Sep 10 21:11:10 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/parser.cpp, Line: 386 Sanity checker Passed for /sys/bus/spi/drivers/at25/spi22.0/eeprom Sep 10 21:11:11 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1006 Performing sanity check for file path: /sys/bus/spi/drivers/at25/spi23.0/eeprom Sep 10 21:11:11 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/ipz_parser.cpp, Line: 1019 SUCCESS Sep 10 21:11:11 p10bmc vpd-manager[1094]: FileName: /usr/src/debug/openpower-fru-vpd/1.0+git/vpd-manager/src/parser.cpp, Line: 386 Sanity checker Passed for /sys/bus/spi/drivers/at25/spi23.0/eeprom Error case- $busctl call com.ibm.VPD.Manager /com/ibm/VPD/Manager com.ibm.VPD.Manager performVpdSanityCheck s "" "0x50003D0E": { "SRC": "BD554000", "Message": "An EEPROM path access error occurred.", "PLID": "0x50003D0E", "CreatorID": "BMC", "Subsystem": "CEC Hardware - VPD Interface", "Commit Time": "09/05/2025 09:10:03", "Sev": "Informational Event", "CompID": "bmc vpd" Signed-off-by: Alpana Kumari <[email protected]>
8341ae6
to
bc14ab7
Compare
void clearVpdDumpDir() const noexcept; | ||
|
||
/** | ||
* @brief It validates the record and ECC of FRU path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: API validates record against the ECC for that record.
* @brief It validates the record and ECC of FRU path. | ||
* | ||
* This API calls dbus API to verify the record and ECC of user provided | ||
* EEPROM path. That dbus API internally checks for- is there a redundant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That dbus API
Which D-Bus API? Can be more specific?
* | ||
* This API calls dbus API to verify the record and ECC of user provided | ||
* EEPROM path. That dbus API internally checks for- is there a redundant | ||
* EEPROM for this FRU. If found , it verifies the same for redundant one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checks for- is
What is the "-" for?
Could you please rephrase the additional description.
* EEPROM path. That dbus API internally checks for- is there a redundant | ||
* EEPROM for this FRU. If found , it verifies the same for redundant one | ||
* also. | ||
* @param[in] eepromPath - EEPROM path to perform sanity check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any "eepromPath" as input to the API.
#include <tuple> | ||
namespace vpd | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required?
const types::WriteVpdParams& i_paramsToWriteData); | ||
|
||
/* | ||
* @brief API to perform sanity check on the EEPROM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you say "the" EEPROM. Which EEPROM should I assume. I don't see any in the parameter list or reference to any EEPROM here.
|
||
int Parser::vpdSanityCheck() noexcept | ||
{ | ||
std::vector<types::Path> l_fruPaths{m_vpdFilePath}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need another data structure for this? Can we check it in place? I see Unnecessary string copies.
for (const auto& l_eachPath : l_fruPaths) | ||
{ | ||
// Read the VPD data into a vector. | ||
vpdSpecificUtility::getVpdDataInVector(l_eachPath, m_vpdVector, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of two calls can we use "getVpdParserInstance"? Will that help?
} | ||
|
||
/** | ||
* @brief Virtual API to perform sanity check on EEPROM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@branupama When we say "the" it needs to be definite. Here I don't see reference to the any specific EEPROM in the API , hence I don't agree with "the EEPROM"
Having said that, to explain which EEPROM this API will perform action upon, @Alpana07 you will have to give some reference, like
API to perform sanity check on EEPROM passed via constructor of parser class.
// Verify the ECC for this Record | ||
if (!recordEccCheck(itrToPT)) | ||
{ | ||
logging::logMessage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already maintain a list of invalid records, can that be used here instead of logging one at a time.
Uh oh!
There was an error while loading. Please reload this page.