From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id DACFFAC116C for ; Fri, 20 Oct 2023 12:53:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=WAb1ABWbkkHiptT1Xs3wmyyFfoDGuqlrInKFrBKb3IQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1697806390; v=1; b=T3+Ot2SNfQR6wde2ATv8JAeatOOFnuAz4UBvYJ3l+Gw0tdD/XdTjDMmfktkNQDSww3RSbAAC XyIZEx94ujhKcKIC2mgBockg78VmCmBTvBmrMlI6Ecp34oLEJ/bEBIPJX/Wtt7QqMOhTyfSDUSg N50rXAkMvc5+Da51+Q7s/i4o= X-Received: by 127.0.0.2 with SMTP id iVO1YY7687511xCfTTVXl8UL; Fri, 20 Oct 2023 05:53:10 -0700 X-Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mx.groups.io with SMTP id smtpd.web10.53372.1697806389402420646 for ; Fri, 20 Oct 2023 05:53:09 -0700 X-Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2c50fbc218bso11064271fa.3 for ; Fri, 20 Oct 2023 05:53:09 -0700 (PDT) X-Gm-Message-State: YLoYDZMn8cYuT1jIuYzBCJsEx7686176AA= X-Google-Smtp-Source: AGHT+IGHfFye1ThkN3au+5pjNQ+aT2Z9Qm0yEIfOX1//kGfoY4jLpGE8gRgdvN5Sy23Fipg1Z2JTRA== X-Received: by 2002:a2e:2e06:0:b0:2be:54b4:ff87 with SMTP id u6-20020a2e2e06000000b002be54b4ff87mr1286022lju.40.1697806386861; Fri, 20 Oct 2023 05:53:06 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id x22-20020a05651c105600b002b9e5fe86dasm350853ljm.81.2023.10.20.05.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 05:53:06 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: abner.chang@amd.com, isaac.w.oram@intel.com, AbdulLateef.Attar@amd.com, nicklew@nvidia.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH edk2-platforms v2 00/15] MTCP-over-KCS support Date: Fri, 20 Oct 2023 15:52:47 +0300 Message-Id: <20231020125302.1459-1-aladyshev22@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,aladyshev22@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=T3+Ot2SN; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 and Abner Chang . 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 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 (11): 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 .../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 | 145 +++------ .../PldmProtocol/Common/PldmProtocolCommon.h | 25 +- .../Universal/PldmProtocol/Dxe/PldmProtocol.c | 69 ++++- .../PldmProtocol/Dxe/PldmProtocolDxe.inf | 4 - .../PldmSmbiosTransferDxe.c | 28 ++ 17 files changed, 688 insertions(+), 193 deletions(-) -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109850): https://edk2.groups.io/g/devel/message/109850 Mute This Topic: https://groups.io/mt/102080227/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-