diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-01-11 23:27:14 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-01-12 01:15:33 +0300 |
commit | cd8549453858d3865e1798566fb2e7f1d2f8ec5e (patch) | |
tree | 07b0c089be906f69a4044e16679c2037c7903943 /meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb | |
parent | 18576aaaa49bf249aef0b72dd12fc452fccb6aed (diff) | |
download | openbmc-cd8549453858d3865e1798566fb2e7f1d2f8ec5e.tar.xz |
Update to internal 1.00-40
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb')
6 files changed, 379 insertions, 3 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0014-add-sufficient-delay-to-create-fw-update-object.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0014-add-sufficient-delay-to-create-fw-update-object.patch index e6fd85f85..611d585bc 100644 --- a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0014-add-sufficient-delay-to-create-fw-update-object.patch +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0014-add-sufficient-delay-to-create-fw-update-object.patch @@ -3,13 +3,13 @@ From: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> Date: Tue, 25 Aug 2020 15:44:35 +0000 Subject: [PATCH] add sufficient delay to create fw update object -Add support to increase timeoutTimeSeconds to 10 secs to allow firmware +Add support to increase timeoutTimeSeconds to 20 secs to allow firmware object to create successfully to proceed for firmware update. Tested: Redfish validator passed. -Updated the firmware using redfish for 16 times continuously. +Successfully updated the firmware using redfish for more than 10 times continuously. POST: https://<BMC_IP>/redfish/v1/UpdateService/ with <BMC_signed_cap> binary file firmware updated. @@ -22,6 +22,7 @@ firmware updated. } Signed-off-by: Chalapathi Venkataramashetty <chalapathix.venkataramashetty@intel.com> +Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> --- redfish-core/lib/update_service.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -35,7 +36,7 @@ index 9407d75..ec5ab8c 100644 std::shared_ptr<AsyncResp> asyncResp, const crow::Request& req, const std::string& url, const std::vector<std::string>& imgUriTargets, - int timeoutTimeSeconds = 5) -+ int timeoutTimeSeconds = 10) ++ int timeoutTimeSeconds = 20) { // Only allow one FW update at a time if (fwUpdateInProgress != false) diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0032-fix-for-duplicate-redfish-event-log-ID-s.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0032-fix-for-duplicate-redfish-event-log-ID-s.patch new file mode 100644 index 000000000..f4e1feea1 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0032-fix-for-duplicate-redfish-event-log-ID-s.patch @@ -0,0 +1,68 @@ +From 013530bbf14bf14f7772a24675abba15bfba6be8 Mon Sep 17 00:00:00 2001 +From: AppaRao Puli <apparao.puli@linux.intel.com> +Date: Mon, 12 Oct 2020 20:10:31 +0530 +Subject: [PATCH] fix for duplicate redfish event log ID's + +Corrected the logic of reading redfish event +logs distributed across backup's files with +same time stamp. +When event logs with same timestamp is distributed +across redfish event log backup files, redfish event +log ID's calculation causes duplicate ID's. Corrected +the logic for avoiding duplicate ID's. + +Tested: + - Simulated duplicate ID's across backup files and + confirmed no duplicate ID's + +Change-Id: I94266a4396380f50c0df556f4a61426967d8e24a +Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> +--- + redfish-core/lib/log_services.hpp | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp +index e6090e5..e6a9022 100644 +--- a/redfish-core/lib/log_services.hpp ++++ b/redfish-core/lib/log_services.hpp +@@ -1265,6 +1265,9 @@ class JournalEventLogEntryCollection : public Node + uint64_t entryCount = 0; + std::string logEntry; + ++ // Reset the unique ID on the first entry ++ bool firstEntry = true; ++ + // Oldest logs are in the last file, so start there and loop backwards + for (auto it = redfishLogFiles.rbegin(); it < redfishLogFiles.rend(); + it++) +@@ -1275,8 +1278,6 @@ class JournalEventLogEntryCollection : public Node + continue; + } + +- // Reset the unique ID on the first entry +- bool firstEntry = true; + while (std::getline(logStream, logEntry)) + { + entryCount++; +@@ -1353,6 +1354,9 @@ class JournalEventLogEntry : public Node + getRedfishLogFiles(redfishLogFiles); + std::string logEntry; + ++ // Reset the unique ID on the first entry ++ bool firstEntry = true; ++ + // Oldest logs are in the last file, so start there and loop backwards + for (auto it = redfishLogFiles.rbegin(); it < redfishLogFiles.rend(); + it++) +@@ -1363,8 +1367,6 @@ class JournalEventLogEntry : public Node + continue; + } + +- // Reset the unique ID on the first entry +- bool firstEntry = true; + while (std::getline(logStream, logEntry)) + { + std::string idStr; +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0033-Redfish-validator-conformance-fix.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0033-Redfish-validator-conformance-fix.patch new file mode 100644 index 000000000..504e72663 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0033-Redfish-validator-conformance-fix.patch @@ -0,0 +1,121 @@ +From 7959553c906887b5dc9b3fdf020bbd1049007cb6 Mon Sep 17 00:00:00 2001 +From: AppaRao Puli <apparao.puli@linux.intel.com> +Date: Mon, 12 Oct 2020 17:52:31 +0530 +Subject: [PATCH] Redfish validator conformance fix + +This commit fixes the issues reported in +redfish service validator conformance test. + - PCIeFunctions: Add empty checks for + not mandatory properties and skip them. + Also assign default if DeviceId exist and + DeviceClass is empty. + - Memory schema: Corrected the MemoryDeviceType + Value. + +Tested: + - Redfish validator passed. + +Change-Id: Ic32e0f3688a3c0d211b6da995ee86b225c256a92 +Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> +--- + redfish-core/lib/cpudimm.hpp | 12 +++++++++--- + redfish-core/lib/pcie.hpp | 21 ++++++++++++++------- + 2 files changed, 23 insertions(+), 10 deletions(-) + +diff --git a/redfish-core/lib/cpudimm.hpp b/redfish-core/lib/cpudimm.hpp +index e332a11..d15ae6b 100644 +--- a/redfish-core/lib/cpudimm.hpp ++++ b/redfish-core/lib/cpudimm.hpp +@@ -513,10 +513,16 @@ void getDimmDataByService(std::shared_ptr<AsyncResp> aResp, + std::get_if<std::string>(&property.second); + if (value != nullptr) + { +- aResp->res.jsonValue["MemoryDeviceType"] = *value; +- if (boost::starts_with(*value, "DDR")) ++ std::size_t found = value->find_last_of("."); ++ if (found != std::string::npos) + { +- aResp->res.jsonValue["MemoryType"] = "DRAM"; ++ std::string memDevType = value->substr(found + 1); ++ aResp->res.jsonValue["MemoryDeviceType"] = ++ memDevType; ++ if (boost::starts_with(memDevType, "DDR")) ++ { ++ aResp->res.jsonValue["MemoryType"] = "DRAM"; ++ } + } + } + } +diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp +index ac2a2f9..ee92429 100644 +--- a/redfish-core/lib/pcie.hpp ++++ b/redfish-core/lib/pcie.hpp +@@ -364,14 +364,14 @@ class SystemPCIeFunction : public Node + + if (std::string* property = std::get_if<std::string>( + &pcieDevProperties["Function" + function + "DeviceId"]); +- property) ++ property && !property->empty()) + { + asyncResp->res.jsonValue["DeviceId"] = *property; + } + + if (std::string* property = std::get_if<std::string>( + &pcieDevProperties["Function" + function + "VendorId"]); +- property) ++ property && !property->empty()) + { + asyncResp->res.jsonValue["VendorId"] = *property; + } +@@ -385,28 +385,35 @@ class SystemPCIeFunction : public Node + + if (std::string* property = std::get_if<std::string>( + &pcieDevProperties["Function" + function + "DeviceClass"]); +- property) ++ property && !property->empty()) + { + asyncResp->res.jsonValue["DeviceClass"] = *property; + } ++ else ++ { ++ // DeviceClass is mandatory property. If DeviceId exist and ++ // DeviceClass is empty, Lets mark it 'UnassignedClass' so ++ // that user can lookup the DeviceId for actual class. ++ asyncResp->res.jsonValue["DeviceClass"] = "UnassignedClass"; ++ } + + if (std::string* property = std::get_if<std::string>( + &pcieDevProperties["Function" + function + "ClassCode"]); +- property) ++ property && !property->empty()) + { + asyncResp->res.jsonValue["ClassCode"] = *property; + } + + if (std::string* property = std::get_if<std::string>( + &pcieDevProperties["Function" + function + "RevisionId"]); +- property) ++ property && !property->empty()) + { + asyncResp->res.jsonValue["RevisionId"] = *property; + } + + if (std::string* property = std::get_if<std::string>( + &pcieDevProperties["Function" + function + "SubsystemId"]); +- property) ++ property && !property->empty()) + { + asyncResp->res.jsonValue["SubsystemId"] = *property; + } +@@ -414,7 +421,7 @@ class SystemPCIeFunction : public Node + if (std::string* property = std::get_if<std::string>( + &pcieDevProperties["Function" + function + + "SubsystemVendorId"]); +- property) ++ property && !property->empty()) + { + asyncResp->res.jsonValue["SubsystemVendorId"] = *property; + } +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0036-fix-bmcweb-crash-during-sol-communication.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0036-fix-bmcweb-crash-during-sol-communication.patch new file mode 100644 index 000000000..9c0d659b5 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0036-fix-bmcweb-crash-during-sol-communication.patch @@ -0,0 +1,75 @@ +From 8f990dfe45e41c8733f52b1a35575fe7bf749054 Mon Sep 17 00:00:00 2001 +From: AppaRao Puli <apparao.puli@linux.intel.com> +Date: Fri, 13 Nov 2020 19:28:22 +0530 +Subject: [PATCH] fix bmcweb crash during sol communication + +After establishing the obmc_console socket +communication, If client closes the connection +abruptly, async read/write operation fails with +asio.ssl.stream error. To handle the error, it calls +closeHandler call back function and cleans the session +and socket. Any ongoing async read operation should +be discarded by checking socket handle. Read/Write message +from stream via async_read_some()/async_write_some() +without checking socket handle, causes the crash. +Added socket handle validation before performing any +read/write operation to avoid crash. + +Tested: + - Without fix, when sol connection closes abruptly, at times + saw the crash with below logs. +Nov 13 11:32:51 intel-obmc bmcweb[20169]: doRead error asio.ssl.stream:1 +Nov 13 11:32:51 intel-obmc systemd[1]: bmcweb.service: Main process exited, code=dumped, status=11/SEGV +Nov 13 11:32:51 intel-obmc systemd[1]: bmcweb.service: Failed with result 'core-dump'. + + - With fix, verified the case and no crashes seen. +Nov 13 12:55:04 intel-obmc bmcweb[24426]: (2020-11-13 12:55:04) [ERROR "websocket.h":207] doRead error asio.ssl.stream:1 +Nov 13 12:55:04 intel-obmc bmcweb[24426]: (2020-11-13 12:55:04) [ERROR "obmc_console.hpp":67] doread() - Socket closed + +Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> +Change-Id: I2afda509ca77a561651a8682e042c45ca7366642 +--- + include/obmc_console.hpp | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/include/obmc_console.hpp b/include/obmc_console.hpp +index 9e5e058..8608f5f 100644 +--- a/include/obmc_console.hpp ++++ b/include/obmc_console.hpp +@@ -36,6 +36,12 @@ void doWrite() + return; + } + ++ if (!host_socket) ++ { ++ BMCWEB_LOG_ERROR << "doWrite(): Socket closed."; ++ return; ++ } ++ + doingWrite = true; + host_socket->async_write_some( + boost::asio::buffer(inputBuffer.data(), inputBuffer.size()), +@@ -62,6 +68,12 @@ void doWrite() + + void doRead() + { ++ if (!host_socket) ++ { ++ BMCWEB_LOG_ERROR << "doRead(): Socket closed."; ++ return; ++ } ++ + BMCWEB_LOG_DEBUG << "Reading from socket"; + host_socket->async_read_some( + boost::asio::buffer(outputBuffer.data(), outputBuffer.size()), +@@ -125,6 +137,7 @@ void requestRoutes(CrowApp& app) + }) + .onclose( + [](crow::websocket::Connection& conn, const std::string& reason) { ++ BMCWEB_LOG_INFO << "Closing websocket. Reason: " << reason; + sessions.erase(&conn); + if (sessions.empty()) + { +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0037-Use-non-throw-version-of-remote_endpoint.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0037-Use-non-throw-version-of-remote_endpoint.patch new file mode 100644 index 000000000..e1171e182 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0037-Use-non-throw-version-of-remote_endpoint.patch @@ -0,0 +1,55 @@ +From 666b78c7599960a8ac8d1a90d389dd02e605a170 Mon Sep 17 00:00:00 2001 +From: AppaRao Puli <apparao.puli@linux.intel.com> +Date: Tue, 24 Nov 2020 13:55:12 +0530 +Subject: [PATCH] Use non-throw version of remote_endpoint + +Using boost call to get the remote endpoint of +socket is not handled properly in code, causes +the bmcweb crash in some corner cases. + +Nov 23 18:48:07 intel-obmc bmcweb[19300]: terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>' +Nov 23 18:48:07 intel-obmc bmcweb[19300]: what(): remote_endpoint: Bad file descriptor + +Added non-throw version of remote_endpoint() +and handled the error code appropriately to avoid +the bmcweb crash. + +Tested: + - Sesisons URI show properly remote IP address + and no bmcweb crashes seen. + +Change-Id: Iafa9011dbc09235785cbb7d853e22d5fd752db89 +Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com> +--- + redfish-core/lib/redfish_sessions.hpp | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp +index 267f98a..1a015f3 100644 +--- a/redfish-core/lib/redfish_sessions.hpp ++++ b/redfish-core/lib/redfish_sessions.hpp +@@ -230,12 +230,18 @@ class SessionCollection : public Node + auto socket = req.socket(); + if (socket) + { ++ boost::system::error_code ec; + #ifdef BMCWEB_ENABLE_SSL +- clientIp = +- (*socket).next_layer().remote_endpoint().address().to_string(); ++ boost::asio::ip::tcp::endpoint endpoint = ++ (*socket).next_layer().remote_endpoint(ec); + #else +- clientIp = (*socket).remote_endpoint().address().to_string(); ++ boost::asio::ip::tcp::endpoint endpoint = ++ (*socket).remote_endpoint(ec); + #endif ++ if (!ec) ++ { ++ clientIp = endpoint.address().to_string(); ++ } + } + // User is authenticated - create session + std::shared_ptr<crow::persistent_data::UserSession> session = +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0038-Change-Severity-for-ServiceFailure-redfish-event.patch b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0038-Change-Severity-for-ServiceFailure-redfish-event.patch new file mode 100644 index 000000000..af2f05151 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-phosphor/interfaces/bmcweb/0038-Change-Severity-for-ServiceFailure-redfish-event.patch @@ -0,0 +1,56 @@ +From 8c1be7323641010df618e8d6fc60829b1afa75c6 Mon Sep 17 00:00:00 2001 +From: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> +Date: Thu, 3 Dec 2020 18:33:43 +0000 +Subject: [PATCH] Change Severity for ServiceFailure redfish event + +During Ac cycle stress, at times some services may exit unsuccessfully. +This will not have any functionality impact. So updated Severity of +"ServiceFailure" redfish event to "Ok". + +Tested: +1. Redfish validator - passed for this with change +2. Killed couple of process and observed Redfish EventLog shows updated + Severity. +Redfish URI: +GET: https://<BMC IP>/redfish/v1/Systems/system/LogServices/EventLog + /Entries + { + "@odata.id": "/redfish/v1/Systems/system/LogServices/ + EventLog/Entries/1606938922", + "@odata.type": "#LogEntry.v1_4_0.LogEntry", + "Created": "2020-12-02T19:55:22+00:00", + "EntryType": "Event", + "Id": "1606938922", + "Message": "Service phosphor-ipmi-host.service has exited + unsuccessfully.", + "MessageArgs": [ + "phosphor-ipmi-host.service" + ], + "MessageId": "OpenBMC.0.1.ServiceFailure", + "Name": "System Event Log Entry", + "Severity": "OK" + } + +Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> +--- + redfish-core/include/registries/openbmc_message_registry.hpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/redfish-core/include/registries/openbmc_message_registry.hpp b/redfish-core/include/registries/openbmc_message_registry.hpp +index 6f1fec3..522d783 100644 +--- a/redfish-core/include/registries/openbmc_message_registry.hpp ++++ b/redfish-core/include/registries/openbmc_message_registry.hpp +@@ -2281,8 +2281,8 @@ constexpr std::array<MessageEntry, 188> registry = { + { + "Indicates that a service has exited unsuccessfully.", + "Service %1 has exited unsuccessfully.", +- "Warning", +- "Warning", ++ "OK", ++ "OK", + 1, + {"string"}, + "None.", +-- +2.17.1 + |