Skip to content

Commit

Permalink
PRD: reduced error path on memory threshold functions
Browse files Browse the repository at this point in the history
Change-Id: I12ed4cca3b5b10d7d5505af0a0a23971e29634d0
RTC: 169729
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/36675
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: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37012
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Feb 27, 2017
1 parent cbc8e2e commit 0de8391
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 218 deletions.
10 changes: 2 additions & 8 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_common.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2013,2015 */
/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -643,13 +643,7 @@ int32_t CenMbaTdCtlrCommon::setRtEteThresholds()
break;
}

uint16_t softIntCe = 0;
o_rc = getScrubCeThreshold( iv_mbaChip, iv_rank, softIntCe );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getScrubCeThreshold() failed." );
break;
}
uint32_t softIntCe = getScrubCeThreshold( iv_mbaChip, iv_rank );

// Only care about retry CEs if there are a lot of them. So the
// threshold will be high in the field. However, in MNFG the retry CEs
Expand Down
7 changes: 1 addition & 6 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaTdCtlr_rt.C
Expand Up @@ -2589,12 +2589,7 @@ int32_t CenMbaTdCtlr::getTpsCeThr( uint16_t & o_thr )
}
else
{
o_rc = getScrubCeThreshold( iv_mbaChip, iv_rank, o_thr );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getScrubCeThreshold() failed." );
break;
}
o_thr = getScrubCeThreshold( iv_mbaChip, iv_rank );
}

} while( 0 );
Expand Down
12 changes: 3 additions & 9 deletions src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -517,14 +517,8 @@ int32_t AnalyzeFetchNce( ExtensibleChip * i_membChip,
if ( mfgMode() )
{
// Get the MNFG CE thresholds.
uint16_t dramTh, hrTh, dimmTh;
l_rc = getMnfgMemCeTh( mbaChip, rank, dramTh, hrTh, dimmTh );
if ( SUCCESS != l_rc )
{
PRDF_ERR( PRDF_FUNC "getMnfgMemCeTh() failed: rank=m%ds%d",
rank.getMaster(), rank.getSlave() );
break;
}
uint32_t dramTh, hrTh, dimmTh;
getMnfgMemCeTh( mbaChip, rank, dramTh, hrTh, dimmTh );

// Get counts from CE table.
uint32_t dramCount, hrCount, dimmCount;
Expand Down
104 changes: 24 additions & 80 deletions src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.C
Expand Up @@ -175,45 +175,13 @@ int32_t MemIplCeStats<T>::collectStats( const MemRank & i_stopRank )
//------------------------------------------------------------------------------

template<TYPE T>
int32_t MemIplCeStats<T>::analyzeStats( bool & o_callOutsMade )
bool MemIplCeStats<T>::analyzeStats()
{
#define PRDF_FUNC "MemIplCeStats::analyzeStats "
int32_t o_rc = SUCCESS;

o_callOutsMade = false;
bool tmp1 = calloutCePerDram();
bool tmp2 = calloutCePerRank();
bool tmp3 = calloutCePerDs();

do
{
TargetHandle_t trgt = iv_chip->getTrgt();

o_rc = calloutCePerDram( o_callOutsMade );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC " calloutCePerDram() failed. trgt:0X%08X",
getHuid( trgt ) );
break;
}

o_rc = calloutCePerRank( o_callOutsMade );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "calloutCePerRank() failed. trgt:0X%08X",
getHuid( trgt ) );
break;
}

o_rc = calloutCePerDs( o_callOutsMade );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC " calloutCePerDs() failed. trgt:0X%08X",
getHuid( trgt ) );
break;
}

} while (0);

return o_rc;
#undef PRDF_FUNC
return ( tmp1 || tmp2 || tmp3 );
}

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -281,10 +249,9 @@ int32_t MemIplCeStats<T>::calloutHardCes( const MemRank & i_stopRank )
//------------------------------------------------------------------------------

template<TYPE T>
int32_t MemIplCeStats<T>::calloutCePerDram( bool & o_callOutsMade )
bool MemIplCeStats<T>::calloutCePerDram()
{
#define PRDF_FUNC "[MemIplCeStats::calloutCePerDram] "
int32_t o_rc = SUCCESS;
bool o_callOutsMade = false;

TargetHandle_t trgt = iv_chip->getTrgt();

Expand All @@ -301,16 +268,8 @@ int32_t MemIplCeStats<T>::calloutCePerDram( bool & o_callOutsMade )
continue;

// Get the CEs per DRAM threshold.
uint16_t dramTh = 1, junk0, junk1;

o_rc = getMnfgMemCeTh<T>( iv_chip, dramIter->first.rank, dramTh,
junk0, junk1 );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getMnfgMemCeTh() failed. trgt:0x%08X",
getHuid( trgt ) );
break;
}
uint32_t dramTh = 1, junk0, junk1;
getMnfgMemCeTh<T>( iv_chip, dramIter->first.rank, dramTh, junk0, junk1);

// Now, check if a threshold has been reached. If not, continue to the
// next entry in iv_dsMap.
Expand Down Expand Up @@ -353,17 +312,16 @@ int32_t MemIplCeStats<T>::calloutCePerDram( bool & o_callOutsMade )
}
}
}
return o_rc;
#undef PRDF_FUNC

return o_callOutsMade;
}

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

template<TYPE T>
int32_t MemIplCeStats<T>::calloutCePerRank( bool & o_callOutsMade )
bool MemIplCeStats<T>::calloutCePerRank()
{
#define PRDF_FUNC "[MemIplCeStats::calloutCePerRank] "
int32_t o_rc = SUCCESS;
bool o_callOutsMade = false;

TargetHandle_t trgt = iv_chip->getTrgt();

Expand All @@ -380,15 +338,8 @@ int32_t MemIplCeStats<T>::calloutCePerRank( bool & o_callOutsMade )
continue;

// Get the CEs per rank threshold.
uint16_t junk0, rankTh, junk1;
o_rc = getMnfgMemCeTh<T>( iv_chip, rankIter->first.rank, junk0,
rankTh, junk1 );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getMnfgMemCeTh() failed. trgt:0x%08X",
getHuid( trgt ) );
break;
}
uint32_t junk0, rankTh, junk1;
getMnfgMemCeTh<T>( iv_chip, rankIter->first.rank, junk0, rankTh, junk1);

// Now, check if a threshold has been reached. If not, continue to the
// next entry in iv_rankMap.
Expand Down Expand Up @@ -430,17 +381,17 @@ int32_t MemIplCeStats<T>::calloutCePerRank( bool & o_callOutsMade )
}
}
}
return o_rc;
#undef PRDF_FUNC

return o_callOutsMade;
}

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

template<TYPE T>
int32_t MemIplCeStats<T>::calloutCePerDs( bool & o_callOutsMade )
bool MemIplCeStats<T>::calloutCePerDs()
{
#define PRDF_FUNC "[MemIplCeStats::calloutCePerDs] "
int32_t o_rc = SUCCESS;
bool o_callOutsMade = false;

TargetHandle_t trgt = iv_chip->getTrgt();

for ( typename CePerHalfDsMap::iterator dsIter = iv_dsMap.begin();
Expand All @@ -456,15 +407,8 @@ int32_t MemIplCeStats<T>::calloutCePerDs( bool & o_callOutsMade )
continue;

// Get the CEs per dimm select threshold.
uint16_t junk0, junk1, dsTh;
o_rc = getMnfgMemCeTh<T>( iv_chip, dsIter->first.rank, junk0,
junk1, dsTh );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "getMnfgMemCeTh() failed. trgt:0x%08X",
getHuid( trgt ) );
break;
}
uint32_t junk0, junk1, dsTh;
getMnfgMemCeTh<T>( iv_chip, dsIter->first.rank, junk0, junk1, dsTh );

// Now, check if a threshold has been reached. If not, continue to the
// next entry in iv_dsMap.
Expand Down Expand Up @@ -506,8 +450,8 @@ int32_t MemIplCeStats<T>::calloutCePerDs( bool & o_callOutsMade )
}
}
}
return o_rc;
#undef PRDF_FUNC

return o_callOutsMade;
}

//------------------------------------------------------------------------------
Expand Down
21 changes: 8 additions & 13 deletions src/usr/diag/prdf/plat/mem/prdfMemIplCeStats.H
Expand Up @@ -90,11 +90,9 @@ class MemIplCeStats
/**
* @brief Analyzes the maintenance statistics that were gathered, making
* the appropriate callouts.
* @param o_callOutsDone TRUE if PRD made a hardware callout, FALSE
* otherwise.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
* @return TRUE if PRD made a hardware callout, FALSE otherwise.
*/
int32_t analyzeStats ( bool & o_callOutsDone );
bool analyzeStats();

/** @brief Calls out all symbols with hard CEs.
* @param i_stopRank The rank the maintenance command stopped on.
Expand Down Expand Up @@ -176,23 +174,20 @@ class MemIplCeStats
private: // functions

/** @brief Calls out all symbols on a dram that has exceeded threshold.
* @param o_callOutsMade TRUE if a callout was made, FALSE othewise.
* @return Non-SUCCESS if an internal function fails, SUCCESS othewise.
* @return TRUE if a callout was made, FALSE othewise.
*/
int32_t calloutCePerDram( bool & o_callOutsMade );
bool calloutCePerDram();

/** @brief Calls out all symbols on a rank that has exceeded threshold.
* @param o_callOutsMade TRUE if a callout was made, FALSE othewise.
* @return Non-SUCCESS if an internal function fails, SUCCESS othewise.
* @return TRUE if a callout was made, FALSE othewise.
*/
int32_t calloutCePerRank( bool & o_callOutsMade );
bool calloutCePerRank();

/** @brief Calls out all symbols on a dimm select that has exceeded
* threshold.
* @param o_callOutsMade TRUE if a callout was made, FALSE othewise.
* @return Non-SUCCESS if an internal function fails, SUCCESS othewise.
* @return TRUE if a callout was made, FALSE othewise.
*/
int32_t calloutCePerDs( bool & o_callOutsMade );
bool calloutCePerDs();

/**
* @brief Add MemoryMru callout to error log and commit it.
Expand Down

0 comments on commit 0de8391

Please sign in to comment.