From ecf2201cee8cdd3e6eca7d56897fbdf108e59bf5 Mon Sep 17 00:00:00 2001 From: Bill Hoffa Date: Mon, 1 Apr 2019 15:32:52 -0500 Subject: [PATCH] Modify IPMI Timeout Value -- Currently the Timeout value for an IPMI message is assigned when the message is placed in the queue. The timeout value is the same whether we have 0 or 100 messages in the queue which leads to the occasional IPMI timeout when the BMC is sent a lot of messages in a short period of time. -- This fix is to implement the timeout as a per message timeout. I.E. if the message being put on the queue is the 3rd message on the queue it would get a timeout of 3x the timeout value. Change-Id: Ieb328d96144f2b1fe9dc39f57191e86cf4821c2c CQ: SW461931 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75538 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Reviewed-by: Ilya Smirnov Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Christian R. Geddes Reviewed-by: Daniel M. Crowell --- src/usr/ipmibase/ipmirp.C | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/usr/ipmibase/ipmirp.C b/src/usr/ipmibase/ipmirp.C index 2def821bbe6..0bb785949c6 100644 --- a/src/usr/ipmibase/ipmirp.C +++ b/src/usr/ipmibase/ipmirp.C @@ -935,8 +935,12 @@ void IpmiRP::queueForResponse(IPMI::Message& i_msg) mutex_lock(&iv_mutex); // BMC request-to-response times are always seconds, 1 - 30. - // And I don't think we care about roll over here. - i_msg.iv_timeout.tv_sec += iv_bmc_timeout; + // And I don't think we care about roll over here. Enforce the + // timeout as a timeout per-message. Meaning if there are 2 + // messages on the timeout queue, make the timeout of this message + // iv_bmc_timeout + iv_bmc_timeout*2 + i_msg.iv_timeout.tv_sec += + (iv_bmc_timeout + (iv_bmc_timeout*iv_timeoutq.size()) ); // Put this message on the response queue so we can find it later // for a response and on the timeout queue so if it times out @@ -944,9 +948,7 @@ void IpmiRP::queueForResponse(IPMI::Message& i_msg) // timeout - mostly. Every message sent before the BMC tells us // the timeout (at least one message) will have the shortest possible // timeout. The BMC might lengthen the timeout, but can not shorten - // it. All messages after that will have the same timeout. So the - // timeout queue is "sorted." - + // it. iv_respondq[i_msg.iv_seq] = i_msg.iv_msg; iv_timeoutq.push_back(i_msg.iv_msg);