pldmd: Remove Requester interface from D-Bus
The original design of the Requester D-Bus API was ill-considered. While
it offered allocation functionality, it did not provide a corresponding
mechanism to release instance IDs. Consequently, pldmd was forced to
monitor all PLDM traffic and implement workarounds to manage instance ID
lifecycles on behalf of applications, effectively assuming the role of
global instance ID manager.
Additionally, many applications duplicated PLDM logic - implementing
their own retry mechanisms - and, in some cases, violated the PLDM
specification by setting timeouts as high as 40 seconds.
Now that all applications rely directly on the libpldm allocator, it
makes sense to remove this legacy interface entirely to prevent any
future usage.
Change-Id: Iadc3a036a65877de164447fbd334ca9bf085ee1c
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/libpldmresponder/platform.cpp b/libpldmresponder/platform.cpp
index db6b36d..db6c7b7 100644
--- a/libpldmresponder/platform.cpp
+++ b/libpldmresponder/platform.cpp
@@ -11,7 +11,6 @@
#include "platform_numeric_effecter.hpp"
#include "platform_state_effecter.hpp"
#include "platform_state_sensor.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
#include "pldmd/handler.hpp"
#include "requester/handler.hpp"
diff --git a/oem/ibm/host-bmc/host_lamp_test.hpp b/oem/ibm/host-bmc/host_lamp_test.hpp
index f5b1294..4fff6c9 100644
--- a/oem/ibm/host-bmc/host_lamp_test.hpp
+++ b/oem/ibm/host-bmc/host_lamp_test.hpp
@@ -1,7 +1,6 @@
#pragma once
#include "pldmd/dbus_impl_pdr.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
#include "requester/handler.hpp"
#include <sdbusplus/server/object.hpp>
diff --git a/oem/ibm/test/host_bmc_lamp_test.cpp b/oem/ibm/test/host_bmc_lamp_test.cpp
index 15c62c0..cfd3a43 100644
--- a/oem/ibm/test/host_bmc_lamp_test.cpp
+++ b/oem/ibm/test/host_bmc_lamp_test.cpp
@@ -1,5 +1,4 @@
#include "oem/ibm/host-bmc/host_lamp_test.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
#include "test/test_instance_id.hpp"
#include <cstring>
diff --git a/platform-mc/event_manager.hpp b/platform-mc/event_manager.hpp
index b1461d7..083725d 100644
--- a/platform-mc/event_manager.hpp
+++ b/platform-mc/event_manager.hpp
@@ -2,7 +2,6 @@
#include "common/types.hpp"
#include "numeric_sensor.hpp"
-#include "pldmd/dbus_impl_requester.hpp"
#include "requester/handler.hpp"
#include "terminus.hpp"
#include "terminus_manager.hpp"
diff --git a/pldmd/dbus_impl_requester.hpp b/pldmd/dbus_impl_requester.hpp
deleted file mode 100644
index 1f1cc96..0000000
--- a/pldmd/dbus_impl_requester.hpp
+++ /dev/null
@@ -1,87 +0,0 @@
-#pragma once
-
-#include "common/instance_id.hpp"
-#include "xyz/openbmc_project/Common/error.hpp"
-#include "xyz/openbmc_project/PLDM/Requester/server.hpp"
-
-#include <sdbusplus/bus.hpp>
-#include <sdbusplus/server/object.hpp>
-
-#include <map>
-
-namespace pldm
-{
-namespace dbus_api
-{
-
-using RequesterIntf = sdbusplus::server::object_t<
- sdbusplus::xyz::openbmc_project::PLDM::server::Requester>;
-
-/** @class Requester
- * @brief OpenBMC PLDM.Requester implementation.
- * @details A concrete implementation for the
- * xyz.openbmc_project.PLDM.Requester DBus APIs.
- */
-class Requester : public RequesterIntf
-{
- public:
- Requester() = delete;
- Requester(const Requester&) = delete;
- Requester& operator=(const Requester&) = delete;
- Requester(Requester&&) = delete;
- Requester& operator=(Requester&&) = delete;
- virtual ~Requester() = default;
-
- /** @brief Constructor to put object onto bus at a dbus path.
- * @param[in] bus - Bus to attach to.
- * @param[in] path - Path to attach at.
- * @param[in] db - The database to use for allocating instance IDs
- * @note will throw TooManyResources() if there were no free instance IDs
- * Throws std::system_category().default_error_condition if there is
- * something wrong with the instance ID database.
- */
- Requester(sdbusplus::bus_t& bus, const std::string& path,
- InstanceIdDb& db) :
- RequesterIntf(bus, path.c_str()), pldmInstanceIdDb(db) {};
-
- /** @brief Implementation for RequesterIntf.GetInstanceId */
- uint8_t getInstanceId(uint8_t eid) override
- {
- int id;
-
- // Ideally we would be able to look up the TID for a given EID. We don't
- // have that infrastructure in place yet. So use the EID value for the
- // TID. This is an interim step towards the PLDM requester logic moving
- // into libpldm, and eventually this won't be needed.
- try
- {
- id = pldmInstanceIdDb.next(eid);
- }
- catch (const std::runtime_error& e)
- {
- throw sdbusplus::xyz::openbmc_project::Common::Error::
- TooManyResources();
- }
-
- return id;
- }
-
- /** @brief Mark an instance id as unused
- * @param[in] eid - MCTP eid to which this instance id belongs
- * @param[in] instanceId - PLDM instance id to be freed
- * @note will throw std::runtime_error if the instance ID was not
- * previously allocated.
- * Throws std::system_category().default_error_condition if there is
- * something wrong with the instance ID database.
- */
- void markFree(uint8_t eid, uint8_t instanceId)
- {
- pldmInstanceIdDb.free(eid, instanceId);
- }
-
- private:
- InstanceIdDb& pldmInstanceIdDb;
-};
-
-} // namespace dbus_api
-} // namespace pldm
diff --git a/pldmd/oem_ibm.hpp b/pldmd/oem_ibm.hpp
index 6003125..3f5802b 100644
--- a/pldmd/oem_ibm.hpp
+++ b/pldmd/oem_ibm.hpp
@@ -6,7 +6,6 @@
#include "../oem/ibm/libpldmresponder/oem_ibm_handler.hpp"
#include "../oem/ibm/libpldmresponder/utils.hpp"
#include "common/utils.hpp"
-#include "dbus_impl_requester.hpp"
#include "host-bmc/dbus_to_event_handler.hpp"
#include "invoker.hpp"
#include "libpldmresponder/base.hpp"
diff --git a/pldmd/pldmd.cpp b/pldmd/pldmd.cpp
index bbee013..65a5917 100644
--- a/pldmd/pldmd.cpp
+++ b/pldmd/pldmd.cpp
@@ -3,7 +3,6 @@
#include "common/instance_id.hpp"
#include "common/transport.hpp"
#include "common/utils.hpp"
-#include "dbus_impl_requester.hpp"
#include "fw-update/manager.hpp"
#include "invoker.hpp"
#include "platform-mc/dbus_to_terminus_effecters.hpp"
@@ -204,8 +203,6 @@
bus, "/xyz/openbmc_project/sensors");
InstanceIdDb instanceIdDb;
- dbus_api::Requester dbusImplReq(bus, "/xyz/openbmc_project/pldm",
- instanceIdDb);
sdbusplus::server::manager_t inventoryManager(
bus, "/xyz/openbmc_project/inventory");