Skip to content

Commit

Permalink
Improve performance of general PG algorithm
Browse files Browse the repository at this point in the history
The previous PG algorithm had several places where targets would be
rechecked or modified unnecessarily. This commit restructures the PG
algorithm and pulls all related code out of discoverTargets and adds it
to checkPartialGoodForDescendants which will be called by
discoverTargets.

Change-Id: I045f17f7ac22c673633cd3d951997b2371be1b8d
RTC:206066
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72732
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
MRaybuck authored and dcrowell77 committed Mar 18, 2019
1 parent e0f0351 commit 3265b62
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 252 deletions.
71 changes: 70 additions & 1 deletion src/include/usr/hwas/common/hwasCommon.H
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ typedef std::map<const TARGETING::TargetHandle_t, bool> pgState_map;
* from VPD; must be malloc'ed by the caller, and
* must be VPD_CP00_PG_DATA_ENTRIES in size.
*
* @param[in] io_targetStates Reference to the target state map to prevent
* @param[io] io_targetStates Reference to the target state map to prevent
* re-checking targets.
*
* @return bool Returns true if the descendant is functional;
Expand All @@ -169,6 +169,75 @@ bool isDescFunctional(const TARGETING::TargetHandle_t &i_desc,
const uint16_t (&i_pgData)[VPD_CP00_PG_DATA_ENTRIES],
pgState_map &io_targetStates);


/**
* @brief Checks the PG keyword data to determine if all
* of the descendant chiplets are functional. The
* caller is responsible for allocating and
* de-allocating the PG keyword space.
*
* @param[in] i_pTarget The target whose descendants need to be
* checked. Must not be nullptr.
*
* @param[in] i_pgData Reference to area holding the PG keyword read
* from VPD; must be malloc'ed by the caller, and
* must be VPD_CP00_PG_DATA_ENTRIES in size.
*
* @param[in] i_chipFunctional The functional state of i_pTarget.
*
* @param[in] i_errlEid Error log ID of the error associated with
* i_pTarget, if any.
*
* @param[io] io_infoErrl The informational error log that contains PG
* issues.
*
* @param[io] io_createInfoLog Determines whether or not PG issues exist and
* if the informational log should be created.
*
* @param[in] i_isTestcase Determines if the code is running from a
* testcase and if so will not modify the state
* of the system. Defaulted to false.
*
* @param[out] o_testResult A pointer to the functional state of i_pTarget
* if we are running a test. Default nullptr.
*
* @return Returns an error if encountered, otherwise
* nullptr.
*
*/
errlHndl_t checkPartialGoodForDescendants(
const TARGETING::TargetHandle_t &i_pTarget,
const uint16_t (&i_pgData)[VPD_CP00_PG_DATA_ENTRIES],
const bool i_chipFunctional,
const uint32_t i_errlEid,
errlHndl_t io_infoErrl,
bool &io_createInfoLog,
bool i_isTestcase = false,
bool* o_testResult = nullptr);

/**
* @brief This function will propagate a parent's
* non-functional status down to all functional
* children since children cannot be considered
* functional if they have non-functional parents.
* NOTE: This function will only mark children
* non-functional if the passed-in parent is
* non-functional and is in the io_targetStates
* map. Therefore, if a parent is passsed in that
* is functional or missing from the
* io_targetStates map (parent state unknown) this
* function behaves as a no-op.
*
* @param[in] i_desc Pointer to the parent target we're looking
* at. Must not be nullptr.
*
* @param[io] io_targetStates Reference to the pgState_map that will be
* updated by this function.
*
*/
void markChildrenNonFunctional(const TARGETING::TargetHandle_t &i_parent,
pgState_map &io_targetStates);

/**
* @deprecated
* @brief platform specific code to determine the PR vector of the input
Expand Down
2 changes: 2 additions & 0 deletions src/include/usr/hwas/common/hwas_reasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ namespace HWAS
MOD_FIND_RULES_FOR_TARGET = 0x0A,
MOD_DISCOVER_TARGETS = 0x0B,
MOD_UPDATE_PROC_COMPAT_RISK_LEVEL = 0x0C,
MOD_CHECK_PG_FOR_DESC = 0x0D,
};

enum HwasReasonCode
Expand Down Expand Up @@ -78,6 +79,7 @@ namespace HWAS
RC_FORCED_COMPAT_INVALID_LEVEL = HWAS_COMP_ID | 0x1B,
RC_FORCED_NATIVE_INVALID_MIXED_EC = HWAS_COMP_ID | 0x1C,
RC_FORCED_NATIVE_OF_INCOMPATIBLE_RISK = HWAS_COMP_ID | 0x1D,
RC_PARTIAL_GOOD_MISSING_TARGET = HWAS_COMP_ID | 0x1E,
};

enum HwasPlatUserDetailsTypes
Expand Down
4 changes: 2 additions & 2 deletions src/include/usr/hwas/common/pgLogic.H
Original file line number Diff line number Diff line change
Expand Up @@ -695,14 +695,14 @@ namespace PARTIAL_GOOD
APPLICABLE_TO_ALL,
NO_SPECIAL_RULE
),
// OBUS Rule 3: pbioo1 unit on chiplet N3 must be checked
// OBUS Rule 3: pbioo1 unit on chiplet N1 must be checked
// for Cumulus OBUSes (chip unit 1 and 2).
new PartialGoodRule
(
{&PREDICATE_CUMULUS},
OBUS_R3_PG_MASK,
ALL_OFF_AG_MASK,
N3_PG_INDEX,
N1_PG_INDEX,
OBUS_R3_CU_MASK,
NO_SPECIAL_RULE
),
Expand Down
2 changes: 1 addition & 1 deletion src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ TESTCASE_MODULES += $(if $(CONFIG_EARLY_TESTCASES),,testrtloader)
TESTCASE_MODULES += testsbe
TESTCASE_MODULES += testsbeio
TESTCASE_MODULES += testerrl
TESTCASE_MODULES += testhwas
#TESTCASE_MODULES += testhwas
TESTCASE_MODULES += testvpd
TESTCASE_MODULES += testsyslib
TESTCASE_MODULES += testtlsmod
Expand Down

0 comments on commit 3265b62

Please sign in to comment.