From 7351357827bbfa5fa39fe7fe5e063080940e803a Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Fri, 23 Jun 2017 17:08:20 -0500 Subject: [PATCH] PRD: Bugs related to banning analysis in MNFG IPL CE Handling Change-Id: I5a6aba740c775a71fef436f739047761d82fc62a CQ: SW394179 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42398 Tested-by: Jenkins Server Reviewed-by: Caleb N. Palmer Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Brian J. Stegmiller Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42631 Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins --- .../diag/prdf/plat/mem/prdfMemIplCeStats.C | 129 ++++++++---------- .../diag/prdf/plat/mem/prdfMemIplCeStats.H | 38 ++++-- 2 files changed, 83 insertions(+), 84 deletions(-) diff --git a/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C b/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C index d2227240d2e..12517c857b4 100755 --- a/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C @@ -57,53 +57,51 @@ using namespace PARSERUTILS; //------------------------------------------------------------------------------ template<> -void MemIplCeStats::banAnalysis( const MemRank & i_rank ) +void MemIplCeStats::banAnalysis( uint8_t i_dimmSlct, + uint8_t i_portSlct ) { - for ( uint8_t i = 0; i < MAX_PORT_PER_MBA; i++ ) - { - HalfRankKey banKey = { i_rank, i }; - iv_bannedAnalysis[banKey] = true; - } + PRDF_ASSERT( i_dimmSlct < MAX_DIMM_PER_PORT ); + PRDF_ASSERT( i_portSlct < MAX_PORT_PER_MBA ); + + DimmKey banKey = { i_dimmSlct, i_portSlct }; + iv_bannedAnalysis[banKey] = true; } //------------------------------------------------------------------------------ template<> -void MemIplCeStats::banAnalysis( const MemRank & i_rank ) +void MemIplCeStats::banAnalysis( uint8_t i_dimmSlct, + uint8_t i_portSlct ) { - for ( uint8_t i = 0; i < MAX_PORT_PER_MCBIST; i++ ) - { - HalfRankKey banKey = { i_rank, i }; - iv_bannedAnalysis[banKey] = true; - } -} + PRDF_ASSERT( i_dimmSlct < MAX_DIMM_PER_PORT ); + PRDF_ASSERT( 0 == i_portSlct ); + DimmKey banKey = { i_dimmSlct, i_portSlct }; + iv_bannedAnalysis[banKey] = true; +} //------------------------------------------------------------------------------ -template -int32_t MemIplCeStats::banAnalysis( const MemRank & i_rank, - uint8_t i_portSlct ) -{ - int32_t o_rc = SUCCESS; - do +template<> +void MemIplCeStats::banAnalysis( uint8_t i_dimmSlct ) +{ + // Two DIMMs per DIMM select on MBA. + for ( uint8_t ps = 0; ps < MAX_PORT_PER_MBA; ps++ ) { - if ( i_portSlct >= MAX_PORT_PER_MBA ) - { - PRDF_ERR("[banAnalysis] i_portSlct (0x%02x) is invalid", - i_portSlct ); - o_rc = FAIL; - break; - } - - HalfRankKey banKey = { i_rank, i_portSlct }; - iv_bannedAnalysis[banKey] = true; + banAnalysis( i_dimmSlct, ps ); + } +} - } while (0); +//------------------------------------------------------------------------------ - return o_rc; +template<> +void MemIplCeStats::banAnalysis( uint8_t i_dimmSlct ) +{ + // Only one DIMM per DIMM select on MCA. + banAnalysis( i_dimmSlct, 0 ); } + //------------------------------------------------------------------------------ template @@ -134,13 +132,8 @@ int32_t MemIplCeStats::collectStats( const MemRank & i_stopRank ) uint8_t portSlct = symData[i].symbol.getPortSlct(); // Check if analysis is banned - HalfRankKey banKey = { i_stopRank, portSlct }; - - // Check if the rank has already been banned. Note that [] will - // create an entry if one does not exist, so used find() instead to - // check for existence in the map. - if ( iv_bannedAnalysis.end() != iv_bannedAnalysis.find(banKey) ) - continue; + DimmKey banKey = { dimmSlct, portSlct }; + if ( iv_bannedAnalysis[banKey] ) continue; // Update iv_ceSymbols with the new symbol data. SymbolKey symkey = { symData[i].symbol }; @@ -209,12 +202,8 @@ int32_t MemIplCeStats::calloutHardCes( const MemRank & i_stopRank ) uint8_t portSlct = symData[i].symbol.getPortSlct(); // Check if analysis is banned. - HalfRankKey banKey = { i_stopRank, portSlct }; - - bool& isBanned = iv_bannedAnalysis[banKey]; - - if ( isBanned ) - continue; + DimmKey banKey = { i_stopRank.getDimmSlct(), portSlct }; + if ( iv_bannedAnalysis[banKey] ) continue; // At this point a hard CE was found, callout the symbol. MemoryMru memMru ( trgt, symData[i].symbol.getRank(), @@ -238,11 +227,13 @@ int32_t MemIplCeStats::calloutHardCes( const MemRank & i_stopRank ) 0, PRDFSIG_MnfgIplHardCE, 0); addMruAndCommitErrl( memMru, l_errl); - // Ban the half rank. - isBanned = true; + iv_bannedAnalysis[banKey] = true; // ban this DIMM } - }while(0); + + } while (0); + return o_rc; + #undef PRDF_FUNC } @@ -259,13 +250,9 @@ bool MemIplCeStats::calloutCePerDram() dramIter != iv_dramMap.end(); dramIter++ ) { // First, check if this half rank is banned from analysis - HalfRankKey banKey = { dramIter->first.rank, dramIter->first.portSlct }; - - // Check if the rank has already been banned. Note that [] will create - // the entry if one does not exist, so used find() instead to check - // for existence in the map. - if ( iv_bannedAnalysis.end() != iv_bannedAnalysis.find(banKey) ) - continue; + DimmKey banKey = { dramIter->first.rank.getDimmSlct(), + dramIter->first.portSlct }; + if ( iv_bannedAnalysis[banKey] ) continue; // Get the CEs per DRAM threshold. uint32_t dramTh = 1, junk0, junk1; @@ -302,8 +289,8 @@ bool MemIplCeStats::calloutCePerDram() addMruAndCommitErrl( memMru, l_errl); - // Ban the half rank. - iv_bannedAnalysis[banKey] = true; + iv_bannedAnalysis[banKey] = true; // ban this DIMM + o_callOutsMade = true; // Only one symbol needs to be called out, so exit on first @@ -329,13 +316,9 @@ bool MemIplCeStats::calloutCePerRank() rankIter != iv_rankMap.end(); rankIter++ ) { // First, check if this half rank is banned from analysis - HalfRankKey banKey = { rankIter->first.rank, rankIter->first.portSlct }; - - // Check if the rank has already been banned. Note that [] will create - // the an entry if one does not exist, so used find() instead to check - // for existence in the map. - if ( iv_bannedAnalysis.end() != iv_bannedAnalysis.find(banKey) ) - continue; + DimmKey banKey = { rankIter->first.rank.getDimmSlct(), + rankIter->first.portSlct }; + if ( iv_bannedAnalysis[banKey] ) continue; // Get the CEs per rank threshold. uint32_t junk0, rankTh, junk1; @@ -371,8 +354,9 @@ bool MemIplCeStats::calloutCePerRank() 0, PRDFSIG_MnfgIplRankCTE, 0); addMruAndCommitErrl( memMru, l_errl); - // Ban the half rank. - iv_bannedAnalysis[banKey] = true; + + iv_bannedAnalysis[banKey] = true; // ban this DIMM + o_callOutsMade = true; // Only one symbol needs to be called out, so exit on first @@ -398,13 +382,9 @@ bool MemIplCeStats::calloutCePerDs() dsIter != iv_dsMap.end(); dsIter++ ) { // First, check if this half fimm select is banned from analysis - HalfRankKey banKey = { dsIter->first.rank, dsIter->first.portSlct }; - - // Check if the rank has already been banned. Note that [] will create - // the an entry if one does not exist, so used find() instead to check - // for existence in the map. - if ( iv_bannedAnalysis.end() != iv_bannedAnalysis.find(banKey) ) - continue; + DimmKey banKey = { dsIter->first.rank.getDimmSlct(), + dsIter->first.portSlct }; + if ( iv_bannedAnalysis[banKey] ) continue; // Get the CEs per dimm select threshold. uint32_t junk0, junk1, dsTh; @@ -440,8 +420,9 @@ bool MemIplCeStats::calloutCePerDs() 0, PRDFSIG_MnfgIplDsCTE, 0); addMruAndCommitErrl( memMru, l_errl); - // Ban the half dimm select. - iv_bannedAnalysis[banKey] = true; + + iv_bannedAnalysis[banKey] = true; // ban this DIMM + o_callOutsMade = true; // Only one symbol needs to be called out, so exit on first diff --git a/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.H b/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.H index 846df16692d..09c632b49fc 100755 --- a/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.H +++ b/src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.H @@ -65,18 +65,17 @@ class MemIplCeStats ~MemIplCeStats() {} /** - * @brief Bans analysis of the given rank. - * @param i_rank The rank to ban. + * @brief Bans analysis of the given DIMM select. + * @param i_dimmSlct The DIMM select. */ - void banAnalysis( const MemRank & i_rank ); + void banAnalysis( uint8_t i_dimmSlct ); /** - * @brief Bans analysis of the given half rank (Only needed for centaur). - * @param i_rank The rank. - * @param i_portSlct The port select. - * @return Non-SUCCESS if the parameters are invalid, SUCCESS otherwise. + * @brief Bans analysis of the given DIMM select and port select. + * @param i_dimmSlct The DIMM select. + * @param i_portSlct The port select. */ - int32_t banAnalysis( const MemRank & i_rank, uint8_t i_portSlct ); + void banAnalysis( uint8_t i_dimmSlct, uint8_t i_portSlct ); /** * @brief Will collect all the maintenance statistics and store them for @@ -136,6 +135,25 @@ class MemIplCeStats } }; + /** @brief The key to identify a DIMM. This key will be used to ban analysis + * on a DIMM after a DIMM has been called out. */ + struct DimmKey + { + uint8_t dimmSlct; ///< The DIMM select + uint8_t portSlct; ///< The port select + + /** @brief Overrides the '==' operator. */ + bool operator==( const DimmKey & i ) const + { return ( (dimmSlct == i.dimmSlct) && (portSlct == i.portSlct) ); } + + /** @brief Overrides the '<' operator. */ + bool operator<( const DimmKey & i ) const + { + return ( (dimmSlct < i.dimmSlct) || + ((dimmSlct == i.dimmSlct) && (portSlct < i.portSlct)) ); + } + }; + /** @brief The key type for each entry in iv_dramMap. */ struct DramKey { @@ -166,8 +184,8 @@ class MemIplCeStats typedef std::map CePerHalfDsMap; // data type to collect all symbol statistics for a rank. typedef std::map CePerHalfRankMap; - // data type to store banned half ranks on which analysis is not required. - typedef std::map BannedAnalysisMap; + // data type to store banned DIMMs on which analysis is not required. + typedef std::map BannedAnalysisMap; // data type to collect all symbol statistics for a dram. typedef std::map CePerDramMap;