summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-12-12 13:30:14 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-01-27 08:06:26 -0600
commita19b6234410703c3b45d30636978e35f07f18394 (patch)
treeb11825e61e576142293f2a01778ec8a485936818 /extensions
parent41293cb851e00807996950f34cb1ec4e410d6931 (diff)
downloadphosphor-logging-a19b6234410703c3b45d30636978e35f07f18394.tar.gz
phosphor-logging-a19b6234410703c3b45d30636978e35f07f18394.zip
PEL: Receive a 'bad PEL' indication from host
If the code somehow sent the host a malformed PEL, it will respond with the 'Ack PEL' PLDM command with a special value that indicates this, and the PLDM daemon will relay it to this daemon. In this case, change the host transmission state to 'bad' so it doesn't get sent again. This should never happen as the Repository class already validates PELs and removes bad ones, though maybe the host and Repository have different ideas about what constitutes a malformed PEL. In the future, if event logging support is added to the PEL code running inside the logging daemon, it may be a good idea to create a new PEL for this case. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Id6f9fd37764bf5b5d09b4277a1e36b1f26b3e9a5
Diffstat (limited to 'extensions')
-rw-r--r--extensions/openpower-pels/host_notifier.cpp13
-rw-r--r--extensions/openpower-pels/host_notifier.hpp12
2 files changed, 25 insertions, 0 deletions
diff --git a/extensions/openpower-pels/host_notifier.cpp b/extensions/openpower-pels/host_notifier.cpp
index ca30340..2e132b9 100644
--- a/extensions/openpower-pels/host_notifier.cpp
+++ b/extensions/openpower-pels/host_notifier.cpp
@@ -419,4 +419,17 @@ void HostNotifier::setHostFull(uint32_t id)
}
}
+void HostNotifier::setBadPEL(uint32_t id)
+{
+ log<level::ERR>("PEL rejected by the host", entry("PEL_ID=0x%X", id));
+
+ auto sent = std::find(_sentPELs.begin(), _sentPELs.end(), id);
+ if (sent != _sentPELs.end())
+ {
+ _sentPELs.erase(sent);
+ }
+
+ _repo.setPELHostTransState(id, TransmissionState::badPEL);
+}
+
} // namespace openpower::pels
diff --git a/extensions/openpower-pels/host_notifier.hpp b/extensions/openpower-pels/host_notifier.hpp
index 21bd072..01eac48 100644
--- a/extensions/openpower-pels/host_notifier.hpp
+++ b/extensions/openpower-pels/host_notifier.hpp
@@ -117,6 +117,18 @@ class HostNotifier
*/
void setHostFull(uint32_t id);
+ /**
+ * @brief Called when the host receives a malformed PEL.
+ *
+ * Ideally this will never happen, as the Repository
+ * class already purges malformed PELs.
+ *
+ * The PEL should never be sent up again.
+ *
+ * @param[in] id - The PEL ID
+ */
+ void setBadPEL(uint32_t id);
+
private:
/**
* @brief This function gets called by the Repository class
OpenPOWER on IntegriCloud