diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2014-04-09 09:26:01 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-05-29 11:13:59 -0500 |
commit | 6750245027d53c6ba0b671f522e26971dc142653 (patch) | |
tree | 884153c378b78f6f0619855123ac652873b2fa9d /src/usr/hwas | |
parent | c417ae8cd562fb538cc3011a38ff1d9f2268748c (diff) | |
download | talos-hostboot-6750245027d53c6ba0b671f522e26971dc142653.tar.gz talos-hostboot-6750245027d53c6ba0b671f522e26971dc142653.zip |
Add multi-node support to _deconfigureAssocProc
Change-Id: I6344e2737ed20af55516c159a459e2e91929fb8b
RTC:86185
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11130
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwas')
-rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 70 | ||||
-rw-r--r-- | src/usr/hwas/test/hwasGardTest.H | 96 |
2 files changed, 150 insertions, 16 deletions
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index d6291810b..b4be51353 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -329,13 +329,31 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl( break; } - // Deconfigure procs based on fabric bus deconfigs and perform SMP - // node balancing - l_pErr = _invokeDeconfigureAssocProc(); - if (l_pErr) + if (iv_XABusEndpointDeconfigured) { - HWAS_ERR("Error from _invokeDeconfigureAssocProc"); - break; + // Check if Abus decofigures should be considered in algorithm + bool l_doAbusDeconfig = pSys->getAttr<ATTR_DO_ABUS_DECONFIG>(); + // Get all present nodes + TargetHandleList l_presNodes; + getEncResources(l_presNodes, TYPE_NODE, UTIL_FILTER_PRESENT); + + for (TargetHandleList::const_iterator + l_nodesIter = l_presNodes.begin(); + l_nodesIter != l_presNodes.end(); + ++l_nodesIter) + { + l_pErr = _invokeDeconfigureAssocProc(*l_nodesIter, + l_doAbusDeconfig); + if (l_pErr) + { + HWAS_ERR("Error from _invokeDeconfigureAssocProc"); + break; + } + // Set for deconfigure algorithm to run on every node even if + // no buses deconfigured (needed for multi-node systems) + setXABusEndpointDeconfigured(true); + } + setXABusEndpointDeconfigured(false); } } while (0); @@ -703,11 +721,14 @@ errlHndl_t DeconfigGard::deconfigureAssocProc() } //****************************************************************************** -errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() +errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc( + const TARGETING::ConstTargetHandle_t i_node, + bool i_doAbusDeconfig) { HWAS_INF("Preparing data for _deconfigureAssocProc "); // Return error errlHndl_t l_pErr = NULL; + // Define vector of ProcInfo structs to be used by // _deconfigAssocProc algorithm. Declared here so // "delete" can be used outside of do {...} while(0) @@ -730,16 +751,28 @@ errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() // Clear flag as this function is called multiple times iv_XABusEndpointDeconfigured = false; + // Get top 'starting' level target - use top level target if no + // i_node given (hostboot) + Target *pTop; + if (i_node == NULL) + { + HWAS_INF("_invokeDeconfigureAssocProc: i_node not specified"); + targetService().getTopLevelTarget(pTop); + HWAS_ASSERT(pTop, "_invokeDeconfigureAssocProc: no TopLevelTarget"); + } + else + { + HWAS_INF("_invokeDeconfigureAssocProc: i_node 0x%X specified", + i_node->getAttr<ATTR_HUID>()); + pTop = const_cast<Target *>(i_node); + } + // Define and populate vector of procs // Define predicate PredicateCTM predProc(CLASS_CHIP, TYPE_PROC); PredicateHwas predPres; predPres.present(true); - // Get top level target - Target * l_pSys; - targetService().getTopLevelTarget(l_pSys); - // Find master proc Target* l_pMasterProcTarget; targetService(). @@ -749,7 +782,7 @@ errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() // Populate vector TargetHandleList l_procs; targetService().getAssociated(l_procs, - l_pSys, + pTop, TargetService::CHILD, TargetService::ALL, &predProc); @@ -768,8 +801,10 @@ errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() PredicatePostfixExpr busses; busses.push(&predAbus).push(&predPres).And().push(&predXbus).Or(); - // Iterate through procs and populate l_procInfo - // vector with system information regarding procs + // Iterate through procs and populate l_procInfo vector with system + // information regarding procs to be used by _deconfigAssocProc + // algorithm. + ProcInfoVector l_procInfo; for (TargetHandleList::const_iterator l_procsIter = l_procs.begin(); l_procsIter != l_procs.end(); @@ -873,8 +908,9 @@ errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() !(isFunctional(*l_busIter)); xBusIndex++; } - else if (TYPE_ABUS == (*l_busIter)-> - getAttr<ATTR_TYPE>()) + // If subsystem owns abus deconfigs consider them + else if (i_doAbusDeconfig && + TYPE_ABUS == (*l_busIter)->getAttr<ATTR_TYPE>()) { (*l_procInfoIter).iv_pAProcs[aBusIndex] = &(*l_matchProcInfoIter); @@ -888,6 +924,7 @@ errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() } } } + // call _deconfigureAssocProc() to run deconfig algorithm // based on current state of system obtained above l_pErr = _deconfigureAssocProc(l_procInfo); @@ -896,6 +933,7 @@ errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc() HWAS_ERR("Error from _deconfigureAssocProc "); break; } + // Iterate through l_procInfo and deconfigure any procs // which _deconfigureAssocProc marked for deconfiguration for (ProcInfoVector::const_iterator diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H index 72388c872..2446c92c7 100644 --- a/src/usr/hwas/test/hwasGardTest.H +++ b/src/usr/hwas/test/hwasGardTest.H @@ -2857,6 +2857,102 @@ public: } /** + * @brief Test Deconfigure Associated Proc9 + */ + void testDeconfigureAssocProc9() + { + TS_TRACE(INFO_MRK "testDeconfigureAssocProc9: Started"); + + // This test populates structs which contain information + // regarding a processor and its child chiplet's linkage + // and states. A vector of these structs, effectively + // describing the system, is passed to the + // _deconfigureAssocProc algorithm which marks procs to + // be deconfigured based on existing bus deconfigurations. + + // SCENARIO 1: TULETA 4 System with Proc 3 NP which is indicated by + // No Abus endpoints on Proc 1 and 3 and no Xbus endpoint on Proc1 + + // Return error for _deconfigureAssocProc + errlHndl_t l_pErr = NULL; + + // User-defined number of procs + size_t NUM_PROCS = 4; + + // Define and populate vector + DeconfigGard::ProcInfoVector l_tuletaProcs; + DeconfigGard::ProcInfo l_ProcInfo = DeconfigGard::ProcInfo(); + l_tuletaProcs.insert(l_tuletaProcs.begin(), NUM_PROCS, l_ProcInfo); + + // Set proc options + // Proc0: + l_tuletaProcs[0].iv_pThisProc = NULL; // Target * + l_tuletaProcs[0].procHUID = 0; // HUID + l_tuletaProcs[0].procFabricNode = 0; // FABRIC_NODE_ID + l_tuletaProcs[0].procFabricChip = 0; // FABRIC_CHIP_ID + l_tuletaProcs[0].iv_isMaster = true; // Master proc + l_tuletaProcs[0].iv_deconfigured = false; // HWAS state + // ABus links and states + l_tuletaProcs[0].iv_pAProcs[0] = &l_tuletaProcs[2]; + l_tuletaProcs[0].iv_pAProcs[1] = &l_tuletaProcs[2]; + // XBus links and states + l_tuletaProcs[0].iv_pXProcs[0] = &l_tuletaProcs[1]; + + // Proc1: + l_tuletaProcs[1].iv_pThisProc = NULL; // Target * + l_tuletaProcs[1].procHUID = 1; // HUID + l_tuletaProcs[1].procFabricNode = 0; // FABRIC_NODE_ID + l_tuletaProcs[1].procFabricChip = 1; // FABRIC_CHIP_ID + l_tuletaProcs[1].iv_isMaster = false; // Not master proc + l_tuletaProcs[1].iv_deconfigured = false; // HWAS state + // XBus links and states + l_tuletaProcs[1].iv_pXProcs[0] = &l_tuletaProcs[0]; + + // Proc2: + l_tuletaProcs[2].iv_pThisProc = NULL; // Target * + l_tuletaProcs[2].procHUID = 2; // HUID + l_tuletaProcs[2].procFabricNode = 1; // FABRIC_NODE_ID + l_tuletaProcs[2].procFabricChip = 0; // FABRIC_CHIP_ID + l_tuletaProcs[2].iv_isMaster = false; // Not master proc + l_tuletaProcs[2].iv_deconfigured = false; // HWAS state + // ABus links and states + l_tuletaProcs[2].iv_pAProcs[0] = &l_tuletaProcs[0]; + l_tuletaProcs[2].iv_pAProcs[1] = &l_tuletaProcs[0]; + // No xbus because proc3 is "not present" + + // Proc3: + l_tuletaProcs[3].iv_pThisProc = NULL; // Target * + l_tuletaProcs[3].procHUID = 3; // HUID + l_tuletaProcs[3].procFabricNode = 1; // FABRIC_NODE_ID + l_tuletaProcs[3].procFabricChip = 1; // FABRIC_CHIP_ID + l_tuletaProcs[3].iv_isMaster = false; // Not master proc + l_tuletaProcs[3].iv_deconfigured = true; // HWAS state + // Xbus links still has xbus to proc 2 because proc 2 is functional + l_tuletaProcs[3].iv_pXProcs[0] = &l_tuletaProcs[2]; + + // Call _deconfigureAssocProc to determine which procs + // should be deconfigured based on state of system passed in + l_pErr = DeconfigGard::_deconfigureAssocProc(l_tuletaProcs); + if (l_pErr) + { + HWAS_ERR("Error from _deconfigureAssocProc "); + } + + // Check result + if (l_tuletaProcs[0].iv_deconfigured == false && + l_tuletaProcs[1].iv_deconfigured == false && + l_tuletaProcs[2].iv_deconfigured == true && + l_tuletaProcs[3].iv_deconfigured == true) + { + TS_TRACE(INFO_MRK "testDeconfigureAssocProc9: Success"); + } + else + { + TS_FAIL("testDeconfigureAssocProc9: incorrect configuration returned"); + } + } + + /** * @brief Test Deconfig Present Association 1 */ void testdeconfigPresentByAssoc1() |