Skip to content

Commit

Permalink
PRD: Bugs related to banning analysis in MNFG IPL CE Handling
Browse files Browse the repository at this point in the history
Change-Id: I5a6aba740c775a71fef436f739047761d82fc62a
CQ: SW394179
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42398
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/42631
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Jun 30, 2017
1 parent 2ea31dc commit 7351357
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 84 deletions.
129 changes: 55 additions & 74 deletions src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C
Expand Up @@ -57,53 +57,51 @@ using namespace PARSERUTILS;
//------------------------------------------------------------------------------

template<>
void MemIplCeStats<TYPE_MBA>::banAnalysis( const MemRank & i_rank )
void MemIplCeStats<TYPE_MBA>::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<TYPE_MCA>::banAnalysis( const MemRank & i_rank )
void MemIplCeStats<TYPE_MCA>::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<TYPE T>
int32_t MemIplCeStats<T>::banAnalysis( const MemRank & i_rank,
uint8_t i_portSlct )
{
int32_t o_rc = SUCCESS;

do
template<>
void MemIplCeStats<TYPE_MBA>::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<TYPE_MCA>::banAnalysis( uint8_t i_dimmSlct )
{
// Only one DIMM per DIMM select on MCA.
banAnalysis( i_dimmSlct, 0 );
}


//------------------------------------------------------------------------------

template<TYPE T>
Expand Down Expand Up @@ -134,13 +132,8 @@ int32_t MemIplCeStats<T>::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 };
Expand Down Expand Up @@ -209,12 +202,8 @@ int32_t MemIplCeStats<T>::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(),
Expand All @@ -238,11 +227,13 @@ int32_t MemIplCeStats<T>::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
}

Expand All @@ -259,13 +250,9 @@ bool MemIplCeStats<T>::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;
Expand Down Expand Up @@ -302,8 +289,8 @@ bool MemIplCeStats<T>::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
Expand All @@ -329,13 +316,9 @@ bool MemIplCeStats<T>::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;
Expand Down Expand Up @@ -371,8 +354,9 @@ bool MemIplCeStats<T>::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
Expand All @@ -398,13 +382,9 @@ bool MemIplCeStats<T>::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;
Expand Down Expand Up @@ -440,8 +420,9 @@ bool MemIplCeStats<T>::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
Expand Down
38 changes: 28 additions & 10 deletions src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.H
Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -166,8 +184,8 @@ class MemIplCeStats
typedef std::map<HalfRankKey, uint32_t> CePerHalfDsMap;
// data type to collect all symbol statistics for a rank.
typedef std::map<HalfRankKey, uint32_t> CePerHalfRankMap;
// data type to store banned half ranks on which analysis is not required.
typedef std::map<HalfRankKey, bool> BannedAnalysisMap;
// data type to store banned DIMMs on which analysis is not required.
typedef std::map<DimmKey, bool> BannedAnalysisMap;
// data type to collect all symbol statistics for a dram.
typedef std::map<DramKey, uint32_t> CePerDramMap;

Expand Down

0 comments on commit 7351357

Please sign in to comment.