summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi
diff options
context:
space:
mode:
authorBrian Silver <bsilver@us.ibm.com>2014-11-12 10:46:54 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-11-13 08:54:13 -0600
commit4533d8c10733c1bbef73ff3d743af9920a769160 (patch)
treed0bf43907022818891deae228572463e5a5798ba /src/usr/ipmi
parent5c9e8309715c863c3d24263fc38efa53462f59b0 (diff)
downloadtalos-hostboot-4533d8c10733c1bbef73ff3d743af9920a769160.tar.gz
talos-hostboot-4533d8c10733c1bbef73ff3d743af9920a769160.zip
Handle outstanding request limit from BMC
Change-Id: I6d798e81a43cf42a60d17c6a7fab15b4909ffcc7 Depends-on: Id801368fb81f0421c7b11e96898142548417db5c RTC: 117044 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14449 Tested-by: Jenkins Server Reviewed-by: ANIRUDH BAGEPALLI <abagepa@us.ibm.com> Reviewed-by: WILLIAM G. HOFFA <wghoffa@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi')
-rw-r--r--src/usr/ipmi/ipmirp.C48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/usr/ipmi/ipmirp.C b/src/usr/ipmi/ipmirp.C
index 30a0a6784..12b5015a2 100644
--- a/src/usr/ipmi/ipmirp.C
+++ b/src/usr/ipmi/ipmirp.C
@@ -368,27 +368,39 @@ void IpmiRP::execute(void)
///
void IpmiRP::idle(void)
{
- // 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())
+ // 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();)
{
- 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);
}
- i = iv_sendq.erase(i);
}
return;
}
OpenPOWER on IntegriCloud