Skip to content

Commit 0a36b15

Browse files
manojkiranedarfrandse
authored andcommitted
Fix for discovering the HostState
- 20aa3e0 commit moved the setHostFirmwarecondition() function call prior to the code that connects to the mctp socket. - That led us to fail in sending the message with ENOTCONN Errno, as demonstrated by the below strace log. ------ 23:16:50.596833 connect(3, {sa_family=AF_UNIX, sun_path=@"mctp-mux"}, 11) = 0 Change-Id: Icd3a20e4bb0218517d44d14a57c0407c7b7702e2 --- 23:16:50.593800 sendmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\t\1", iov_len=2}, {iov_base="\200\0\3\0\0\0\0\1\0", iov_len=9}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, 0) = -1 ENOTCONN ----- - Without this change , we would get ENOTCONN(107 errono) for the getPLDMVersion command that pldm sends at the begining to discover the host state. TestedBy: 1. when host is off : Response not received for the request, instance ID expired. EID = 9 INSTANCE_ID = 0 TYPE = 0 COMMAND = 3 Failed to receive response for getPLDMVersion command, Host seems to be off 2. when host is Running : Sending Msg 80 00 03 00 00 00 00 01 00 Received Msg 09 01 00 00 03 00 00 00 00 00 05 f1 f1 f0 00 Getting the response. PLDM RC = 0 Signed-off-by: Manojkiran Eda <[email protected]> Change-Id: I5c7c3bc92c8654016db90855de49b7c30f161275
1 parent 649d10c commit 0a36b15

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pldmd/pldmd.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,6 @@ int main(int argc, char** argv)
268268
sdbusplus::xyz::openbmc_project::PLDM::server::Event dbusImplEvent(
269269
bus, "/xyz/openbmc_project/pldm");
270270

271-
if (hostPDRHandler)
272-
{
273-
hostPDRHandler->setHostFirmwareCondition();
274-
}
275271
#endif
276272

277273
pldm::utils::CustomFD socketFd(sockfd);
@@ -397,7 +393,12 @@ int main(int argc, char** argv)
397393
bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
398394
bus.request_name("xyz.openbmc_project.PLDM");
399395
IO io(event, socketFd(), EPOLLIN, std::move(callback));
400-
396+
#ifdef LIBPLDMRESPONDER
397+
if (hostPDRHandler)
398+
{
399+
hostPDRHandler->setHostFirmwareCondition();
400+
}
401+
#endif
401402
stdplus::signal::block(SIGUSR1);
402403
Signal(event, SIGUSR1, interruptFlightRecorderCallBack).set_floating(true);
403404
event.loop();

0 commit comments

Comments
 (0)