-
Notifications
You must be signed in to change notification settings - Fork 13
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
Move to libpldm APIs for Allocating Instance IDs and change Transport APIs #213
base: 1110
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
eb2049a
to
e580391
Compare
I created one commit for both instance ID API and transport API changes. |
Journalctl out: |
… APIs Replace the current APIs with libpldm APIs for allocating instance IDs directly. This eliminates the need for remote D-Bus calls to the pldm daemon. Replace pldm transport APIs with libpldm pldm_transport APIs. This change migrates the application off the deprecated "requester" APIs in libpldm. Since we currently lack the infrastructure to obtain the correct TIDs, use the EID as the TID in the EID-to-TID mapping to maintain the current functionality. Change-Id: I5854aa022582ceae6a1843983fc90181b7e6d55f Signed-off-by: Lakshmi Yadlapati <[email protected]>
-Added support for kernel MCTP (AF_MCTP) to enable MCTP communication using AF_MCTP sockets. - Introduced a new configuration option 'transport-implementation' The 'transport-implementation' option can be set to either: - 'mctp-demux': Uses the existing mctp-demux transport method. - 'af-mctp': Uses the new kernel AF_MCTP transport method. Change-Id: I6b6b4d85bfec4b6efa630448f0c51b71b1150efa Signed-off-by: Lakshmi Yadlapati <[email protected]>
@@ -43,6 +60,19 @@ class PldmFramework | |||
/** Host mctp eid */ | |||
static constexpr auto mctpEid = (types::Byte)9; | |||
|
|||
/** @brief Hardcoded TID */ | |||
using TerminusID = uint8_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this to types.hpp
*/ | ||
int openPldm(); | ||
|
||
/** @brief Opens the MCTP socket for sending and receiving messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format: Move this to next line please.
@@ -1,3 +1,4 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove extra line.
method.append(mctpEid); | ||
auto reply = bus.call(method); | ||
reply.read(instanceId); | ||
std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a comment about why this 100ms sleep is required? And how did we reach to this number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not understand from the commit message why this change was required.
Could you please add that to the commit message so that I can get some context w.r.t. the changes.
@@ -1,2 +1,8 @@ | |||
option('tests', type: 'feature', value: 'enabled', description: 'Build tests.',) | |||
option('system-vpd-dependency', type: 'feature', description: 'Enable/disable system vpd dependency.', value: 'disabled') | |||
option( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, which one needs to be used and based on what criteria is it decided?
@@ -135,6 +142,11 @@ class PldmFramework | |||
*/ | |||
int openMctpDemuxTransport(); | |||
|
|||
/** @brief Opens the MCTP AF_MCTP for sending and receiving messages. | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is AF_MCTP? what it does? and why it is required here?
can you please add those details in doxygen.
@@ -34,6 +34,12 @@ systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir') | |||
|
|||
service_file = 'service_files/com.ibm.panel.service' | |||
|
|||
if(get_option('transport-implementation')) == 'mctp-demux' | |||
add_project_arguments('-DPLDM_TRANSPORT_WITH_MCTP_DEMUX', language : 'cpp') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add a comment here on what does the options DPLDM_TRANSPORT_WITH_MCTP_DEMUX and DPLDM_TRANSPORT_WITH_AF_MCTP do?
@@ -72,9 +81,10 @@ int PldmFramework::openPldm() | |||
return fd; | |||
} | |||
|
|||
int PldmFramework::openMctpDemuxTransport() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have created the line 75 in your first commit and edited it in second commit(in the same PR). can you please check if these changes between two commits are required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that there is a lot of if...else , which I am not a fan of , why do we need two types of mctp in this repo?
All I do have concerns on the exception handling , as it is not per pour coding standards.
Could you retry this code.
Replace the current APIs with libpldm APIs for allocating instance IDs directly. This eliminates the need for remote D-Bus calls to the pldm daemon.
Replace pldm transport APIs with libpldm pldm_transport APIs. This change migrates the application off the deprecated "requester" APIs in libpldm. Since we currently lack the infrastructure to obtain the correct TIDs, use the EID as the TID in the EID-to-TID mapping to maintain the current functionality.
Change-Id: I5854aa022582ceae6a1843983fc90181b7e6d55f