blob: 1a5911bf861643d37a271fe74b03f9797e239db9 [file] [log] [blame]
Chicago Duan184f6022020-04-17 11:30:49 +08001#include "softoff.hpp"
2
Dung Cao3d03f3f2023-09-07 06:51:33 +00003#include "common/instance_id.hpp"
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +10004#include "common/transport.hpp"
Chicago Duan184f6022020-04-17 11:30:49 +08005#include "common/utils.hpp"
6
George Liuc453e162022-12-21 17:16:23 +08007#include <libpldm/entity.h>
8#include <libpldm/platform.h>
George Liuc453e162022-12-21 17:16:23 +08009#include <libpldm/state_set.h>
10
Riya Dixit49cfb132023-03-02 04:26:53 -060011#include <phosphor-logging/lg2.hpp>
Chicago Duan184f6022020-04-17 11:30:49 +080012#include <sdbusplus/bus.hpp>
13#include <sdeventplus/clock.hpp>
George Liua2767e62021-02-24 18:53:34 +080014#include <sdeventplus/exception.hpp>
Chicago Duan184f6022020-04-17 11:30:49 +080015#include <sdeventplus/source/io.hpp>
16#include <sdeventplus/source/time.hpp>
17
18#include <array>
Sagar Srinivas4d99c312024-03-28 06:50:13 -050019#include <filesystem>
20#include <fstream>
Chicago Duan184f6022020-04-17 11:30:49 +080021
Riya Dixit49cfb132023-03-02 04:26:53 -060022PHOSPHOR_LOG2_USING;
23
Chicago Duan184f6022020-04-17 11:30:49 +080024namespace pldm
25{
Chicago Duan184f6022020-04-17 11:30:49 +080026using namespace sdeventplus;
27using namespace sdeventplus::source;
Sagar Srinivas4d99c312024-03-28 06:50:13 -050028namespace fs = std::filesystem;
Chicago Duan184f6022020-04-17 11:30:49 +080029constexpr auto clockId = sdeventplus::ClockId::RealTime;
30using Clock = Clock<clockId>;
31using Timer = Time<clockId>;
32
Zach Clarke98c51b2021-06-08 11:29:06 -050033using sdbusplus::exception::SdBusError;
34
35// Shutdown effecter terminus ID, set when we look up the effecter
36pldm::pdr::TerminusID TID = 0;
37
Chicago Duan184f6022020-04-17 11:30:49 +080038namespace sdbusRule = sdbusplus::bus::match::rules;
39
Manojkiran Eda3fcfaa12024-02-26 15:17:58 +053040SoftPowerOff::SoftPowerOff(sdbusplus::bus_t& bus, sd_event* event,
41 pldm::InstanceIdDb& instanceIdDb) :
Patrick Williams16c2a0a2024-08-16 15:20:59 -040042 bus(bus), timer(event), instanceIdDb(instanceIdDb)
Chicago Duan184f6022020-04-17 11:30:49 +080043{
Sagar Srinivas4d99c312024-03-28 06:50:13 -050044 auto jsonData = parseConfig();
45
46 if (jsonData.is_discarded())
47 {
Riya Dixit087a7512024-04-06 14:28:08 -050048 error("Failed to parse softoff config JSON file");
Sagar Srinivas4d99c312024-03-28 06:50:13 -050049 return;
50 }
51
Manojkiran Eda31a78442021-09-12 15:18:25 +053052 getHostState();
Chicago Duan184f6022020-04-17 11:30:49 +080053 if (hasError || completed)
54 {
55 return;
56 }
Sagar Srinivas4d99c312024-03-28 06:50:13 -050057 const std::vector<Json> emptyJsonList{};
58 auto entries = jsonData.value("entries", emptyJsonList);
59 for (const auto& entry : entries)
60 {
61 TID = entry.value("tid", 0);
62 pldm::pdr::EntityType entityType = entry.value("entityType", 0);
63 pldm::pdr::StateSetId stateSetId = entry.value("stateSetId", 0);
Chicago Duan184f6022020-04-17 11:30:49 +080064
Sagar Srinivas4d99c312024-03-28 06:50:13 -050065 bool effecterFound = getEffecterID(entityType, stateSetId);
66 if (effecterFound)
67 {
68 auto rc = getSensorInfo(entityType, stateSetId);
69 if (rc != PLDM_SUCCESS)
70 {
Riya Dixit087a7512024-04-06 14:28:08 -050071 error("Failed to get Sensor PDRs, response code '{RC}'", "RC",
Riya Dixit1e5c81e2024-05-03 07:54:00 -050072 lg2::hex, rc);
Sagar Srinivas4d99c312024-03-28 06:50:13 -050073 hasError = true;
74 return;
75 }
76 break;
77 }
78 else
79 {
80 continue;
81 }
Chicago Duan184f6022020-04-17 11:30:49 +080082 }
83
84 // Matches on the pldm StateSensorEvent signal
85 pldmEventSignal = std::make_unique<sdbusplus::bus::match_t>(
86 bus,
87 sdbusRule::type::signal() + sdbusRule::member("StateSensorEvent") +
88 sdbusRule::path("/xyz/openbmc_project/pldm") +
89 sdbusRule::interface("xyz.openbmc_project.PLDM.Event"),
90 std::bind(std::mem_fn(&SoftPowerOff::hostSoftOffComplete), this,
91 std::placeholders::_1));
92}
93
94int SoftPowerOff::getHostState()
95{
96 try
97 {
98 pldm::utils::PropertyValue propertyValue =
99 pldm::utils::DBusHandler().getDbusPropertyVariant(
100 "/xyz/openbmc_project/state/host0", "CurrentHostState",
101 "xyz.openbmc_project.State.Host");
102
Andrew Geissler5b5fa432021-01-22 16:27:24 -0600103 if ((std::get<std::string>(propertyValue) !=
104 "xyz.openbmc_project.State.Host.HostState.Running") &&
105 (std::get<std::string>(propertyValue) !=
106 "xyz.openbmc_project.State.Host.HostState.TransitioningToOff"))
Chicago Duan184f6022020-04-17 11:30:49 +0800107 {
108 // Host state is not "Running", this app should return success
109 completed = true;
110 return PLDM_SUCCESS;
111 }
112 }
113 catch (const std::exception& e)
114 {
Riya Dixit087a7512024-04-06 14:28:08 -0500115 error(
116 "PLDM remote terminus soft off. Can't get current remote terminus state, error - {ERROR}",
117 "ERROR", e);
Chicago Duan184f6022020-04-17 11:30:49 +0800118 hasError = true;
119 return PLDM_ERROR;
120 }
121
122 return PLDM_SUCCESS;
123}
124
Patrick Williams84b790c2022-07-22 19:26:56 -0500125void SoftPowerOff::hostSoftOffComplete(sdbusplus::message_t& msg)
Chicago Duan184f6022020-04-17 11:30:49 +0800126{
127 pldm::pdr::TerminusID msgTID;
128 pldm::pdr::SensorID msgSensorID;
129 pldm::pdr::SensorOffset msgSensorOffset;
130 pldm::pdr::EventState msgEventState;
131 pldm::pdr::EventState msgPreviousEventState;
132
133 // Read the msg and populate each variable
134 msg.read(msgTID, msgSensorID, msgSensorOffset, msgEventState,
135 msgPreviousEventState);
136
137 if (msgSensorID == sensorID && msgSensorOffset == sensorOffset &&
Zach Clarke98c51b2021-06-08 11:29:06 -0500138 msgEventState == PLDM_SW_TERM_GRACEFUL_SHUTDOWN && msgTID == TID)
Chicago Duan184f6022020-04-17 11:30:49 +0800139 {
140 // Receive Graceful shutdown completion event message. Disable the timer
141 auto rc = timer.stop();
142 if (rc < 0)
143 {
Riya Dixit087a7512024-04-06 14:28:08 -0500144 error(
145 "Failure to STOP the timer of PLDM soft off, response code '{RC}'",
146 "RC", rc);
Chicago Duan184f6022020-04-17 11:30:49 +0800147 }
148
149 // This marks the completion of pldm soft power off.
150 completed = true;
151 }
152}
153
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500154Json SoftPowerOff::parseConfig()
155{
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400156 fs::path softoffConfigJson(
157 fs::path(SOFTOFF_CONFIG_JSON) / "softoff_config.json");
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500158
159 if (!fs::exists(softoffConfigJson) || fs::is_empty(softoffConfigJson))
160 {
Riya Dixit087a7512024-04-06 14:28:08 -0500161 error(
162 "Failed to parse softoff config JSON file '{PATH}', file does not exist",
163 "PATH", softoffConfigJson);
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500164 return PLDM_ERROR;
165 }
166
167 std::ifstream jsonFile(softoffConfigJson);
168 return Json::parse(jsonFile);
169}
170
171bool SoftPowerOff::getEffecterID(pldm::pdr::EntityType& entityType,
172 pldm::pdr::StateSetId& stateSetId)
Chicago Duan184f6022020-04-17 11:30:49 +0800173{
174 auto& bus = pldm::utils::DBusHandler::getBus();
Chicago Duan184f6022020-04-17 11:30:49 +0800175 try
176 {
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500177 std::vector<std::vector<uint8_t>> response{};
178 auto method = bus.new_method_call(
Chicago Duan184f6022020-04-17 11:30:49 +0800179 "xyz.openbmc_project.PLDM", "/xyz/openbmc_project/pldm",
180 "xyz.openbmc_project.PLDM.PDR", "FindStateEffecterPDR");
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500181 method.append(TID, entityType, stateSetId);
182 auto responseMsg = bus.call(method, dbusTimeout);
Chicago Duan184f6022020-04-17 11:30:49 +0800183
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500184 responseMsg.read(response);
185 if (response.size())
Chicago Duan184f6022020-04-17 11:30:49 +0800186 {
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500187 for (auto& rep : response)
Chicago Duan184f6022020-04-17 11:30:49 +0800188 {
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500189 auto softoffPdr =
Chicago Duan184f6022020-04-17 11:30:49 +0800190 reinterpret_cast<pldm_state_effecter_pdr*>(rep.data());
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500191 effecterID = softoffPdr->effecter_id;
Chicago Duan184f6022020-04-17 11:30:49 +0800192 }
193 }
194 else
195 {
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500196 return false;
Chicago Duan184f6022020-04-17 11:30:49 +0800197 }
198 }
Patrick Williams84b790c2022-07-22 19:26:56 -0500199 catch (const sdbusplus::exception_t& e)
Chicago Duan184f6022020-04-17 11:30:49 +0800200 {
Riya Dixit087a7512024-04-06 14:28:08 -0500201 error("Failed to get softPowerOff PDR, error - {ERROR}", "ERROR", e);
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500202 return false;
Chicago Duan184f6022020-04-17 11:30:49 +0800203 }
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500204 return true;
Chicago Duan184f6022020-04-17 11:30:49 +0800205}
206
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500207int SoftPowerOff::getSensorInfo(pldm::pdr::EntityType& entityType,
208 pldm::pdr::StateSetId& stateSetId)
Chicago Duan184f6022020-04-17 11:30:49 +0800209{
Chicago Duan184f6022020-04-17 11:30:49 +0800210 try
211 {
212 auto& bus = pldm::utils::DBusHandler::getBus();
213 std::vector<std::vector<uint8_t>> Response{};
214 auto method = bus.new_method_call(
215 "xyz.openbmc_project.PLDM", "/xyz/openbmc_project/pldm",
216 "xyz.openbmc_project.PLDM.PDR", "FindStateSensorPDR");
Sagar Srinivas4d99c312024-03-28 06:50:13 -0500217 method.append(TID, entityType, stateSetId);
Chicago Duan184f6022020-04-17 11:30:49 +0800218
vkaverap@in.ibm.com91a092f2023-09-18 23:39:44 -0500219 auto ResponseMsg = bus.call(method, dbusTimeout);
Chicago Duan184f6022020-04-17 11:30:49 +0800220
221 ResponseMsg.read(Response);
222
223 if (Response.size() == 0)
224 {
Riya Dixit49cfb132023-03-02 04:26:53 -0600225 error("No sensor PDR has been found that matches the criteria");
Chicago Duan184f6022020-04-17 11:30:49 +0800226 return PLDM_ERROR;
227 }
228
ThuBaNguyen499a29d2023-05-30 06:32:06 +0700229 pldm_state_sensor_pdr* pdr = nullptr;
Chicago Duan184f6022020-04-17 11:30:49 +0800230 for (auto& rep : Response)
231 {
232 pdr = reinterpret_cast<pldm_state_sensor_pdr*>(rep.data());
Manojkiran Eda31a78442021-09-12 15:18:25 +0530233 if (!pdr)
234 {
Riya Dixit49cfb132023-03-02 04:26:53 -0600235 error("Failed to get state sensor PDR.");
Manojkiran Eda31a78442021-09-12 15:18:25 +0530236 return PLDM_ERROR;
237 }
Manojkiran Edabcf91ac2021-03-14 13:50:48 +0530238 }
239
Chicago Duan184f6022020-04-17 11:30:49 +0800240 sensorID = pdr->sensor_id;
241
242 auto compositeSensorCount = pdr->composite_sensor_count;
243 auto possibleStatesStart = pdr->possible_states;
244
245 for (auto offset = 0; offset < compositeSensorCount; offset++)
246 {
247 auto possibleStates =
248 reinterpret_cast<state_sensor_possible_states*>(
249 possibleStatesStart);
250 auto setId = possibleStates->state_set_id;
251 auto possibleStateSize = possibleStates->possible_states_size;
252
253 if (setId == PLDM_STATE_SET_SW_TERMINATION_STATUS)
254 {
255 sensorOffset = offset;
256 break;
257 }
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400258 possibleStatesStart +=
259 possibleStateSize + sizeof(setId) + sizeof(possibleStateSize);
Chicago Duan184f6022020-04-17 11:30:49 +0800260 }
261 }
Patrick Williams84b790c2022-07-22 19:26:56 -0500262 catch (const sdbusplus::exception_t& e)
Chicago Duan184f6022020-04-17 11:30:49 +0800263 {
Riya Dixit087a7512024-04-06 14:28:08 -0500264 error("Failed to get state sensor PDR during soft-off, error - {ERROR}",
265 "ERROR", e);
Chicago Duan184f6022020-04-17 11:30:49 +0800266 return PLDM_ERROR;
267 }
268
269 return PLDM_SUCCESS;
270}
271
272int SoftPowerOff::hostSoftOff(sdeventplus::Event& event)
273{
274 constexpr uint8_t effecterCount = 1;
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +1000275 PldmTransport pldmTransport{};
Chicago Duan184f6022020-04-17 11:30:49 +0800276 uint8_t instanceID;
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +1000277 uint8_t mctpEID;
Chicago Duan184f6022020-04-17 11:30:49 +0800278
279 mctpEID = pldm::utils::readHostEID();
Dung Cao3d03f3f2023-09-07 06:51:33 +0000280 // TODO: fix mapping to work around OpenBMC ecosystem deficiencies
281 pldm_tid_t pldmTID = static_cast<pldm_tid_t>(mctpEID);
Chicago Duan184f6022020-04-17 11:30:49 +0800282
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400283 std::array<uint8_t,
284 sizeof(pldm_msg_hdr) + sizeof(effecterID) +
285 sizeof(effecterCount) + sizeof(set_effecter_state_field)>
Chicago Duan184f6022020-04-17 11:30:49 +0800286 requestMsg{};
287 auto request = reinterpret_cast<pldm_msg*>(requestMsg.data());
288 set_effecter_state_field stateField{
289 PLDM_REQUEST_SET, PLDM_SW_TERM_GRACEFUL_SHUTDOWN_REQUESTED};
Dung Cao3d03f3f2023-09-07 06:51:33 +0000290 instanceID = instanceIdDb.next(pldmTID);
Chicago Duan184f6022020-04-17 11:30:49 +0800291 auto rc = encode_set_state_effecter_states_req(
292 instanceID, effecterID, effecterCount, &stateField, request);
293 if (rc != PLDM_SUCCESS)
294 {
Dung Cao3d03f3f2023-09-07 06:51:33 +0000295 instanceIdDb.free(pldmTID, instanceID);
Riya Dixit087a7512024-04-06 14:28:08 -0500296 error(
297 "Failed to encode set state effecter states request message, response code '{RC}'",
Riya Dixit1e5c81e2024-05-03 07:54:00 -0500298 "RC", lg2::hex, rc);
Chicago Duan184f6022020-04-17 11:30:49 +0800299 return PLDM_ERROR;
300 }
301
Chicago Duan184f6022020-04-17 11:30:49 +0800302 // Add a timer to the event loop, default 30s.
Patrick Williamsa6756622023-10-20 11:19:15 -0500303 auto timerCallback = [=, this](Timer& /*source*/,
304 Timer::TimePoint /*time*/) mutable {
Chicago Duan184f6022020-04-17 11:30:49 +0800305 if (!responseReceived)
306 {
Dung Cao3d03f3f2023-09-07 06:51:33 +0000307 instanceIdDb.free(pldmTID, instanceID);
Riya Dixit49cfb132023-03-02 04:26:53 -0600308 error(
Riya Dixit087a7512024-04-06 14:28:08 -0500309 "PLDM soft off failed, can't get the response for the PLDM request msg. Time out! Exit the pldm-softpoweroff");
Chicago Duan184f6022020-04-17 11:30:49 +0800310 exit(-1);
311 }
312 return;
313 };
314 Timer time(event, (Clock(event).now() + std::chrono::seconds{30}),
315 std::chrono::seconds{1}, std::move(timerCallback));
316
317 // Add a callback to handle EPOLLIN on fd
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400318 auto callback = [=, &pldmTransport,
319 this](IO& io, int fd, uint32_t revents) mutable {
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +1000320 if (fd != pldmTransport.getEventSource())
321 {
322 return;
323 }
324
Chicago Duan184f6022020-04-17 11:30:49 +0800325 if (!(revents & EPOLLIN))
326 {
327 return;
328 }
329
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +1000330 void* responseMsg = nullptr;
Chicago Duan184f6022020-04-17 11:30:49 +0800331 size_t responseMsgSize{};
Dung Cao3d03f3f2023-09-07 06:51:33 +0000332 pldm_tid_t srcTID = pldmTID;
Chicago Duan184f6022020-04-17 11:30:49 +0800333
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +1000334 auto rc = pldmTransport.recvMsg(pldmTID, responseMsg, responseMsgSize);
Chicago Duan184f6022020-04-17 11:30:49 +0800335 if (rc)
336 {
Riya Dixit087a7512024-04-06 14:28:08 -0500337 error(
338 "Failed to receive pldm data during soft-off, response code '{RC}'",
Riya Dixit1e5c81e2024-05-03 07:54:00 -0500339 "RC", rc);
Chicago Duan184f6022020-04-17 11:30:49 +0800340 return;
341 }
342
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400343 std::unique_ptr<void, decltype(std::free)*> responseMsgPtr{
344 responseMsg, std::free};
Chicago Duan184f6022020-04-17 11:30:49 +0800345
346 // We've got the response meant for the PLDM request msg that was
347 // sent out
348 io.set_enabled(Enabled::Off);
349 auto response = reinterpret_cast<pldm_msg*>(responseMsgPtr.get());
Dung Cao3d03f3f2023-09-07 06:51:33 +0000350
351 if (srcTID != pldmTID ||
352 !pldm_msg_hdr_correlate_response(&request->hdr, &response->hdr))
353 {
354 /* This isn't the response we were looking for */
355 return;
356 }
357
358 /* We have the right response, release the instance ID and process */
359 io.set_enabled(Enabled::Off);
360 instanceIdDb.free(pldmTID, instanceID);
361
George Liu9915d022021-12-21 14:04:31 +0800362 if (response->payload[0] != PLDM_SUCCESS)
363 {
Riya Dixit087a7512024-04-06 14:28:08 -0500364 error("Getting the wrong response, response code '{RC}'", "RC",
Riya Dixit1e5c81e2024-05-03 07:54:00 -0500365 response->payload[0]);
George Liu9915d022021-12-21 14:04:31 +0800366 exit(-1);
367 }
Chicago Duan184f6022020-04-17 11:30:49 +0800368
369 responseReceived = true;
370
371 // Start Timer
372 using namespace std::chrono;
373 auto timeMicroseconds =
374 duration_cast<microseconds>(seconds(SOFTOFF_TIMEOUT_SECONDS));
375
376 auto ret = startTimer(timeMicroseconds);
377 if (ret < 0)
378 {
Riya Dixit49cfb132023-03-02 04:26:53 -0600379 error(
Riya Dixit087a7512024-04-06 14:28:08 -0500380 "Failure to start remote terminus soft off wait timer, Exit the pldm-softpoweroff with response code:{NUM}",
381 "NUM", ret);
Chicago Duan184f6022020-04-17 11:30:49 +0800382 exit(-1);
383 }
384 else
385 {
Riya Dixit49cfb132023-03-02 04:26:53 -0600386 error(
Riya Dixit087a7512024-04-06 14:28:08 -0500387 "Timer started waiting for remote terminus soft off, timeout in sec '{TIMEOUT_SEC}'",
Riya Dixit49cfb132023-03-02 04:26:53 -0600388 "TIMEOUT_SEC", SOFTOFF_TIMEOUT_SECONDS);
Chicago Duan184f6022020-04-17 11:30:49 +0800389 }
390 return;
391 };
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +1000392 IO io(event, pldmTransport.getEventSource(), EPOLLIN, std::move(callback));
Chicago Duan184f6022020-04-17 11:30:49 +0800393
Rashmica Gupta1ed5f7a2023-05-22 13:56:42 +1000394 // Asynchronously send the PLDM request
395 rc = pldmTransport.sendMsg(pldmTID, requestMsg.data(), requestMsg.size());
Sampa Misra9f8d2b02021-03-24 08:33:14 +0000396 if (0 > rc)
Chicago Duan184f6022020-04-17 11:30:49 +0800397 {
Dung Cao3d03f3f2023-09-07 06:51:33 +0000398 instanceIdDb.free(pldmTID, instanceID);
Riya Dixit49cfb132023-03-02 04:26:53 -0600399 error(
Riya Dixit087a7512024-04-06 14:28:08 -0500400 "Failed to send message/receive response, response code '{RC}' and error - {ERROR}",
Riya Dixit1e5c81e2024-05-03 07:54:00 -0500401 "RC", rc, "ERROR", errno);
Chicago Duan184f6022020-04-17 11:30:49 +0800402 return PLDM_ERROR;
403 }
404
405 // Time out or soft off complete
406 while (!isCompleted() && !isTimerExpired())
407 {
408 try
409 {
410 event.run(std::nullopt);
411 }
412 catch (const sdeventplus::SdEventError& e)
413 {
Dung Cao3d03f3f2023-09-07 06:51:33 +0000414 instanceIdDb.free(pldmTID, instanceID);
Riya Dixit49cfb132023-03-02 04:26:53 -0600415 error(
Riya Dixit087a7512024-04-06 14:28:08 -0500416 "Failed to process request while remote terminus soft off, error - {ERROR}",
417 "ERROR", e);
Chicago Duan184f6022020-04-17 11:30:49 +0800418 return PLDM_ERROR;
419 }
420 }
421
422 return PLDM_SUCCESS;
423}
424
425int SoftPowerOff::startTimer(const std::chrono::microseconds& usec)
426{
427 return timer.start(usec);
428}
429} // namespace pldm