diff options
author | Elliott Dahle <dedahle@us.ibm.com> | 2013-11-08 17:00:36 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-11-12 11:45:40 -0600 |
commit | b1ff73ec45a85d566c4be3c31800eefa0cfbfccc (patch) | |
tree | 1db7aa33f2e1f2a4896914206789660475cc89f7 | |
parent | 722e30c099bc1b675f2df96804457f3da191db95 (diff) | |
download | talos-hostboot-b1ff73ec45a85d566c4be3c31800eefa0cfbfccc.tar.gz talos-hostboot-b1ff73ec45a85d566c4be3c31800eefa0cfbfccc.zip |
Single node processor chip deconfig takes out too many processors
Change-Id: Ifccf2f28e0c51c12db73af39844c2570b5a92a85
CQ:SW233565
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7136
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 16 | ||||
-rw-r--r-- | src/usr/hwas/test/hwasGardTest.H | 118 |
2 files changed, 132 insertions, 2 deletions
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index bd4c90fca..6d63b44e7 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -1489,14 +1489,26 @@ errlHndl_t DeconfigGard::_deconfigureAssocProc( { if ((*l_procInfoIter)->iv_ADeconfigured[i]) { - deconfigBusCounter++; + // Only increment deconfigBusCounter if peer proc exists + // and is functional + if((*l_procInfoIter)->iv_pAProcs[i] && + (!(*l_procInfoIter)->iv_pAProcs[i]->iv_deconfigured)) + { + deconfigBusCounter++; + } } } for (uint8_t i = 0; i < NUM_X_BUSES; i++) { if ((*l_procInfoIter)->iv_XDeconfigured[i]) { - deconfigBusCounter++; + // Only increment deconfigBusCounter if peer proc exists + // and is functional + if((*l_procInfoIter)->iv_pXProcs[i] && + (!(*l_procInfoIter)->iv_pXProcs[i]->iv_deconfigured)) + { + deconfigBusCounter++; + } } } // If number of endpoints deconfigured is > 1 diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H index 834937306..a8439f563 100644 --- a/src/usr/hwas/test/hwasGardTest.H +++ b/src/usr/hwas/test/hwasGardTest.H @@ -2781,6 +2781,124 @@ public: }while (0); #endif } + + + + /** + * @brief Test Deconfigure Associated Proc8 + */ + void testDeconfigureAssocProc8() + { + TS_TRACE(INFO_MRK "testDeconfigureAssocProc8: 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 proc2, proc3 and + // all associated bus endpoints deconfigured + + // Return error for _deconfigureAssocProc + errlHndl_t l_pErr = NULL; + + // User-defined number of procs + uint8_t NUM_PROCS = 4; + + // Define and populate vector + std::vector<DeconfigGard::ProcInfo *> l_tuletaProcs(NUM_PROCS); + + for (uint8_t i = 0; i < NUM_PROCS; i++) + { + l_tuletaProcs[i] = new DeconfigGard::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 + l_tuletaProcs[0]->iv_pAProcs[0] = l_tuletaProcs[2]; + l_tuletaProcs[0]->iv_pAProcs[1] = l_tuletaProcs[2]; + l_tuletaProcs[0]->iv_ADeconfigured[0] = true; + l_tuletaProcs[0]->iv_ADeconfigured[1] = true; + 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 + l_tuletaProcs[1]->iv_pAProcs[0] = l_tuletaProcs[3]; + l_tuletaProcs[1]->iv_pAProcs[1] = l_tuletaProcs[3]; + l_tuletaProcs[1]->iv_ADeconfigured[0] = true; + l_tuletaProcs[1]->iv_ADeconfigured[1] = true; + 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 = true; // HWAS state + l_tuletaProcs[2]->iv_pAProcs[0] = l_tuletaProcs[0]; + l_tuletaProcs[2]->iv_pAProcs[1] = l_tuletaProcs[0]; + l_tuletaProcs[2]->iv_ADeconfigured[0] = true; + l_tuletaProcs[2]->iv_ADeconfigured[1] = true; + l_tuletaProcs[2]->iv_pXProcs[0] = l_tuletaProcs[3]; + l_tuletaProcs[2]->iv_XDeconfigured[0] = true; + + + // 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 + l_tuletaProcs[3]->iv_pAProcs[0] = l_tuletaProcs[1]; + l_tuletaProcs[3]->iv_pAProcs[1] = l_tuletaProcs[2]; + l_tuletaProcs[3]->iv_ADeconfigured[0] = true; + l_tuletaProcs[3]->iv_ADeconfigured[1] = true; + l_tuletaProcs[3]->iv_pXProcs[0] = l_tuletaProcs[2]; + l_tuletaProcs[3]->iv_XDeconfigured[0] = true; + + + // Call _deconfigureAssocProc to determine which procs + // should be deconfigured based on state of system passed in + printk("hwasGardTest: Calling _deconfigureAssocProc\n"); + 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 "testDeconfigureAssocProc8: Success"); + } + else + { + TS_FAIL("testDeconfigureAssocProc8: incorrect configuration returned"); + } + // Free previously allocated memory + while(!l_tuletaProcs.empty()) delete l_tuletaProcs.back(), + l_tuletaProcs.pop_back(); + } + + }; #endif |