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 64D40941CAF for ; Mon, 23 Oct 2023 13:05:20 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=MAocjt1wHfvjwtKT068EW0qfTPyj9a3H8XfwDVG8gUI=; 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=1698066319; v=1; b=SPZDcSf/gRHsMEmHZPmAgPWEIHOc+Rsv8WtHLZh8N+1Ezbckyqx38GPIGm8GBfOAPMAt89ag pY6He/ExOYKsk9wZDnIQGlNMcw+BPvW4eWqqErxj2LqjMBb2Z+D7GubVGjakkW2xnMKXjgWxgdJ EMBCDTh9BLBGkWT0PcMdtdjc= X-Received: by 127.0.0.2 with SMTP id 2DjCYY7687511xEd59aoBEsZ; Mon, 23 Oct 2023 06:05:19 -0700 X-Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by mx.groups.io with SMTP id smtpd.web10.119839.1698066318172698831 for ; Mon, 23 Oct 2023 06:05:18 -0700 X-Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2c50ec238aeso46698831fa.0 for ; Mon, 23 Oct 2023 06:05:17 -0700 (PDT) X-Gm-Message-State: 2WDFwsMtuu7MtJyDV3ByyiDwx7686176AA= X-Google-Smtp-Source: AGHT+IGIfE0Rm5zwJCncl6JaVSEtr//cwCVqNQrR5LA6dsV0Bq/I/bSqEZ8CS+GJVLrQ7drFQWRZQA== X-Received: by 2002:a05:651c:11d3:b0:2c5:16c0:623b with SMTP id z19-20020a05651c11d300b002c516c0623bmr5556953ljo.34.1698066315779; Mon, 23 Oct 2023 06:05:15 -0700 (PDT) X-Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id r11-20020a2e994b000000b002b9e0d19644sm1550081ljj.106.2023.10.23.06.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 06:05:15 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: abner.chang@amd.com, AbdulLateef.Attar@amd.com, nicklew@nvidia.com, Konstantin Aladyshev Subject: [edk2-devel] [PATCH edk2-platforms v3 00/16] MTCP-over-KCS support Date: Mon, 23 Oct 2023 16:04:55 +0300 Message-Id: <20231023130511.4521-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="SPZDcSf/"; 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 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] -=-=-=-=-=-=-=-=-=-=-=-