History log of /openbmc/phosphor-logging/test/openpower-pels/host_notifier_test.cpp (Results 1 – 16 of 16)
Revision Date Author Comments
# 075c7923 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I21d2ca8065f24fd73509229c517f5caf48934b60
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 5fb575ae 20-Oct-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: Ib459ac591ed3031de84d0239948d8daa583ef8a5
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 527ff346 29-Jun-2023 Matt Spinler <spinler@us.ibm.com>

PEL: Handle failing to start a PLDM cmd better

A recent PLDM bug caused the registerReceiveCallback() function, which
is used to setup listening for the PLDM response from the host when
telling the

PEL: Handle failing to start a PLDM cmd better

A recent PLDM bug caused the registerReceiveCallback() function, which
is used to setup listening for the PLDM response from the host when
telling them about a new PEL, to throw an exception.

When this happened, the code got stuck in the 'in progress' state, so it
would never try again when the next PEL came in.

Fix that by having startCommand() throw an exception instead of calling
the failure response function callback. With this change, the code will
continue on to call the cleanupCmd() function so everything is ready
when the next PEL comes in.

Tested:
With the bad PLDM code, after the first PEL ran out of retry attempts,
created another PEL and saw the code attempt again to call PLDM. Also,
wrote a new unit test case for it.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I38034440435d6a86e8dd880eef09499f19dd6e9c

show more ...


# ac1ba3f2 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

Change-Id: I077deb6e98025e4e8c6abd4d039f9af4db19342b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 2544b419 04-Oct-2022 Patrick Williams <patrick@stwcx.xyz>

clang-format: update with latest

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I329396457b83bb2eb8740629b4ac1fbe9106bced


# e5f7508b 24-Jan-2022 Matt Spinler <spinler@us.ibm.com>

PEL: Wait a bit after host up before sending PELs

Wait a minute after the host state switches to running before sending
any PELs to the host. This applies both on a normal boot and also when
the BM

PEL: Wait a bit after host up before sending PELs

Wait a minute after the host state switches to running before sending
any PELs to the host. This applies both on a normal boot and also when
the BMC is rebooted when the host is already up.

This is being done for 2 reasons:
1) Give some relief to the PLDM traffic and CPU load that occurs after a
BMC reboot when the host is already up, because the host will also be
exchanging PLDM PDRs with the BMC then and pretty much every
application is also starting up at the time as well.
2) A lot of times on a normal boot the host notifier code ends up having
to do a few retries when it first starts sending the PELs because the
first few commands fail, possibly because the code on the receiving
end isn't quite ready yet.

I arrived at that amount of time by deciding 30 seconds was reasonable,
and then doubling it just to be sure. During testing of the reboots the
minute timeout gave plenty of time for the BMC to get back to BMC ready.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I0929a4acdda0a9fe8fbdcd624c5821a642ad83a6

show more ...


# d26fa3e7 21-Apr-2021 Patrick Williams <patrick@stwcx.xyz>

openpower-pels: clean up various compile warnings

Compile warnings observed when compiling parts of the
openpower-pels (or corresponding tests) under stricter
compiler warning flags

openpower-pels: clean up various compile warnings

Compile warnings observed when compiling parts of the
openpower-pels (or corresponding tests) under stricter
compiler warning flags of Meson.

Issues fixed:
- many unused parameters
- invalid case fall-through
- excess semi-colons
- incorrect 'const' on return-by-value type
- removal of variable length array in test case
- uncaught return from 'system' call in test case

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I8af69184042cf8661d1307a02ecf3afcab4724a1

show more ...


# 24a8558b 27-Jan-2020 Matt Spinler <spinler@us.ibm.com>

PEL: Don't send PELs to host when flag disabled

Don't put any PELs on the queue to send to the host when the setting to
send event logs to the host has been set to false.

Signed

PEL: Don't send PELs to host when flag disabled

Don't put any PELs on the queue to send to the host when the setting to
send event logs to the host has been set to false.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I37be53f54c354e2c440ac3a932630a4905e311f1

show more ...


# 56e08263 27-Jan-2020 Matt Spinler <spinler@us.ibm.com>

PEL: HostNotifier testcase refactoring

This commit doesn't change the behavior, it just makes the following
changes to the testcase infrastructure so there is less duplication:

PEL: HostNotifier testcase refactoring

This commit doesn't change the behavior, it just makes the following
changes to the testcase infrastructure so there is less duplication:

* Move the hostIface, mockHostIface, repo, and dataIface instances into
the test class HostNotifierTest so that all testcases can use them,
and then remove creating them in every testcase.

* MockHostIface is now a pointer, so have to change its use.

* Make the DataInterface and HosttInterface mocks be NiceMocks so that
gtest won't print warnings about functions called that don't have
EXPECT_CALLs.

* Have the default behavior of sendNewLogCmd be to send a command
successfully so that it doesn't have to be specified in every
testcase.

Change-Id: Ic393933629753b884299ee4dfa30a8bb6007ee63

show more ...


# a19b6234 12-Dec-2019 Matt Spinler <spinler@us.ibm.com>

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 t

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

show more ...


# 41293cb8 12-Dec-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Notifier support for 'host full'

The host firmware may have a limited size for its staging area
before it passes the PELs through to the OS, and this area may
fill up with PELs

PEL: Notifier support for 'host full'

The host firmware may have a limited size for its staging area
before it passes the PELs through to the OS, and this area may
fill up with PELs it can't send if there are too many or the OS
isn't up yet.

In this case, it will send down an 'Ack PEL' PLDM command with a
special response indicating this host full condition. The PLDM
daemon will then call a method on this daemon to let it know.

This command handles the host full condition on the HostNotifier
class. When this is set:

* The PEL that hit this condition will be put back on the queue
to be sent again.
* No new PELs will be sent up, except as noted below
* A 60s timer will be started at the end of which another attempt
will be made to send a PEL, in the hopes the condition went away.
- If it didn't go away, this process will repeat.
- If it did go away, a successful ack will be received and things
will proceed as normal.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Iaeb38f43f7acc595bcff234ba50cedf8188b3d9b

show more ...


# cc3b64ae 12-Dec-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Support for the host acking a PEL

After the host firmware successfully transfers a PEL to the OS,
it will respond with an 'Ack' command that the PLDM daemon sends
over to this d

PEL: Support for the host acking a PEL

After the host firmware successfully transfers a PEL to the OS,
it will respond with an 'Ack' command that the PLDM daemon sends
over to this daemon via a D-Bus method call.

Add support to the HostNotifier class for this. It will change the
state field in the PEL to 'acked' so that it doesn't get sent up
again.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Id2a9985965017d9431419c1375d5374a2d0ae00b

show more ...


# 7d800a4e 12-Dec-2019 Matt Spinler <spinler@us.ibm.com>

PEL: On new PEL, send to host if necessary

When a new PEL comes in, send it to the host now if the host
is up and the class is currently idle.

The PLDM command will be dispatche

PEL: On new PEL, send to host if necessary

When a new PEL comes in, send it to the host now if the host
is up and the class is currently idle.

The PLDM command will be dispatched in a standalone function
called from the event loop so that this function, which may
be part of the 'Create new log' D-Bus method response, can
return first.

Also added testcases to start verifying these paths now that
there is a full mock of the HostInterface class.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ib30a99cc61be9205122287ba310bc315d762e863

show more ...


# f77debb9 12-Dec-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Take a PEL off the queue and send to host

Fill in the code that looks for the first PEL on the queue that still
needs to be sent up, and send it.

If the failure retry timer

PEL: Take a PEL off the queue and send to host

Fill in the code that looks for the first PEL on the queue that still
needs to be sent up, and send it.

If the failure retry timer is active, or it has already retried the max
number of times, then don't send anything. In the former case the timer
callback will do the send, and in the latter the next time a log comes
in it will start trying again.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ibb9692ca83b23e5e021db8b8a89b5549fb979df1

show more ...


# a943b15b 11-Dec-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Logic to enqueue a PEL to send to host

Fill in the function to determine if a PEL needs to be placed on the
qeueue to be sent up to the host. It involves checking both the host

PEL: Logic to enqueue a PEL to send to host

Fill in the function to determine if a PEL needs to be placed on the
qeueue to be sent up to the host. It involves checking both the host
and HMC transmission states, as well as the PEL action flags field.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I9f1a9fba1b7e6dc7a167f1c7e9dfd6c40d90883f

show more ...


# f60ac27e 11-Dec-2019 Matt Spinler <spinler@us.ibm.com>

PEL: Add HostNotifier class

This class will watch for new PELs being created, and handle sending
them up to the host. This first commit for this class mostly just fills
in the const

PEL: Add HostNotifier class

This class will watch for new PELs being created, and handle sending
them up to the host. This first commit for this class mostly just fills
in the constructor to set up the various callbacks it will use.

It is only instantiated in the Manager class if the Manager constructor
used is the one that passes in the HostInterface object, to allow for
configurations that don't need PELs passed up.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I0ddcf94d047979eb78209d396c2351566c634dbe

show more ...