From ec6c516c3a2228fe43e61c825ac215cf3e1a70e4 Mon Sep 17 00:00:00 2001 From: Brian Horton Date: Tue, 4 Aug 2015 15:59:48 -0500 Subject: fixes to allow error logs to be pulled from PNOR to be resent . correct logic in errorlog unflatten . remove unconditional 'ack' in errlmanager Change-Id: I170d6586062b6e4684a55782df83a1b19ed7d937 CQ: SW312094 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19652 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: Daniel M. Crowell Reviewed-by: STEPHEN M. CPREK Reviewed-by: A. Patrick Williams III --- src/include/usr/errl/errlmanager.H | 9 +++ src/usr/errl/errlentry.C | 17 +++++- src/usr/errl/errlmanager.C | 113 +++++++++++++++++++++---------------- 3 files changed, 88 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H index 21e9a12cc..89b545263 100644 --- a/src/include/usr/errl/errlmanager.H +++ b/src/include/usr/errl/errlmanager.H @@ -547,6 +547,15 @@ private: */ bool _updateErrlListIter(ErrlListItr_t & io_it); + /** + * @brief helper function to set the 'iv_skipShowingLog' flag of an error + * log. this needs to be called when we first get an errl object before we + * try to handle it. ie, when it's going to be committed, AND when it's + * been unflattened out of PNOR + * + * @param[in/out] io_err - errorlog that's being checked and updatd + */ + void setErrlSkipFlag(errlHndl_t io_err); }; } // End namespace diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index a1f4c1193..0344c2b7a 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -1519,12 +1519,12 @@ uint64_t ErrlEntry::unflatten( const void * i_buffer, uint64_t i_len ) uint64_t bytes_used = 0; uint64_t rc = 0; - TRACDCOMP(g_trac_errl, INFO_MRK"Unflatten private section..."); + TRACDCOMP(g_trac_errl, INFO_MRK"Unflatten Private section..."); bytes_used = iv_Private.unflatten(l_buf); consumed += bytes_used; l_buf += bytes_used; - TRACDCOMP(g_trac_errl, INFO_MRK"Unflatten User header section..."); + TRACDCOMP(g_trac_errl, INFO_MRK"Unflatten User Header section..."); bytes_used = iv_User.unflatten(l_buf); consumed += bytes_used; l_buf += bytes_used; @@ -1538,7 +1538,11 @@ uint64_t ErrlEntry::unflatten( const void * i_buffer, uint64_t i_len ) iv_btAddrs.clear(); removeBackTrace(); - while(consumed < i_len) + // loop thru the User Data sections (after already doing 3: Private, User + // Header, SRC sections) while there's still data to process + for (int32_t l_sc = 3; + (l_sc < iv_Private.iv_sctns) && (consumed < i_len); + l_sc++) { TRACDCOMP(g_trac_errl, INFO_MRK"Unflatten User data section..."); const ERRORLOG::pelSectionHeader_t * p = @@ -1563,6 +1567,13 @@ uint64_t ErrlEntry::unflatten( const void * i_buffer, uint64_t i_len ) iv_SectionVector.push_back(ud); } + // if we didn't get as many User Detail sections as the Private header says + // we should have, then we have an error + if ((iv_SectionVector.size() + 3) != iv_Private.iv_sctns) + { + rc = -1; + } + return rc; } diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C index ede3c398f..a3a8c5f12 100644 --- a/src/usr/errl/errlmanager.C +++ b/src/usr/errl/errlmanager.C @@ -103,6 +103,7 @@ bool compareEidToPlid(const uint32_t i_plid, return (i_pair.first->eid() == i_plid); } + class AtLoadFunctions { public: @@ -436,53 +437,7 @@ void ErrlManager::errlogMsgHndlr () errlHndl_t l_err = (errlHndl_t) theMsg->extra_data; // Decide if we need to skip the error log - // Note: iv_skipShowingLog is set to True by default - //0 = Prevent INFORMATIONAL/RECOVERED error logs from being processed. - //1 = Send only INFORMATIONAL error logs. - //2 = Send only RECOVERED error logs. - //3 = Allow all hidden error logs to be processed. - - //Check severity - switch (l_err->sev()) - { - case ERRORLOG::ERRL_SEV_INFORMATIONAL: - - // check if we are allowing info logs through. - if((iv_hiddenErrLogsEnable == - TARGETING:: - HIDDEN_ERRLOGS_ENABLE_ALLOW_INFORMATIONAL)|| - (iv_hiddenErrLogsEnable == - TARGETING:: - HIDDEN_ERRLOGS_ENABLE_ALLOW_ALL_LOGS)) - { - l_err->setSkipShowingLog(false); - } - break; - - case ERRORLOG::ERRL_SEV_RECOVERED: - - // check if we are allowing recovered logs through. - if(((iv_hiddenErrLogsEnable == - TARGETING:: - HIDDEN_ERRLOGS_ENABLE_ALLOW_RECOVERED) || - (iv_hiddenErrLogsEnable == - TARGETING:: - HIDDEN_ERRLOGS_ENABLE_ALLOW_ALL_LOGS)) && - !iv_isSpBaseServices) - { - //Recovered error logs that are encountered - //before targeting and initservice are loaded, - //will still be queued for sending to PNOR/IPMI - l_err->setSkipShowingLog(false); - } - break; - - default: - - // For any error log that is not INFORMATIONAL - // or RECOVERED, we want to show the log - l_err->setSkipShowingLog(false); - } + setErrlSkipFlag(l_err); // Ask the ErrlEntry to assign commit component, commit time l_err->commit( (compId_t) theMsg->data[0] ); @@ -1094,6 +1049,13 @@ void ErrlManager::setupPnorInfo() } else { + // Decide if we need to skip the error log + setErrlSkipFlag(err); + if(err->getSkipShowingLog()) + { + // skip it, go to the next one + continue; + } if (iv_isIpmiEnabled) { // convert to SEL/eSEL and send to BMC over IPMI @@ -1107,14 +1069,18 @@ void ErrlManager::setupPnorInfo() i, l_id); // Pair with IPMI flag to add to the errlList // so that it'll get sent down when IPMI is up +#ifdef CONFIG_CONSOLE_OUTPUT_ERRORDISPLAY + ErrlFlagPair_t l_pair(err, IPMI_FLAG | ERRLDISP_FLAG); +#else ErrlFlagPair_t l_pair(err, IPMI_FLAG); +#endif iv_errlList.push_back(l_pair); } } #else // for FSP system, this shouldn't ever happen. -#endif setACKInFlattened(i); +#endif } // not ACKed } // not empty } // for @@ -1375,4 +1341,55 @@ bool ErrlManager::_updateErrlListIter(ErrlListItr_t & io_it) return l_removed; } +void ErrlManager::setErrlSkipFlag(errlHndl_t io_err) +{ + // Note: iv_skipShowingLog is set to True by default + //0 = Prevent INFORMATIONAL/RECOVERED error logs from being processed. + //1 = Send only INFORMATIONAL error logs. + //2 = Send only RECOVERED error logs. + //3 = Allow all hidden error logs to be processed. + + //Check severity + switch (io_err->sev()) + { + case ERRORLOG::ERRL_SEV_INFORMATIONAL: + + // check if we are allowing info logs through. + if((iv_hiddenErrLogsEnable == + TARGETING:: + HIDDEN_ERRLOGS_ENABLE_ALLOW_INFORMATIONAL)|| + (iv_hiddenErrLogsEnable == + TARGETING:: + HIDDEN_ERRLOGS_ENABLE_ALLOW_ALL_LOGS)) + { + io_err->setSkipShowingLog(false); + } + break; + + case ERRORLOG::ERRL_SEV_RECOVERED: + + // check if we are allowing recovered logs through. + if(((iv_hiddenErrLogsEnable == + TARGETING:: + HIDDEN_ERRLOGS_ENABLE_ALLOW_RECOVERED) || + (iv_hiddenErrLogsEnable == + TARGETING:: + HIDDEN_ERRLOGS_ENABLE_ALLOW_ALL_LOGS)) && + !iv_isSpBaseServices) + { + //Recovered error logs that are encountered + //before targeting and initservice are loaded, + //will still be queued for sending to PNOR/IPMI + io_err->setSkipShowingLog(false); + } + break; + + default: + + // For any error log that is not INFORMATIONAL + // or RECOVERED, we want to show the log + io_err->setSkipShowingLog(false); + } +} // setErrlSkipFlag + } // End namespace -- cgit v1.2.1