From f47866a84121fc8ab6f3420138d9bb5be785559b Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Mon, 20 Feb 2017 13:47:05 -0600 Subject: PRD: wrap MNFG thresholds into MemCeTable::addEntry() Change-Id: Ie9c351578f94d857cc37ad3ef36659751b25f27b RTC: 165382 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36756 Tested-by: Jenkins Server Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Caleb N. Palmer Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37018 Tested-by: FSP CI Jenkins --- src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C | 75 +++++++++++----------- src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H | 16 +---- 2 files changed, 42 insertions(+), 49 deletions(-) (limited to 'src/usr/diag/prdf/common/plat') diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C index 4dc7668d3..d09721414 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C @@ -31,6 +31,9 @@ #include #include +// Platform includes +#include + using namespace TARGETING; namespace PRDF @@ -98,6 +101,42 @@ uint32_t MemCeTable::addEntry( const MemAddr & i_addr, // removing any entries, if the table is full. This is to catch the corner // case where the oldest entry is on the same rank as the new entry. + // Check MNFG thresholds, if needed. + if ( mfgMode() ) + { + // Get the MNFG CE thresholds. + uint32_t dramTh, rankTh, dimmTh; + getMnfgMemCeTh( iv_chip, thisRank, dramTh, rankTh, dimmTh ); + + // Get MNFG counts from CE table. + uint32_t dramCount = 0, rankCount = 0, dimmCount = 0; + for ( auto & entry : iv_table ) + { + if ( i_symbol.getPortSlct() != entry.portSlct ) continue; + + MemRank itRank = entry.addr.getRank(); + + if ( thisRank.getDimmSlct() == itRank.getDimmSlct() ) + { + dimmCount++; + + if ( thisRank == itRank ) + { + rankCount++; + + if ( i_symbol.getDram() == entry.dram ) + dramCount++; + } + } + } + + // Check thresholds. Note that the thresholds are the number allowed. + // So we have to compare if the counts have exceeded the thresholds. + if ( dramTh < dramCount ) o_rc |= MNFG_TH_DRAM; + if ( rankTh < rankCount ) o_rc |= MNFG_TH_RANK; + if ( dimmTh < dimmCount ) o_rc |= MNFG_TH_DIMM; + } + // If the table is full, remove the oldest inactive entry if ( MAX_ENTRIES < iv_table.size() ) { @@ -142,42 +181,6 @@ void MemCeTable::deactivateRank( const MemRank & i_rank ) //------------------------------------------------------------------------------ -template -void MemCeTable::getMnfgCounts( const MemRank & i_rank, - const MemSymbol & i_symbol, - uint32_t & o_dramCount, - uint32_t & o_rankCount, - uint32_t & o_dimmCount ) -{ - o_dramCount = 0; o_rankCount = 0; o_dimmCount = 0; - - const uint32_t dram = i_symbol.getDram(); - const uint32_t ps = i_symbol.getPortSlct(); - const uint32_t ds = i_rank.getDimmSlct(); - - for ( auto & entry : iv_table ) - { - if ( ps != entry.portSlct ) continue; - - MemRank itRank = entry.addr.getRank(); - - if ( ds == itRank.getDimmSlct() ) - { - o_dimmCount++; - - if ( i_rank == itRank ) - { - o_rankCount++; - - if ( dram == entry.dram ) - o_dramCount++; - } - } - } -} - -//------------------------------------------------------------------------------ - template void MemCeTable::addCapData( CaptureData & io_cd ) { diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H index cc620853d..18a9fa12f 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H @@ -62,6 +62,9 @@ class MemCeTable ENTRY_TH_REACHED = 0x01, ///< The entry threshold has been reached. RANK_TH_REACHED = 0x02, ///< The rank threshold has been reached. TABLE_FULL = 0x04, ///< The table is full of active entries. + MNFG_TH_DRAM = 0x08, ///< MNFG DRAM threshold reached. + MNFG_TH_RANK = 0x10, ///< MNFG rank threshold reached. + MNFG_TH_DIMM = 0x20, ///< MNFG DIMM threshold reached. }; private: // constants, enums @@ -111,19 +114,6 @@ class MemCeTable */ void deactivateRank( const MemRank & i_rank ); - /** - * @brief Iterates the entire table and returns the number of unique entries - * that exist for the target DRAM, half-rank, logical DIMM. - * @param i_rank The failing rank. - * @param i_symbol The failing symbol. - * @param o_dramCount The entry count for the target dram. - * @param o_rankCount The entry count for the target rank per logical DIMM. - * @param o_dimmCount The entry count for the target logical DIMM. - */ - void getMnfgCounts( const MemRank & i_rank, const MemSymbol & i_symbol, - uint32_t & o_dramCount, uint32_t & o_rankCount, - uint32_t & o_dimmCount ); - /** * @brief Gathers all table data to be stored in capture data. * @param io_cd Capture data struct. -- cgit v1.2.1