diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2013-04-25 14:59:02 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-05-06 16:48:19 -0500 |
commit | c116c22646a96197c7e2b2ed948c6221a55c3427 (patch) | |
tree | 11d7eb552486dd1dd0a0524d19a177e7a5619944 /src/usr | |
parent | 3854f61413963ec73fa420ced2740f6e0d80978e (diff) | |
download | talos-hostboot-c116c22646a96197c7e2b2ed948c6221a55c3427.tar.gz talos-hostboot-c116c22646a96197c7e2b2ed948c6221a55c3427.zip |
Send response to FSP mailbox for unclaimed or invalid messages
RTC: 47595
Change-Id: If8947b78fed4316209702fa72080ba47137d3463
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4307
Tested-by: Jenkins Server
Reviewed-by: ADAM R. MUHLE <armuhle@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/mbox/mailboxsp.C | 152 | ||||
-rw-r--r-- | src/usr/mbox/mailboxsp.H | 52 |
2 files changed, 116 insertions, 88 deletions
diff --git a/src/usr/mbox/mailboxsp.C b/src/usr/mbox/mailboxsp.C index 340d6e17a..2419e67ee 100644 --- a/src/usr/mbox/mailboxsp.C +++ b/src/usr/mbox/mailboxsp.C @@ -763,23 +763,32 @@ void MailboxSp::recv_msg(mbox_msg_t & i_mbox_msg) msg_free(msg); } } - // Else unregisteredd msg_queue_id + // Else unregistered msg_queue_id // For NOW, ignore FSP mailbox stuff bounced back by the echo server else if(i_mbox_msg.msg_queue_id != FSP_MAILBOX_MSGQ) { - // Queue message to wait until queue is registered. - // copy in non-dma instance of payload msg + // copy in non-dma instance of payload msg back to mbox msg i_mbox_msg.msg_payload = *msg; - iv_pendingq.push_back(i_mbox_msg); - - TRACFCOMP(g_trac_mbox, - INFO_MRK - "MailboxSp::recv_msg. Unregistered msg queue id 0x%x" - " message queued.", - i_mbox_msg.msg_queue_id); - + // Is this msg_queue_id valid ? + if(i_mbox_msg.msg_queue_id < HB_LAST_VALID_MSGQ && + i_mbox_msg.msg_queue_id > HB_MAILBOX_MSGQ) + { + // Queue message to wait until queue is registered. + iv_pendingq.push_back(i_mbox_msg); + TRACFCOMP(g_trac_mbox, + INFO_MRK + "MailboxSp::recv_msg. Unregistered msg queue id 0x%x" + " message queued.", + i_mbox_msg.msg_queue_id); + } + else // un defined HB message queue + { + // Tell the FSP mbox about it and log an error + invalidMsgResponder(i_mbox_msg); + free(msg->extra_data); // toss this if it exists + } msg_free(msg); } else // This is a bounce-back msg from the echo server - Ignore @@ -1041,8 +1050,8 @@ errlHndl_t MailboxSp::msgq_register(queue_id_t i_queue_id, msg_q_t i_msgQ) TRACFCOMP(g_trac_mbox,INFO_MRK"MailboxSp::msgq_register queue id 0x%x", i_queue_id); - // Look for pending messages and send them - // remove_if and remove_copy_if not available + // Look for pending messages and send them. + // Note: remove_if and remove_copy_if not implemented in HB code. size_t size = iv_pendingq.size(); while(size--) { @@ -1171,7 +1180,7 @@ errlHndl_t MailboxSp::handleInterrupt() else if((mbox_msg.msg_queue_id==FSP_MAILBOX_MSGQ)&& (mbox_msg.msg_payload.type == MSG_REQUEST_DMA_BUFFERS)) { - // This is a response from the FSP + // This is a response from the FSP mbox for more DMA buffers handle_hbmbox_resp(mbox_msg); } else @@ -1281,65 +1290,78 @@ errlHndl_t MailboxSp::handleInterrupt() return err; } - -// Handle unclaimed messages in iv_pendingq -void MailboxSp::handleUnclaimed() +// Send a message to the FSP mailbox that a message it sent +// had an invalid or undeliverable message +void MailboxSp::invalidMsgResponder(mbox_msg_t & i_mbox_msg) { - for(send_q_t::iterator mbox_msg = iv_pendingq.begin(); - mbox_msg != iv_pendingq.end(); - ++mbox_msg) - { - mbox_msg_t r_mbox_msg; - r_mbox_msg.msg_queue_id = FSP_MAILBOX_MSGQ; - r_mbox_msg.msg_payload.type = MSG_INVALID_MSG_QUEUE_ID; - r_mbox_msg.msg_id = mbox_msg->msg_id; + mbox_msg_t r_mbox_msg; + r_mbox_msg.msg_queue_id = FSP_MAILBOX_MSGQ; + r_mbox_msg.msg_payload.type = MSG_INVALID_MSG_QUEUE_ID; + r_mbox_msg.msg_id = i_mbox_msg.msg_id; - mbox_msg_t * msg = &(*mbox_msg); - // msg_id and msg_queue_id - r_mbox_msg.msg_payload.data[0] = - *(reinterpret_cast<uint64_t*>(msg)); - // type & flags - r_mbox_msg.msg_payload.data[1] = - *(reinterpret_cast<uint64_t*>(&(msg->msg_payload))); + // data[0] = msg_id and msg_queue_id + r_mbox_msg.msg_payload.data[0] = + *(reinterpret_cast<uint64_t*>(&i_mbox_msg)); + // data[1] = type & flags + r_mbox_msg.msg_payload.data[1] = + *(reinterpret_cast<uint64_t*>(&(i_mbox_msg.msg_payload))); - r_mbox_msg.msg_payload.extra_data = NULL; - r_mbox_msg.msg_payload.__reserved__async = 0; // async + r_mbox_msg.msg_payload.extra_data = NULL; + r_mbox_msg.msg_payload.__reserved__async = 0; // async - send_msg(&r_mbox_msg); + send_msg(&r_mbox_msg); - TRACFCOMP(g_trac_mbox, - ERR_MRK - "MailboxSp::handleUnclaimed> Message never claimed. " - "Queueid 0x%08x", - mbox_msg->msg_queue_id); - - /*@ errorlog tag - * @errortype ERRL_SEV_INFORMATIONAL - * @moduleid MBOX::MOD_MBOXSRC_UNCLAIMED - * @reasoncode MBOX::RC_INVALID_QUEUE - * @userdata1 msg queue - * @userdata2 msg type - * @devdesc Message from FSP. Message not claimed - * by any Hostboot service. - */ - errlHndl_t err = new ERRORLOG::ErrlEntry - ( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - MBOX::MOD_MBOXSRC_UNCLAIMED, - MBOX::RC_INVALID_QUEUE, // reason Code - mbox_msg->msg_queue_id, // message queue id - mbox_msg->msg_payload.type // message type - ); - UserDetailsMboxMsg - ffdc(reinterpret_cast<uint64_t*>(msg), - sizeof(mbox_msg_t), - reinterpret_cast<uint64_t*>(msg->msg_payload.extra_data), - msg->msg_payload.data[1]); + TRACFCOMP(g_trac_mbox, + ERR_MRK + "MailboxSp::invalidMsgResponder> Unclaimed mbox message from" + " FSP. Queueid 0x%08x", + i_mbox_msg.msg_queue_id); - ffdc.addToLog(err); + /*@ errorlog tag + * @errortype ERRL_SEV_INFORMATIONAL + * @moduleid MBOX::MOD_MBOXSRC_UNCLAIMED + * @reasoncode MBOX::RC_INVALID_QUEUE + * @userdata1 msg queue + * @userdata2 msg type + * @devdesc Message from FSP. Message not claimed + * by any Hostboot service. + */ + errlHndl_t err = new ERRORLOG::ErrlEntry + ( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + MBOX::MOD_MBOXSRC_UNCLAIMED, + MBOX::RC_INVALID_QUEUE, // reason Code + i_mbox_msg.msg_queue_id, // message queue id + i_mbox_msg.msg_payload.type // message type + ); + + err->addProcedureCallout(HWAS::EPUB_PRC_SP_CODE, + HWAS::SRCI_PRIORITY_HIGH); + + err->addProcedureCallout(HWAS::EPUB_PRC_HB_CODE, + HWAS::SRCI_PRIORITY_HIGH); + + UserDetailsMboxMsg + ffdc(reinterpret_cast<uint64_t*>(&i_mbox_msg), + sizeof(mbox_msg_t), + reinterpret_cast<uint64_t*> + (i_mbox_msg.msg_payload.extra_data), + i_mbox_msg.msg_payload.data[1]); + + ffdc.addToLog(err); + + errlCommit(err,MBOX_COMP_ID); +} - errlCommit(err,MBOX_COMP_ID); +// Handle unclaimed messages in iv_pendingq +void MailboxSp::handleUnclaimed() +{ + for(send_q_t::iterator mbox_msg = iv_pendingq.begin(); + mbox_msg != iv_pendingq.end(); + ++mbox_msg) + { + invalidMsgResponder(*mbox_msg); } iv_pendingq.clear(); } diff --git a/src/usr/mbox/mailboxsp.H b/src/usr/mbox/mailboxsp.H index 37278593a..dc3337923 100644 --- a/src/usr/mbox/mailboxsp.H +++ b/src/usr/mbox/mailboxsp.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/mbox/mailboxsp.H $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/mbox/mailboxsp.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #if !defined(__MBOXSP__) #define __MBOXSP__ /** @@ -213,6 +212,13 @@ namespace MBOX void handleShutdown(); /** + * Send message to FSP indicating an invalid or undeliverable + * message queue. + * @param[in] i_mbox_msg. The invalid message + */ + void invalidMsgResponder(mbox_msg_t & i_mbox_msg); + + /** * Query Quiesced * @returns [true|false] */ |