diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/ipmi/ipmi_reasoncodes.H | 21 | ||||
-rw-r--r-- | src/usr/ipmi/ipmibt.C | 23 | ||||
-rw-r--r-- | src/usr/ipmi/ipmirp.C | 84 |
3 files changed, 45 insertions, 83 deletions
diff --git a/src/include/usr/ipmi/ipmi_reasoncodes.H b/src/include/usr/ipmi/ipmi_reasoncodes.H index 351f28909..01c5aaf7d 100644 --- a/src/include/usr/ipmi/ipmi_reasoncodes.H +++ b/src/include/usr/ipmi/ipmi_reasoncodes.H @@ -43,18 +43,15 @@ namespace IPMI RC_INVALID_QRESPONSE = IPMI_COMP_ID | 0x01, RC_INVALID_SENDRECV = IPMI_COMP_ID | 0x02, RC_INVALID_SEND = IPMI_COMP_ID | 0x03, - RC_WAITER_NOT_FOUND = IPMI_COMP_ID | 0x04, - RC_ASYNC_BAD_CC = IPMI_COMP_ID | 0x05, - RC_INVALID_SENSOR_CMD = IPMI_COMP_ID | 0x06, - RC_SENSOR_NOT_SETTABLE = IPMI_COMP_ID | 0x07, - RC_EVENT_DATA_NOT_SETTABLE = IPMI_COMP_ID | 0x08, - RC_SENSOR_NOT_PRESENT = IPMI_COMP_ID | 0x09, - RC_SET_SENSOR_FAILURE = IPMI_COMP_ID | 0x0a, - RC_READ_EVENT_FAILURE = IPMI_COMP_ID | 0x0b, - RC_DCMI_CMD_FAILED = IPMI_COMP_ID | 0x0c, - RC_SENSOR_READING_NOT_AVAIL = IPMI_COMP_ID | 0x0d, - RC_GET_SENSOR_TYPE_CMD_FAILED = IPMI_COMP_ID | 0x0e, - + RC_INVALID_SENSOR_CMD = IPMI_COMP_ID | 0x04, + RC_SENSOR_NOT_SETTABLE = IPMI_COMP_ID | 0x05, + RC_EVENT_DATA_NOT_SETTABLE = IPMI_COMP_ID | 0x06, + RC_SENSOR_NOT_PRESENT = IPMI_COMP_ID | 0x07, + RC_SET_SENSOR_FAILURE = IPMI_COMP_ID | 0x08, + RC_READ_EVENT_FAILURE = IPMI_COMP_ID | 0x09, + RC_DCMI_CMD_FAILED = IPMI_COMP_ID | 0x0a, + RC_SENSOR_READING_NOT_AVAIL = IPMI_COMP_ID | 0x0b, + RC_GET_SENSOR_TYPE_CMD_FAILED = IPMI_COMP_ID | 0x0c, }; }; diff --git a/src/usr/ipmi/ipmibt.C b/src/usr/ipmi/ipmibt.C index f5cba4d1c..9986c15f7 100644 --- a/src/usr/ipmi/ipmibt.C +++ b/src/usr/ipmi/ipmibt.C @@ -290,31 +290,12 @@ namespace IPMI { // If our completion code isn't CC_OK, lets log that fact. There's // not much we can do, but at least this might give a hint that - // something is awry. + // something is awry. Note the caller doesn't care, or this would + // be synchronous. if (iv_cc != IPMI::CC_OK) { IPMI_TRAC(ERR_MRK "async message (%x:%x seq %d) completion code %x", iv_netfun, iv_cmd, iv_seq, iv_cc); - - /* @errorlog tag - * @errortype ERRL_SEV_INFORMATIONAL - * @moduleid IPMI::MOD_IPMISRV_REPLY - * @reasoncode IPMI::RC_ASYNC_BAD_CC - * @userdata1 command of message - * @userdata2 completion code - * @devdesc an async message completion code was not CC_OK - * @custdesc Unexpected IPMI completion code from the BMC - */ - errlHndl_t err = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_INFORMATIONAL, - IPMI::MOD_IPMISRV_REPLY, - IPMI::RC_ASYNC_BAD_CC, - iv_cmd, - iv_cc, - true); - - err->collectTrace(IPMI_COMP_NAME); - errlCommit(err, IPMI_COMP_ID); } // Yes, this is OK - there is no further reference to this object. diff --git a/src/usr/ipmi/ipmirp.C b/src/usr/ipmi/ipmirp.C index 50f8ef2b5..0b6eb68e3 100644 --- a/src/usr/ipmi/ipmirp.C +++ b/src/usr/ipmi/ipmirp.C @@ -627,40 +627,43 @@ void IpmiRP::execute(void) /// void IpmiRP::idle(void) { - // Check to see if we have many outstanding requests. If so, don't send - // any more messages. Note the eagain mechanism still works even though - // we're not sending messages as eventually we'll get enough responses - // to shorten the response queue and since the message loop calls us - // to transmit even for the reception of a message, the driver will - // eventually reset egagains. If responses timeout, we end up here as - // the response queue processing sends an idle message when anything is - // removed. - if (iv_outstanding_req > iv_respondq.size()) + // If the interface is idle, we can write anything we need to write. + for (IPMI::send_q_t::iterator i = iv_sendq.begin(); + i != iv_sendq.end();) { - // If the interface is idle, we can write anything we need to write. - for (IPMI::send_q_t::iterator i = iv_sendq.begin(); - i != iv_sendq.end();) + // Check to see if we have many outstanding requests. If so, don't send + // any more messages. Note the eagain mechanism still works even though + // we're not sending messages as eventually we'll get enough responses + // to shorten the response queue and since the message loop calls us + // to transmit even for the reception of a message, the driver will + // eventually reset egagains. If responses timeout, we end up here as + // the response queue processing sends an idle message when anything is + // removed. + if (iv_outstanding_req <= iv_respondq.size()) { - // If we have a problem transmitting a message, then we just stop - // here and wait for the next time the interface transitions to idle - // Note that there are two failure cases: the first is that there is - // a problem transmitting. In this case we told the other end of the - // message queue, and so the life of this message is over. The other - // case is that the interface turned out to be busy in which case - // this message can sit on the queue and it'll be next. - - IPMI::Message* msg = static_cast<IPMI::Message*>((*i)->extra_data); - - // If there was an i/o error, we do nothing - leave this message on - // the queue. Don't touch msg after xmit returns. If the message was - // sent, and it was async, msg has been destroyed. - if (msg->xmit()) - { - break; - } - i = iv_sendq.erase(i); + break; + } + + // If we have a problem transmitting a message, then we just stop + // here and wait for the next time the interface transitions to idle + // Note that there are two failure cases: the first is that there is + // a problem transmitting. In this case we told the other end of the + // message queue, and so the life of this message is over. The other + // case is that the interface turned out to be busy in which case + // this message can sit on the queue and it'll be next. + + IPMI::Message* msg = static_cast<IPMI::Message*>((*i)->extra_data); + + // If there was an i/o error, we do nothing - leave this message on + // the queue. Don't touch msg after xmit returns. If the message was + // sent, and it was async, msg has been destroyed. + if (msg->xmit()) + { + break; } + i = iv_sendq.erase(i); } + return; } @@ -720,7 +723,7 @@ void IpmiRP::response(IPMI::Message* i_msg) // Look for a message with this seq number waiting for a // response. If there isn't a message looking for this response, - // that's an error. Async messages should also be on this queue, + // log and leave. Async messages should also be on this queue, // even though the caller has long gone on to other things. IPMI::respond_q_t::iterator itr = iv_respondq.find(i_msg->iv_key); if (itr == iv_respondq.end()) @@ -729,25 +732,6 @@ void IpmiRP::response(IPMI::Message* i_msg) "%d %x:%x", i_msg->iv_key, i_msg->iv_netfun, i_msg->iv_cmd); - /* @errorlog tag - * @errortype ERRL_SEV_UNRECOVERABLE - * @moduleid IPMI::MOD_IPMISRV_REPLY - * @reasoncode IPMI::RC_WAITER_NOT_FOUND - * @userdata1 the network function/lun - * @userdata2 the command which was in error - * @devdesc there was no matching message on - * the response queue - * @custdesc Unexpected IPMI message from the BMC - */ - errlHndl_t err = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_UNRECOVERABLE, - IPMI::MOD_IPMISRV_REPLY, - IPMI::RC_WAITER_NOT_FOUND, - i_msg->iv_netfun, i_msg->iv_cmd, true); - - err->collectTrace(IPMI_COMP_NAME); - errlCommit(err, IPMI_COMP_ID); - delete[] i_msg->iv_data; break; } |