summaryrefslogtreecommitdiffstats
path: root/app
Commit message (Collapse)AuthorAgeFilesLines
* app/watchdog: Only log internal failures onceWilliam A. Kennington III2018-09-211-10/+35
| | | | | | | | | | | | | | | | | Logging internal failures to the phosphor-logger is a slow process that can take up to 5 seconds. If we do this for each watchdog reset for a relatively fast watchdog we will clog up the channel and fill the ESEL log with errors. We probably don't want that kind of information to build up. Instead, only report errors to the ESEL when the state of the internal watchdog transitions from HEALTHY -> UNHEALTHY. Tested: Works on zaius when booting and terminating the watchdog daemon while it is ticking. Produces the expected single error in the log and only delays the IPMI channel once. Change-Id: I8110ba66c4a85e188666a34cb6d055bdbec30622 Signed-off-by: William A. Kennington III <wak@google.com>
* add .clang-formatPatrick Venture2018-09-076-232/+221
| | | | | Change-Id: I7c2a527b4751a560703a61fcbe9638b150546af5 Signed-off-by: Patrick Venture <venture@google.com>
* app/watchdog_service: More useful error outputWilliam A. Kennington III2018-07-181-13/+45
| | | | | | | | This patch adds error handling around the decoding of requests to the watchdog service, to give more useful context in the case of errors. Change-Id: If668b17e88dc65a938b69d8c2cdd760456170962 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Get only the initialized property during resetWilliam A. Kennington III2018-05-223-3/+46
| | | | | | | | | | Since we switched to resetting the watchdog with a built-in method, we are only using a single property from the watchdog. Instead of fetching all the properties and reading just the initialized one, only request the initialized property from the watchdog. Change-Id: I5e29b5100629e1ce23f352b0b749a434cd1ab793 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Use ResetTimeRemaining for wd_resetWilliam A. Kennington III2018-05-223-6/+32
| | | | | | | | Using this helper method reduces the number of dbus calls made during each watchdog reset. Change-Id: I373db3babe03e05fca33eb4dbbbc7c07f95a39ea Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog_service: Convert runtime errors to internal failuresWilliam A. Kennington III2018-05-221-2/+14
| | | | | | | | We want to better adhere to the openbmc convention of logging our errors and reporting and internal exception upstack. Change-Id: I78a277ed564b1ac269d84c024b75d2b0f534e911 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Handle and report internal failuresWilliam A. Kennington III2018-05-221-0/+26
| | | | | | | | | An upcoming change will introduce InternalFailures instead of using runtime exceptions for error handling in the watchdog service. We need to handle these exceptions appropriately. Change-Id: Icfc02d98821f307a37a4cf59911913c820e88744 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Retry dbus requests if the service was cachedWilliam A. Kennington III2018-05-111-0/+12
| | | | | | | | | | | | Right now if the phosphor-watchdog gets restarted, the first ipmi request querying it will fail and return all the way back up to the ipmi client. In this case, it would be nicer for the client if we retried the request once before reporting a failure. Resolves openbmc/phosphor-host-ipmid#111 Change-Id: I73fce5431911279f9c2e4389d32b671ed60c2305 Signed-off-by: William A. Kennington III <wak@google.com>
* Reducing IPMI logging footprintAditya Saripalli2018-04-181-2/+0
| | | | | | | | | | | | -host-ipmid is very noisy in terms of journal logging. A small step towards cleaning that up. -Also converted printfs to phosphor-logging. Partially Resolves openbmc/openbmc#2507 Change-Id: I749c19c18d1cabf6f0216830c8cb0a08ee43d6de Signed-off-by: Aditya Saripalli <aditya0124@gmail.com> Signed-off-by: Nagaraju Goruganti <ngorugan@in.ibm.com>
* Implement Get Channel Cipher Suites commandTom Joseph2018-04-162-0/+203
| | | | | Change-Id: I8c808ce7e2bbd3ae5e225573138d7e04871f1643 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
* watchdog: Cache service nameWilliam A. Kennington III2018-04-022-8/+10
| | | | | | | | | | | | | | | | | | | | | We have occasionally noticed that the watchdog will be enabled and then immediately trip upon booting of the BMC. This happens if the host is still running when the BMC is coming up. Digging into the issue we notice that the phosphor-mapper can be under very heavy load responding to all of the initial mapping requests from BMC daemons starting. This causes a delay in the phosphor-watchdog service name lookup during an attempt to reset the watchdog countdown. The lookup delay is so long that the watchdog ends up tripping before the reset is actually issued, causing the BMC to reset the host. Since we know that the watchdog will not be armed until the service resolves for the first time, we can reduce the dependence and pressure on the service mapper by caching the service name. Since it is the case that we want to keep issuing resets to the same daemon that was initially configured, we should have no worries about invalidating the cached service name. The name will be invalidated any time we encounter a dbus level error issuing a watchdog commmand. Change-Id: I303a39be997c2e57050b71efc8ef2e2cb27f8cf7 Signed-off-by: William A. Kennington III <wak@google.com>
* SetLan: Move the setChannel access functionRatan Gupta2018-03-201-324/+0
| | | | | | | | | | | | | | | Move the function from app/channel.cpp to the transporthandler.cpp setChannel access is disabled now as the functionality to apply the network changes would be done through timer based approach. In later commit we would create this function as callback when the network timer expires. Change-Id: Ic128a47237b2ecdbc56267227105909f8886a862 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* watchdog: Implements the Watchdog Get CommandWilliam A. Kennington III2018-02-212-0/+116
| | | | | Change-Id: I2ba9fd0eeba4e828cafd1bcf6fe30e2322eaf99e Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Implement watchdog action settingWilliam A. Kennington III2018-02-213-7/+52
| | | | | | | | We now respect the action set during the SetTimeout command. This maps to one of the actions defined by the dbus Watchdog interface Change-Id: I4d13d2539a2d955a4340bf5f915ca6f3b694550a Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Implement initialized using the new dbus interfaceWilliam A. Kennington III2018-02-213-0/+24
| | | | | | | | | This makes it possible for the phosphor-host-ipmi or any other watchdog managing daemon to report to the caller that the watchdog was not configured if the phosphor-watchdog daemon restarts for any reason. Change-Id: Iae3a8554c2f5d1cb89368f3ce14b3d44922599c0 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Rewrite using sdbusplusWilliam A. Kennington III2018-02-213-180/+220
| | | | | Change-Id: I730317954819859d23fdaca7336f19f5c5b0c107 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Reorganize header and function namesWilliam A. Kennington III2018-02-152-106/+107
| | | | | | | | This is a refactoring of names + header cleanup and has no functional change. Change-Id: Ie90fded80b6a26927f56bb342993193530b8b8ef Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Consistently return errors for dbus failuresWilliam A. Kennington III2018-02-061-4/+18
| | | | | | | | | This adds return codes for all of the dbus failures which inform the host that it should retry the IPMI command as dbus related errors should be ephemeral. Change-Id: I090f488535625a996347677a0c8addbdff0996c0 Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Fix enabled value typeWilliam A. Kennington III2018-01-291-1/+1
| | | | | | | | | | | | | | When deserializing a bool with sd_bus_message_read, it expects the storage of the passed in container to be 4 bytes. A bool is not guaranteed to be this large and will cause sd_bus_message_read to scribble on the stack. Change enabled to int to guarantee enough space to deserialize the result. For reference libsystemd is doing: *(int*) p = !!*(uint8_t*) q; Change-Id: Ic299e303fcb70941757c453a7b4f643337220afb Signed-off-by: William A. Kennington III <wak@google.com>
* watchdog: Implement error on reset of disabled watchdogWilliam A. Kennington III2018-01-241-1/+30
| | | | | | | | | This enables the host to recover when the BMC resets or the daemon loses state for some reason. A well formed host will resend the SetTimeout command if it encounters this error code. Change-Id: Ib5fd50ac3ad83ef820f0209354aa8f084a563995 Signed-off-by: William A. Kennington III <wak@google.com>
* LANConf: Minor FixesRatan Gupta2018-01-171-12/+9
| | | | | | | | | | | 1) Get the interface mode of the system if it is not given so that we can set the same interface mode as it was before. 2) Removed the unnecessary condition of getting the VLAN. Resolves openbmc/openbmc#2738 Change-Id: I1658fbf78627e7cc1c7e1e5875964ed30c58d6dc Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* multiple channel configuration supportPatrick Venture2017-12-121-54/+75
| | | | | | | | | | | | | | Previously, the ipmi daemon only supported eth0 and hard-coded it to channel 1. This allows one to map via a configuration. The channel number provided is checked against a configuration to retrieve the ethernet device identifier, e.g. eth0. Tested: Ran on a quanta-q71l and was able to properly set MAC, IP, Netmask, Gateway IP, and then verified the data was set for the eth1 via `ip addr show eth1`. Change-Id: I92f63188297304e9454fd0d6fe32bc6cf84bb181 Signed-off-by: Patrick Venture <venture@google.com>
* Fix the getLan configRatan Gupta2017-11-281-9/+7
| | | | | | | | | | | | | | | We did the filtering during IPAddress parameter to avoid link local address but left it for subnetMask and vlan parameter. With the introduction of zeroconfig IP we have multiIPaddress can exist on the interface. This commit introduces the filtering for subnetmask and vlan parameter also. Resolves openbmc/openbmc#2664 Change-Id: I244bfe8b9d7efbf55fc1b7051489a8a204182906 Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
* watchdog: cleanup style and similar fixesPatrick Venture2017-11-102-25/+40
| | | | | | | Some style cleanup. Change-Id: I4f8ce595294797cc015a55cc6c9477aee7b6938a Signed-off-by: Patrick Venture <venture@google.com>
* apphandler: channel: split out commandsPatrick Venture2017-10-262-0/+487
| | | | | | | | | | | | | | I split out the channel commands into their own subordinate file from the apphandler.cpp. There are three commands in apphandler for the channel information. There are other commands in the transporthandler that correlate. Moving this is step one in a larger task to enable multiple channels. Change-Id: I2e434a1da942325fc420079415edb39622f4e346 Signed-off-by: Patrick Venture <venture@google.com>
* watchdog: split out commandsPatrick Venture2017-10-252-0/+206
I split out the watchdog command handlers into their own subordinate file from the apphandler. This reduces the size of the contents of the apphandler file, and logically cuts out code into its own files. Change-Id: Idc70acad6c93c12456cc7092786715643c9c1ffb Signed-off-by: Patrick Venture <venture@google.com>
OpenPOWER on IntegriCloud