public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH edk2-platforms v3 00/16] MTCP-over-KCS support
@ 2023-10-23 13:04 Konstantin Aladyshev
  2023-10-23 13:04 ` [edk2-devel] [PATCH edk2-platforms v3 01/16] ManageabilityPkg: Add definition for the MCTP KCS TRAILER structure Konstantin Aladyshev
                   ` (16 more replies)
  0 siblings, 17 replies; 25+ messages in thread
From: Konstantin Aladyshev @ 2023-10-23 13:04 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, AbdulLateef.Attar, nicklew, Konstantin Aladyshev

The Manageability KCS transport library needs to support requests both
from MCTP and IPMI transports. Currently the code only handles IPMI
case correctly.
In the MCTP case the communication should be based on the MCTP-over-KCS
specification (DSP0254). This specification defines a special KCS
binding header and trailer structures that need to be present in every
MCTP message.
The header structure contains a length field, therefore response packet
size is not needed to be known beforehand.
The trailer structure contains a PEC checksum that can be used to check
itegrity of the response message.
Modify Manageability KCS transport library code to check which message
is processed (IPMI or MCTP) and handle each case correctly based on its
own specification.
This patch is a result of a joint effort from the Konstantin Aladyshev
<aladyshev22@gmail.com> and Abner Chang <abner.chang@amd.com>.

Tested:
PLDM communication between the HOST and BMC was tested with both
components implemented via open-source software:
- The HOST (UEFI firmware) part was based one the edk2 [1] and
edk2-platforms [2] code,
- The BMC part was based on the openbmc [3] distribution.

The testing process and all the necessary utilities are described in
the [4] repository.

The provided changes keep IPMI over KCS stack working as reported by
Abner Chang.

[1]: https://github.com/tianocore/edk2
[2]: https://github.com/tianocore/edk2-platforms
[3]: https://github.com/openbmc/openbmc
[4]: https://github.com/Kostr/PLDM

Changes v2 -> v3:
 - Add new patch that adds PLDM completion code check

Changes v1 -> v2:
 - Add new patches with corrections for the PLDM protocol. The
  resulting communication via EDKII_PLDM_PROTOCOL was successfully
  tested.

Abner Chang (4):
  ManageabilityPkg: Add PLDM terminus PCDs
  PldmProtocolDxe: Correct TID argument usage
  ManageabilityPkg/PldmProtocol: Remove PLDM command table
  PldmSmbiosTransferDxe: Implement Set PLDM terminus ID API

Konstantin Aladyshev (12):
  ManageabilityPkg: Add definition for the MCTP KCS TRAILER structure
  ManageabilityPkg: Check MCTP EIDs for reserved values
  ManageabilityPkg: Support both MCTP and IPMI in KCS tranport library
  ManageabilityPkg: Check header fields in the MCTP response
  ManageabilityPkg: Correct typo in MCTP destination EID field
  ManageabilityPkg: Update the algorithm of using MCTP endpoint ID PCD
  ManageabilityPkg: Correct value for the MCTP TAG_OWNER response bit
  ManageabilityPkg: Don't check MCTP header fields if transfer has
    failed
  ManageabilityPkg: Use correct constants for PLDM header checks
  ManageabilityPkg: Return error on multiple-packet MCTP responses
  ManageabilityPkg: Return error on PLDM header check fails
  ManageabilityPkg: Check PLDM completion code

 .../Include/Library/BasePldmProtocolLib.h     |  16 +
 .../Library/ManageabilityTransportMctpLib.h   |   9 +-
 .../Include/Protocol/MctpProtocol.h           |  12 +-
 .../Include/Protocol/PldmProtocol.h           |  18 +-
 .../Protocol/PldmSmbiosTransferProtocol.h     |  26 ++
 .../Common/KcsCommon.c                        | 284 +++++++++++++++---
 .../Dxe/ManageabilityTransportMctp.c          |   4 +-
 .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c |  49 ++-
 .../Dxe/PldmProtocolLib.inf                   |   6 +-
 .../ManageabilityPkg/ManageabilityPkg.dec     |   6 +
 .../MctpProtocol/Common/MctpProtocolCommon.c  | 129 +++++++-
 .../Universal/MctpProtocol/Dxe/MctpProtocol.c |  51 +++-
 .../PldmProtocol/Common/PldmProtocolCommon.c  | 148 +++------
 .../PldmProtocol/Common/PldmProtocolCommon.h  |  25 +-
 .../Universal/PldmProtocol/Dxe/PldmProtocol.c |  69 ++++-
 .../PldmProtocol/Dxe/PldmProtocolDxe.inf      |   4 -
 .../PldmSmbiosTransferDxe.c                   |  28 ++
 17 files changed, 690 insertions(+), 194 deletions(-)

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109908): https://edk2.groups.io/g/devel/message/109908
Mute This Topic: https://groups.io/mt/102134646/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-11-01  5:53 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 13:04 [edk2-devel] [PATCH edk2-platforms v3 00/16] MTCP-over-KCS support Konstantin Aladyshev
2023-10-23 13:04 ` [edk2-devel] [PATCH edk2-platforms v3 01/16] ManageabilityPkg: Add definition for the MCTP KCS TRAILER structure Konstantin Aladyshev
2023-10-25  8:55   ` Attar, AbdulLateef (Abdul Lateef) via groups.io
2023-10-23 13:04 ` [edk2-devel] [PATCH edk2-platforms v3 02/16] ManageabilityPkg: Check MCTP EIDs for reserved values Konstantin Aladyshev
2023-10-25  8:57   ` Attar, AbdulLateef (Abdul Lateef) via groups.io
2023-10-23 13:04 ` [edk2-devel] [PATCH edk2-platforms v3 03/16] ManageabilityPkg: Support both MCTP and IPMI in KCS tranport library Konstantin Aladyshev
2023-10-23 13:04 ` [edk2-devel] [PATCH edk2-platforms v3 04/16] ManageabilityPkg: Check header fields in the MCTP response Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 05/16] ManageabilityPkg: Correct typo in MCTP destination EID field Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 06/16] ManageabilityPkg: Update the algorithm of using MCTP endpoint ID PCD Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 07/16] ManageabilityPkg: Correct value for the MCTP TAG_OWNER response bit Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 08/16] ManageabilityPkg: Don't check MCTP header fields if transfer has failed Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 09/16] ManageabilityPkg: Use correct constants for PLDM header checks Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 10/16] ManageabilityPkg: Return error on multiple-packet MCTP responses Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 11/16] ManageabilityPkg: Add PLDM terminus PCDs Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 12/16] PldmProtocolDxe: Correct TID argument usage Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 13/16] ManageabilityPkg/PldmProtocol: Remove PLDM command table Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 14/16] ManageabilityPkg: Return error on PLDM header check fails Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 15/16] PldmSmbiosTransferDxe: Implement Set PLDM terminus ID API Konstantin Aladyshev
2023-10-23 13:05 ` [edk2-devel] [PATCH edk2-platforms v3 16/16] ManageabilityPkg: Check PLDM completion code Konstantin Aladyshev
2023-10-24  2:44 ` [edk2-devel] [PATCH edk2-platforms v3 00/16] MTCP-over-KCS support Chang, Abner via groups.io
2023-10-26  5:03   ` Chang, Abner via groups.io
2023-10-31  6:37     ` Yoshinoya
2023-10-31  7:00       ` Chang, Abner via groups.io
2023-11-01  5:19         ` Yoshinoya
2023-11-01  5:53           ` Chang, Abner via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox