Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for asynchronous file transfer #404

Open
wants to merge 19 commits into
base: 1060
Choose a base branch
from

Conversation

Patel-Kamalkumar
Copy link
Contributor

@Patel-Kamalkumar Patel-Kamalkumar commented May 9, 2023

Adding support for asynchronous file transfer

  • File transfer between BMC and Host is synchronous mechanism.
  • File transfer interrupted because of many reasons, so if
    file transfer interrupted between BMC and Host then PLDM is
    ending up in the hung state and not able to respond to the
    upcoming new requests. User has to do work around to restart
    the PLDM to get work again.
  • I have added asynchronous file transfer support using
    eventloop mechanism and non-blocking socket communication,
    so file transfer will be taken care by event loop and PLDM
    is free to receive another request from the Host.
  • If file transfer will be stuck or interrupted during
    asynchronous transfer then time-out occurs and file transfer
    will be aborted and same
    status communicated to the Host.

Adding support for Nonblocking socket so, pldm will not blocked during
data transfer between host and BMC. in previous case pldm was blocked
if DMA transfer blocked in middle of operation.

Signed-off-by: Kamalkumar Patel <[email protected]>
oem/ibm/libpldmresponder/file_io.cpp Outdated Show resolved Hide resolved
pldmd/pldmd.cpp Outdated Show resolved Hide resolved
pldmd/PldmRespInterface.hpp Outdated Show resolved Hide resolved
pldmd/PldmRespInterface.hpp Outdated Show resolved Hide resolved
pldmd/PldmRespInterface.hpp Outdated Show resolved Hide resolved
pldmd/PldmRespInterface.hpp Outdated Show resolved Hide resolved
pldmd/pldmd.cpp Show resolved Hide resolved
oem/ibm/libpldmresponder/utils.cpp Outdated Show resolved Hide resolved
oem/ibm/libpldmresponder/file_io.hpp Show resolved Hide resolved
oem/ibm/libpldmresponder/file_io.hpp Outdated Show resolved Hide resolved
oem/ibm/libpldmresponder/file_io_by_type.cpp Outdated Show resolved Hide resolved
oem/ibm/libpldmresponder/file_io_by_type.cpp Outdated Show resolved Hide resolved
oem/ibm/libpldmresponder/file_io_by_type.cpp Outdated Show resolved Hide resolved
- File transfer between BMC and Host is synchronous mechanism.
- File transfer interrupted because of many reasons, so if
file transfer interrupted between BMC and Host then PLDM is
ending up in the hung state and not able to respond to the
upcoming new requests. User has to do work around to restart
the PLDM to get work again.
- I have added asynchronous file transfer support using
eventloop mechanism and non-blocking socket communication,
so file transfer will be taken care by event loop and PLDM
is free to receive another request from the Host.
- If file transfer will be stuck or interrupted during
asynchronous transfer then time-out occurs and file transfer
will be aborted and same
status communicated to the Host.
try
{
handler = getHandlerByType(fileType, fileHandle);
handler = getSharedHandlerByType(fileType, fileHandle);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using shared pointer? Once the file handler is created, we are supposed to save it and resuse it.
Can we use same gethandlerByType function to return unique pointer and then move the pointer to functionPtr?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we call any function of read/write for DMA transfer then first time it's create event loop and return from that function and delete unique_ptr because of limited scope. we can't move unique_ptr inside event loop because it's delete any point of time and we don't know, and while creating even loop need to pass function pointer which will be called after file transfer completed and do post operation. so as per our requirement shared_ptr is best to use.

Patel-Kamalkumar and others added 6 commits August 1, 2023 00:41
Commit the marker lid validate errors for the
min-mif level and access key expiration so that
it generates an SRC when we hit the error during
code update.

Signed-off-by: Sagar Srinivas <[email protected]>
This commit adds change to move the fetching of activation
property inside the inband code update path. As it is a no-op
for out of band updates.

Signed-off-by: Sagar Srinivas <[email protected]>
The ibm,rainier1s-4u json had missing nvme slots and were
not modelled by PLDM. This commit adds the same.

Fixes: 561341

Change-Id: I0559f1761a6ec223fa62aa14c283885d3aa37e49

Signed-off-by: Pavithra Barithaya <[email protected]>
This commit adds 5 second dbus timeout value to dbus
calls with no reply. Previously a commit was merged that
included 5 seconds dbus timeout value for all dbus call
with reply.

This is added to make sure PLDM does not wait for more
than 5 seconds when a dbus call is made with or without
reply if no response is received from other daemon or host.

The 5 second timeout value is overridden to 10 seconds in
meta-ibm layer.

Signed-off-by: [email protected] <[email protected]>
spinler and others added 2 commits September 15, 2023 11:24
When IBM's hypervisor receives an event log (PEL) using the file API, it
may end up discarding it, returning the reason the file was discarded in
the status argument of the file ack command.  It can do this for two
reasons, either it doesn't have any more room to store event logs, or
the event log was malformed.

In these cases, call the HostReject D-Bus method on the PEL daemon so it
can handle it. The code must convert the value of the status returned
into the proper D-Bus enum value.

Without this call, the operating system was missing event logs when
there were floods of them.

Tested:
API was called when system was flooded with event logs, allowing the PEL
daemon to resend them as space opens up.

Change-Id: I9d3acf4e5c5f885934ef96e89ddb93dd8f9c10a3

Signed-off-by: Matt Spinler <[email protected]>
As part of adding new features there were
traces that are still using standard ostream
pattern of logging. As PLDM repository migrated
to structured logging hence migrating the new
log traces to follow the same practice.

Additionally minor refinement of traces is also
handled as a part of this commit, listed below -

1. Correction in type of log (ex- error or info)
2. Correction in spelling of log message
3. Removing logs from test file.

Signed-off-by: Riya Dixit <[email protected]>
- File transfer between BMC and Host is synchronous mechanism.
- File transfer interrupted because of many reasons, so if
file transfer interrupted between BMC and Host then PLDM is
ending up in the hung state and not able to respond to the
upcoming new requests. User has to do work around to restart
the PLDM to get work again.
- I have added asynchronous file transfer support using
eventloop mechanism and non-blocking socket communication,
so file transfer will be taken care by event loop and PLDM
is free to receive another request from the Host.
- If file transfer will be stuck or interrupted during
asynchronous transfer then time-out occurs and file transfer
will be aborted and same status communicated to the Host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants