From 0aff9f48c7ea871d49c6966c1fa6a71ba4849558 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Wed, 23 May 2018 12:35:08 -0700 Subject: ipmiwatchdog: Limit the number of resets We send resets after the completion of every istep and in the middle of some of our known long isteps. In some instances during boot, during fast isteps or custom routines, we can send 10 or more resets within the same second. This generates a lot of IPMI traffic and causes the BMC to spend more time processing resets than is needed. Since our timeout is relatively long (120s right now), it should be no issue to limit the number of resets to one reset every 1-2 seconds I've tested this on a zaius machine and it reduced load on the BMC and made clean boots a little faster. Resolves #140 Signed-off-by: William A. Kennington III Change-Id: I60d26af082e1ddb29624fc22a0513b47526978d5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59291 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: William G. Hoffa --- src/usr/ipmi/ipmiwatchdog.C | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/usr') diff --git a/src/usr/ipmi/ipmiwatchdog.C b/src/usr/ipmi/ipmiwatchdog.C index 3efdbfbb7..2f9f28f74 100644 --- a/src/usr/ipmi/ipmiwatchdog.C +++ b/src/usr/ipmi/ipmiwatchdog.C @@ -6,6 +6,7 @@ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2014,2018 */ +/* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -39,6 +40,7 @@ #include #include #include +#include /******************************************************************************/ // Globals/Constants @@ -104,6 +106,18 @@ errlHndl_t resetWatchDogTimer() { errlHndl_t err_ipmi = NULL; + // Limit the amount of sent watchdog resets to once per second to make + // sure that we don't overload the BMC with resets during quickly + // completing ISTEPs. For simplicity we only compare the tv_sec so + // the grace period may be almost 2 seconds. + static uint64_t last_reset_sec; + timespec_t now; + clock_gettime(CLOCK_MONOTONIC, &now); + if (last_reset_sec + 1 >= now.tv_sec) + { + return NULL; + } + last_reset_sec = now.tv_sec; // reset command does not take any request data size_t len = 0; -- cgit v1.2.1