summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2017-02-20 13:47:05 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2017-02-27 10:41:17 -0500
commitf47866a84121fc8ab6f3420138d9bb5be785559b (patch)
tree812146e185bffb7cddbee6aa866b8946cd56ba78 /src/usr
parent77bab0e1848c3f33ed17dd5fa4b591e45e0ff5cd (diff)
downloadtalos-hostboot-f47866a84121fc8ab6f3420138d9bb5be785559b.tar.gz
talos-hostboot-f47866a84121fc8ab6f3420138d9bb5be785559b.zip
PRD: wrap MNFG thresholds into MemCeTable<T>::addEntry()
Change-Id: Ie9c351578f94d857cc37ad3ef36659751b25f27b RTC: 165382 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36756 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37018 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.C75
-rw-r--r--src/usr/diag/prdf/common/plat/mem/prdfMemCeTable.H16
2 files changed, 42 insertions, 49 deletions
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 <iipServiceDataCollector.h>
#include <UtilHash.H>
+// Platform includes
+#include <prdfMemThresholds.H>
+
using namespace TARGETING;
namespace PRDF
@@ -98,6 +101,42 @@ uint32_t MemCeTable<T>::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<T>( 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() )
{
@@ -143,42 +182,6 @@ void MemCeTable<T>::deactivateRank( const MemRank & i_rank )
//------------------------------------------------------------------------------
template <TARGETING::TYPE T>
-void MemCeTable<T>::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 <TARGETING::TYPE T>
void MemCeTable<T>::addCapData( CaptureData & io_cd )
{
static const size_t sz_word = sizeof(CPU_WORD);
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
@@ -112,19 +115,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.
*/
OpenPOWER on IntegriCloud