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>
diff --git a/oem/ibm/libpldmresponder/file_io_type_dump.cpp b/oem/ibm/libpldmresponder/file_io_type_dump.cpp
index 2c6b02a..9005f66 100644
--- a/oem/ibm/libpldmresponder/file_io_type_dump.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_dump.cpp
@@ -69,7 +69,9 @@
bus.new_method_call(DUMP_MANAGER_BUSNAME, DUMP_MANAGER_PATH,
OBJECT_MANAGER_INTERFACE, "GetManagedObjects");
- auto reply = bus.call(method);
+ auto reply = bus.call(
+ method,
+ std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT)).count());
reply.read(objects);
}
catch (const sdbusplus::exception_t& e)
@@ -285,7 +287,9 @@
auto method = bus.new_method_call(
"xyz.openbmc_project.Dump.Manager", path.c_str(),
"xyz.openbmc_project.Object.Delete", "Delete");
- bus.call(method);
+ bus.call(method,
+ std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT))
+ .count());
}
catch (const std::exception& e)
{
diff --git a/oem/ibm/libpldmresponder/file_io_type_pel.cpp b/oem/ibm/libpldmresponder/file_io_type_pel.cpp
index c329bac..ba94f4e 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pel.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pel.cpp
@@ -108,7 +108,9 @@
auto method = bus.new_method_call(service.c_str(), logObjPath,
logInterface, "GetPEL");
method.append(fileHandle);
- auto reply = bus.call(method);
+ auto reply = bus.call(
+ method,
+ std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT)).count());
sdbusplus::message::unix_fd fd{};
reply.read(fd);
auto rc = transferFileData(fd, true, offset, length, address);
@@ -139,7 +141,9 @@
auto method = bus.new_method_call(service.c_str(), logObjPath,
logInterface, "GetPEL");
method.append(fileHandle);
- auto reply = bus.call(method);
+ auto reply = bus.call(
+ method,
+ std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT)).count());
sdbusplus::message::unix_fd fd{};
reply.read(fd);
diff --git a/oem/ibm/libpldmresponder/inband_code_update.cpp b/oem/ibm/libpldmresponder/inband_code_update.cpp
index c69c1bc..1e87824 100644
--- a/oem/ibm/libpldmresponder/inband_code_update.cpp
+++ b/oem/ibm/libpldmresponder/inband_code_update.cpp
@@ -164,7 +164,9 @@
method.append("xyz.openbmc_project.Association", "endpoints");
std::variant<std::vector<std::string>> paths;
- auto reply = bus.call(method);
+ auto reply = bus.call(
+ method,
+ std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT)).count());
reply.read(paths);
runningVersion = std::get<std::vector<std::string>>(paths)[0];
@@ -173,7 +175,9 @@
propIntf, "Get");
method1.append("xyz.openbmc_project.Association", "endpoints");
- auto reply1 = bus.call(method1);
+ auto reply1 = bus.call(
+ method1,
+ std::chrono::duration_cast<microsec>(sec(DBUS_TIMEOUT)).count());
reply1.read(paths);
for (const auto& path : std::get<std::vector<std::string>>(paths))
{