History log of /openbmc/pldm/softoff/softoff.cpp (Results 1 – 25 of 32)
Revision Date Author Comments
# 3c8b3e35 29-Jan-2025 Pavithra Barithaya <pavithrabarithaya07@gmail.com>

softoff : Migrate to placement_new from reinterpret casting

reinterpret_cast is prohibited by the C++ core guidelines because
it takes the behavior outside the language definition and gives
problems

softoff : Migrate to placement_new from reinterpret casting

reinterpret_cast is prohibited by the C++ core guidelines because
it takes the behavior outside the language definition and gives
problems with type safety. Placement-new on the other-hand allows
to control the object storage while still properly instantiating
an object,keeping the behavior inside the C++ language
specification.

Change-Id: I75dd9e2372b32bf4258c497152f61cd0ca6ad9bd
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>

show more ...


# 16c2a0a0 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: I8c84201cb2343a8c8a5507a49de0721a1bee7063
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 1e5c81e0 03-May-2024 Riya Dixit <riyadixitagra@gmail.com>

pldm: Remove unnecessary type casting in logs

This commit removes the unnecessary type casting of values of the
journal logs based on supported types mentioned in LG2 documentation
[1].

Testing: Ve

pldm: Remove unnecessary type casting in logs

This commit removes the unnecessary type casting of values of the
journal logs based on supported types mentioned in LG2 documentation
[1].

Testing: Verified the debug traces to correct.

'''
For Instance:
Earlier -
error(”TYPE = {TYPE} “, “TYPE”, static_cast<unsigned>(PLDM_STATE_EFFECTER_PDR));
Journal trace -
May 27 08:16:51 p10bmc pldmd[931]: TYPE = 11

After Correction -
error(”TYPE = {TYPE}“, “TYPE”, PLDM_STATE_EFFECTER_PDR);
Journal trace -
May 27 08:16:51 p10bmc pldmd[931]: TYPE = Enum(11)
'''

[1]: https://github.com/openbmc/phosphor-logging/blob/master/docs/structured-logging.md#lg2

Change-Id: Ia649ecd4ecbb73c421f7844885f58a6835805719
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>

show more ...


# 087a751f 06-Apr-2024 Riya Dixit <riyadixitagra@gmail.com>

pldmd, requester, softoff & utilities: Improving logs (lg2)

This commit corrects the severity level of logs and also formats the
message string, fixing the ill-defined message string of the logs as

pldmd, requester, softoff & utilities: Improving logs (lg2)

This commit corrects the severity level of logs and also formats the
message string, fixing the ill-defined message string of the logs as
mentioned in the anti-pattern document [1]. Additionally, based on the
requirement this commit adds more debug information to logs.

[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#ill-defined-data-structuring-in-lg2-message-strings

Change-Id: I230e9e1404db8c92c81e2f872183d691c91ff16c
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>

show more ...


# e98c51b1 08-Jun-2021 Zach Clark <zach@ibm.com>

Update pldm-softpoweroff application with working values

This commit updates the pldm-softpoweroff application so that it can
properly locate the PLDM effecter and sensor PDRs for the graceful
power

Update pldm-softpoweroff application with working values

This commit updates the pldm-softpoweroff application so that it can
properly locate the PLDM effecter and sensor PDRs for the graceful
poweroff request. It also updates the host terminus ID to the correct
value.

Tested by:

Running the application when Hostboot was IPLing, and also when PHYP
was at standby.

root@ever39bmc:~# /tmp/pldm-softpoweroff
Getting the response. PLDM RC = 0
Timer started waiting for host soft off, TIMEOUT_IN_SEC = 0x1c20
root@ever39bmc:~# echo $?
0

Signed-off-by: Zach Clark <zach@ibm.com>
Change-Id: I7408611881abecfb5169816af032e2fb9d3a8a09

show more ...


# 4d99c311 28-Mar-2024 Sagar Srinivas <sagar.srinivas@ibm.com>

Softoff: Add config support for PDR entities

This commit introduces a config file for the soft power off
app. The config file specifies the order of remote PDRs to
be checked during the soft power o

Softoff: Add config support for PDR entities

This commit introduces a config file for the soft power off
app. The config file specifies the order of remote PDRs to
be checked during the soft power off process.

Previously, the entity type was hardcoded in the codebase,
limiting scalability. With this change, the softoff app gains
flexibility for future expansions.

TESTED: By running 'obmcutil poweroff' with various remote
entities during boot-up.

Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: Ib8d2aba6a05fc4e9da4b042fd67890e6282ed784

show more ...


# 3fcfaa12 26-Feb-2024 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix softoff crash due to double free corruption

In its present condition, the instance database gets initialized
within the hostSoftOff function. Consequently, once the function
execution is complet

Fix softoff crash due to double free corruption

In its present condition, the instance database gets initialized
within the hostSoftOff function. Consequently, once the function
execution is complete, the database goes out of scope, triggering
the invocation of the instanceDb destructor. This, in turn,
prematurely destroys the instance database in the middle of the
softpoweroff flow, resulting in a double free corruption.

Tested:
After implementing the fix, softoff was tested to ensure it does
not crash.

Change-Id: I251201b06864a8a5273bfaa23468a06ad678763a
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>

show more ...


# cbe68b2d 23-Feb-2024 Sagar Srinivas <sagar.srinivas@ibm.com>

Remove iostream references

With the adoption of LG2 we do not need iostream
prints to the journal. The library was referred but
never used in these cases.

Signed-off-by: Sagar Srinivas <sagar.srini

Remove iostream references

With the adoption of LG2 we do not need iostream
prints to the journal. The library was referred but
never used in these cases.

Signed-off-by: Sagar Srinivas <sagar.srinivas@ibm.com>
Change-Id: I11d3f00284e4f16b63cddb8da2fed14d59672ba1

show more ...


# 58cbcaf2 06-Oct-2023 Kamalkumar Patel <kamalkumar.patel@ibm.com>

PLDM:Catching exception precisely and printing it

Correcting catch block in PLDM repo to print all
exception precisely so pldm trace can be more
useful to identify defect easily.

Change-Id: If2e86d

PLDM:Catching exception precisely and printing it

Correcting catch block in PLDM repo to print all
exception precisely so pldm trace can be more
useful to identify defect easily.

Change-Id: If2e86dcb031ddc2e927e7836d7f4359f5b44cdec
Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>

show more ...


# a675662c 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: Ib8dfa202f1d59add43fc0d55ab2bf388c8e7c877
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 1ed5f7a6 21-May-2023 Rashmica Gupta <rashmica@linux.ibm.com>

pldm: Convert to using libpldm transport APIs

A significant amount of logic can be removed by exploiting the new
transport APIs provided by libpldm. Switch the pldm repository over to
use these by i

pldm: Convert to using libpldm transport APIs

A significant amount of logic can be removed by exploiting the new
transport APIs provided by libpldm. Switch the pldm repository over to
use these by introducing an RAII wrapper for the APIs. The current
stance is to continue using the legacy mctp-demux transport
implementation, but we also provide a build option to switch to the
AF_MCTP transport.

We don't currently have the infrastructure in place to get the correct
TIDs, so to keep everything working as before use the EID as the TID in
the EID-to-TID mapping.

Change-Id: I366f079082b102cfc0e90db0f62208581eb8693e
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>

show more ...


# 3d03f3fa 07-Sep-2023 Dung Cao <dung@os.amperecomputing.com>

pldmtool/softoff: Use InstanceId APIs from libpldm

The af-mctp transport does not broadcast the PLDM messages between the
MCTP socket instances. Pldmtool/softoff have to handle get/free
instanceId i

pldmtool/softoff: Use InstanceId APIs from libpldm

The af-mctp transport does not broadcast the PLDM messages between the
MCTP socket instances. Pldmtool/softoff have to handle get/free
instanceId instead of depending on the pldmd. Update pldmtool/softoff
to use get/free instanceId APIs in libpldm.

Tested.
1. Call more than 32 pldmtool commands to make sure the allocated
InstanceId are free correctly.
2. Repeat calling softoff more than 32 times. Make sure the functional
should work normally.

Signed-off-by: Dung Cao <dung@os.amperecomputing.com>
Signed-off-by: Thu Nguyen <thu@os.amperecomputing.com>
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Change-Id: I7cda124694d95d00c37f4993e22cfe33a980d364

show more ...


# 91a092f6 18-Sep-2023 vkaverap@in.ibm.com <vkaverap@in.ibm.com>

PLDM:Use new alias of DBUS_TIMEOUT for bus.call

This commit uses a new global variable for DBUS_TIMEOUT which is included as an input parameter for bus.call dbus calls. The new alias makes the bus.c

PLDM:Use new alias of DBUS_TIMEOUT for bus.call

This commit uses a new global variable for DBUS_TIMEOUT which is included as an input parameter for bus.call dbus calls. The new alias makes the bus.call function shorter and readable.

Change-Id: I336c97bc0631d5370ff3648e41f50e3e283d771b
Signed-off-by: vkaverap@in.ibm.com <vkaverap@in.ibm.com>

show more ...


# 47792274 13-Jun-2023 Andrew Jeffery <andrew@aj.id.au>

pldm: Include config.h via compiler argument

This removes any ambiguity about which config.h is being included.
Subprojects such as libpldm and phosphor-logging also generate config.h
files, and the

pldm: Include config.h via compiler argument

This removes any ambiguity about which config.h is being included.
Subprojects such as libpldm and phosphor-logging also generate config.h
files, and these are exposed in the include path.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I3e0ccd6339f088380ffa29d41167b07aefc7dd16

show more ...


# 9138c209 19-May-2023 vkaverap@in.ibm.com <vkaverap@in.ibm.com>

PLDM : Change the dbus timeout to 5 seconds

Dbus timeout value for every dbus call in PLDM is set to 5 seconds
instead of default 25 seconds so that all dbus calls that expect a
reply exists after 5

PLDM : Change the dbus timeout to 5 seconds

Dbus timeout value for every dbus call in PLDM is set to 5 seconds
instead of default 25 seconds so that all dbus calls that expect a
reply exists after 5 seconds if there is no response from the client.
While BMC is still waiting for a response on any dbus calls it is
possible that host can timeout and return an error.
Another reason is that memory address from where BMC would read data
sent by host may get deallocated after 20 seconds and it is possible
for this to happen even before BMC has read the data. This has lead
to DMA issues.

Tested by adding a sleep for 10 seconds inside main function of
phospher-host-postd and executed get dbus property on snoopd
interface from pldm. PLDM dbus call timed out after 5 seconds.

Change-Id: I1aa1b4ad7fceff2224a3ccc3bcf6abd5705963bc
Signed-off-by: Varsha Kaverappa <vkaverap@in.ibm.com>

show more ...


# 499a29dd 29-May-2023 ThuBaNguyen <thu@os.amperecomputing.com>

softoff: Fix the CI error

The CI for new patch set report errors in softoff code.

'''
../softoff/softoff.cpp: In member function 'int pldm::SoftPowerOff::getSensorInfo()':
../softoff/softoff.cpp:26

softoff: Fix the CI error

The CI for new patch set report errors in softoff code.

'''
../softoff/softoff.cpp: In member function 'int pldm::SoftPowerOff::getSensorInfo()':
../softoff/softoff.cpp:263:14: error: 'pdr' may be used uninitialized [-Werror=maybe-uninitialized]
263 | auto possibleStatesStart = pdr->possible_states;
| ^~~~~~~~~~~~~~~~~~~
../softoff/softoff.cpp:249:32: note: 'pdr' was declared here
249 | pldm_state_sensor_pdr* pdr;
cc1plus: all warnings being treated as errors
'''

Update code to fix that.

Signed-off-by: ThuBaNguyen <thu@os.amperecomputing.com>
Change-Id: Ib9df9f79978941ebad62164866cc688412a08922

show more ...


# 6da4f91b 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: I61b093f75011417cc9c7acf9605200f4fa429bac
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 49cfb138 02-Mar-2023 Riya Dixit <riyadixitagra@gmail.com>

PLDM: Implementing Phosphor-Logging/LG2 logging

This commit adds changes in PLDM for implementing
structured LG2 logging, thereby moving away from
std::cout/cerr practice of logging which are
output

PLDM: Implementing Phosphor-Logging/LG2 logging

This commit adds changes in PLDM for implementing
structured LG2 logging, thereby moving away from
std::cout/cerr practice of logging which are
output streams and not logging mechanism.

PLDM now can make use of lg2 features like accurate
CODE LINE Number and CODE_FUNCTION Name and better
detailing in json object values which can be used in
log tracking.

More detailed logging change:
https://gist.github.com/riyadixitagra/c251685c1ba84248181891f7bc282395

Tested:
Ran a power off, on, cycle, and reset-reload.

Change-Id: I0485035f15f278c3fd172f0581b053c1c37f3a5b
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>

show more ...


# c453e164 21-Dec-2022 George Liu <liuxiwei@inspur.com>

libpldm: Correct reference to libpldm header files

When relying on header files from external libraries, #include<> should
be used instead of #include "" to avoid ambiguity.

Tested: Built pldm succ

libpldm: Correct reference to libpldm header files

When relying on header files from external libraries, #include<> should
be used instead of #include "" to avoid ambiguity.

Tested: Built pldm successfully after enabling ibm-oem

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ia1997de7e0f61564055bbd837f4e24c8f14e55a5

show more ...


# 27a022ca 10-Aug-2022 Andrew Jeffery <andrew@aj.id.au>

libpldm: Migrate to subproject

Organize files in libpldm to make it a subproject

In the current state, libpldm is not readily consumable
as a subproject.This commit does all the necessary re-organi

libpldm: Migrate to subproject

Organize files in libpldm to make it a subproject

In the current state, libpldm is not readily consumable
as a subproject.This commit does all the necessary re-organisation
of the source code to make it work as a subproject.

There are no .c/.h files changes in this commit, only meson
changes and re-organising the code structure.

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I20a71c0c972b1fd81fb359d604433618799102c6

show more ...


# 84b790cb 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

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

show more ...


# 9915d022 21-Dec-2021 George Liu <liuxiwei@inspur.com>

softoff: Check the return value of the HOST

When BMC sends `set_state_effecter_states` command, only when HOST
responds successfully(PLDM_SUCCESS), it will continue to wait for the
HOST to do the pr

softoff: Check the return value of the HOST

When BMC sends `set_state_effecter_states` command, only when HOST
responds successfully(PLDM_SUCCESS), it will continue to wait for the
HOST to do the preparatory work before shutdown, otherwise it will
directly exit the softoff daemon.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Idfd5e50cf3372c89fbc48d8f1ad67a2c3b800352

show more ...


# 31a78447 12-Sep-2021 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix issues reported by static analysis tool

Following are the issues reported by the clang static
analysis tool in the CI, this commit is an attempt to
fix those.
1. warning: Value stored to 'rc' du

Fix issues reported by static analysis tool

Following are the issues reported by the clang static
analysis tool in the CI, this commit is an attempt to
fix those.
1. warning: Value stored to 'rc' during its initialization
is never read [deadcode.DeadStores]
auto rc = getHostState();
2. warning: Branch condition evaluates to a garbage
value [core.uninitialized.Branch]
if (!pdr)
3. warning: Value stored to 'type' during its initialization
is never read [deadcode.DeadStores]
uint8_t type = requestMsg[1];
4. warning: Value stored to 'sum' during its initialization
is never read [deadcode.DeadStores]
auto sum = crc32(fruData.data(), recordTableSize + pads);
5. warning: Value stored to 'responsePtr' during its initialization
is never read [deadcode.DeadStores]
auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I0673403a36c90025afd0f2b1bca1d7f3ea052033

show more ...


# 4fea7a20 02-Sep-2021 Patrick Williams <patrick@stwcx.xyz>

exception: switch to public sdbus exception

SdBusError was intended to be a private error type inside sdbusplus.
Switch all catch locations to use the general sdbusplus::exception type.

Signed-off-

exception: switch to public sdbus exception

SdBusError was intended to be a private error type inside sdbusplus.
Switch all catch locations to use the general sdbusplus::exception type.

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

show more ...


# b0d15f1f 16-Apr-2021 Deepak Kodihalli <deepak.kodihalli.83@gmail.com>

build: switch to C++20

Signed-off-by: Deepak Kodihalli <deepak.kodihalli.83@gmail.com>
Change-Id: I514e8210bfcc4c4546720de19b151d9a4dae1fc5


12