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 0A343941A31 for ; Thu, 31 Aug 2023 14:57:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=yDQeqGGA8WVC2aLyjJerQP4vLP7uN6Cvvrp67MBPABo=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1693493825; v=1; b=tSZyfXhq4191TV3RZiFjitFjrPs50F9jjic5yPJ/SD9RsF41dY7d6s5UjqjR1sGJZaONXEXG cZjhdp0dbtoZ+KNyx3gxckof23Ya5y6TSX+DcbvYSQkpvl0vy3xZ9168fzGRjiJ5kxftFSlop6B t7WVntY5jxz/n31X0K4wYzY8= X-Received: by 127.0.0.2 with SMTP id 6IBHYY7687511xHu3HR5Z0Xl; Thu, 31 Aug 2023 07:57:05 -0700 X-Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) by mx.groups.io with SMTP id smtpd.web10.19516.1693493824370283364 for ; Thu, 31 Aug 2023 07:57:04 -0700 X-Received: by mail-vk1-f182.google.com with SMTP id 71dfb90a1353d-48fde7dae7dso308319e0c.1; Thu, 31 Aug 2023 07:57:04 -0700 (PDT) X-Gm-Message-State: O6WjEHtq8nC4xzp399JxEHjwx7686176AA= X-Google-Smtp-Source: AGHT+IEtWgDFuo8wgHEGwgSuVFbxXrSNvjRuYGIXckE558azv9TBRwfhHocBX/d5q27TFwuqspcrtnI/Mgce3DxtsB0= X-Received: by 2002:a1f:c581:0:b0:48d:13e5:1376 with SMTP id v123-20020a1fc581000000b0048d13e51376mr5326608vkf.10.1693493823348; Thu, 31 Aug 2023 07:57:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Konstantin Aladyshev" Date: Thu, 31 Aug 2023 17:56:52 +0300 Message-ID: Subject: Re: [edk2-devel] [edk2-discuss] PLDM messages via MCTP over KCS To: "Chang, Abner" Cc: "discuss@edk2.groups.io" , "devel@edk2.groups.io" 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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=tSZyfXhq; 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 > (I don see what is the response header for MCTP KCS in spec though, does = it mention the KCS response?). The spec doesn't explicitly mention that the format of a send and response packets differ. So I assume it is the same and it is described at the "Figure 1 =E2=80=93 MCTP over KCS Packet Format" (https://www.dmtf.org/sites/default/files/standards/documents/DSP0254_1.0.0= .pdf) Therefore the format of a response would look like this: ``` MANAGEABILITY_MCTP_KCS_HEADER (https://github.com/tianocore/edk2-platforms/blob/master/Features/Manageabi= lityPkg/Include/Library/ManageabilityTransportMctpLib.h) MCTP_TRANSPORT_HEADER (https://github.com/tianocore/edk2/blob/master/MdePkg/Include/IndustryStand= ard/Mctp.h) MCTP_MESSAGE_HEADER (https://github.com/tianocore/edk2/blob/master/MdePkg/Include/IndustryStand= ard/Mctp.h) < response data> PEC (Probably we need to define MANAGEABILITY_MCTP_KCS_TRAILER) ``` So in the "KcsTransportSendCommand" (https://github.com/tianocore/edk2-platforms/blob/14553d31c72afa7289f6a2555= b6e91f4f715a05a/Features/ManageabilityPkg/Library/ManageabilityTransportKcs= Lib/Common/KcsCommon.c#L414) we can check if we transfer is MCTP (based on "TransportToken->ManagebilityProtocolSpecification =3D=3D MCTP" like you've suggested) and handle response accordingly. But which headers should we check in this function? Only MANAGEABILITY_MCTP_KCS_HEADER/MANAGEABILITY_MCTP_KCS_TRAILER ? What about MCTP_TRANSPORT_HEADER/MCTP_MESSAGE_HEADER? Do we need to check them here as well? Or do we need to check them somewhere upper the call stack? Best regards, Konstantin Aladyshev On Thu, Aug 31, 2023 at 7:59=E2=80=AFAM Chang, Abner = wrote: > > [AMD Official Use Only - General] > > Hi Aladyshev, > > > -----Original Message----- > > From: Konstantin Aladyshev > > Sent: Wednesday, August 30, 2023 11:09 PM > > To: Chang, Abner > > Cc: discuss@edk2.groups.io; devel@edk2.groups.io > > Subject: Re: [edk2-discuss] PLDM messages via MCTP over KCS > > > > Caution: This message originated from an External Source. Use proper ca= ution > > when opening attachments, clicking links, or responding. > > > > > > Hi! > > > > I've started to implement MCTP over KCS binding for the libmctp > > (https://github.com/openbmc/libmctp) and test it with the current code > > in the ManageabilityPkg. > > > > I was able successfully send the MCTP packet to the BMC, but right now > > I'm having some troubles with receiving the answer back. > > > > I think I've found some bug in the `KcsTransportSendCommand` code. > > > > After it sends data over KCS in expects a responce starting with a > > 'IPMI_KCS_RESPONSE_HEADER' > > https://github.com/tianocore/edk2- > > platforms/blob/14553d31c72afa7289f6a2555b6e91f4f715a05a/Features/ > > ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsComm > > on.c#L476 > > > > Isn't it wrong, assuming that the right header in case of MCTP should > > be 'MANAGEABILITY_MCTP_KCS_HEADER' ? > > > > I guess the 'IpmiHelperCheckCompletionCode' check after the data > > receive is also not relevant for the MCTP. > > > This is something I don=E2=80=99t really sure as I can't verify the respo= nse payload because our BMC doesn't have the code to handle MCTP over KCS c= ommand. However it is appreciated if community can help to verify this. As = I can remember, I can see the return KCS status is 0xC1, the invalid comman= d. Thus I think if we do a MCTP over KCS, the first response is still KCS r= esponse header. > This is not what do you see on the BCM it does support MCTP over KCS? If = so, then I would like to have your help to correct this code. > > > > > Since 'ManageabilityTransportKcsLib' can be used both for IPMI and > > MCTP, how should we deal with this? > If KcsCommon.c, we can have different code path for the given protocol GU= ID. e.g., if (TransportToken->ManagebilityProtocolSpecification =3D=3D MCTP= ). > Then skip reading the KCS_REPOSNSE_HEADER or to read the MCTP_RESPONSE_HE= ADER (I don see what is the response header for MCTP KCS in spec though, do= es it mention the KCS response?). > > Thanks > Abner > > > > > Best regards, > > Konstantin Aladyshev > > > > On Wed, Aug 23, 2023 at 5:18=E2=80=AFAM Chang, Abner > > wrote: > > > > > > [AMD Official Use Only - General] > > > > > > Please see my answers inline. > > > > > > > -----Original Message----- > > > > From: discuss@edk2.groups.io On Behalf Of > > > > Konstantin Aladyshev via groups.io > > > > Sent: Wednesday, August 23, 2023 1:54 AM > > > > To: Chang, Abner > > > > Cc: discuss@edk2.groups.io; devel@edk2.groups.io > > > > Subject: Re: [edk2-discuss] PLDM messages via MCTP over KCS > > > > > > > > Caution: This message originated from an External Source. Use prope= r > > caution > > > > when opening attachments, clicking links, or responding. > > > > > > > > > > > > Thanks for the answer! > > > > > > > > I was a little bit confused about the part, that in the same packag= e I > > > > actually need to provide different library implementations for the > > > > same 'ManageabilityTransportLib', thanks for the clarification! > > > > I think your DSC example should go into the package documentation. > > > Yes, this is a good idea. I will update it. > > > > > > > > > > > As for me, I'm working with the OpenBMC distribution > > > > (https://github.com/openbmc/openbmc) and my goal is to transfer dat= a > > > > from the BIOS to the BMC via MCTP/PLDM. > > > > Currently there is no solution for the MCTP over KCS binding in Lin= ux, > > > > so I need to add this support: > > > > - either to the MCTP userspace library > > > > (https://github.com/openbmc/libmctp) [old OpenBMC way, but probably > > > > easier] > > > > - or to the MCTP kernel binding > > > > (https://github.com/torvalds/linux/tree/master/drivers/net/mctp) > > > > [modern mctp Linux driver approach] > > > > > > > > Both don't sound like an easy task, so can I ask, what MC (i.e. > > > > management controller) device and firmware do you use on the other > > > > side of the MCTP KCS transmissions? > > > > > > We use OpenBMC as well, but as you mention there are some missing pie= ces > > to fully support manageability between host and BMC. > > > We don=E2=80=99t have code to handle MCTP IPMI either, the edk2 Manag= eabilityPkg > > provides the framework while MCTP/PLDM/KCS implementation provides a > > sample other than IPMI/KCS to prove the flexibility of ManageabilityPkg= . > > > Actually, MCTP over KCS is not supported in our BMC firmware yet, thu= s > > BMC just returns the invalid command. However, the transport framework > > has been verified to make sure the implementation works fine as expect. > > > We need help from community to provide more manageability protocols a= nd > > transport interface libraries to this package. > > > > > > > > > > > You've also mentioned PLDM SMBIOS, isn't it covered by the > > > > https://github.com/tianocore/edk2- > > > > > > platforms/blob/master/Features/ManageabilityPkg/Universal/PldmSmbiosTr > > > > ansferDxe/PldmSmbiosTransferDxe.c > > > > ? > > > Ah hah, yes I forget I upstream it. > > > > > > Please just feel free to send patch to make more functionalities to t= his > > package. > > > Thanks > > > Abner > > > > > > > > > > > > > > > Best regards, > > > > Konstantin Aladyshev > > > > > > > > On Tue, Aug 22, 2023 at 7:26=E2=80=AFPM Chang, Abner > > > > > > wrote: > > > > > > > > > > [AMD Official Use Only - General] > > > > > > > > > > Hi Aladyshev, > > > > > We use library class to specify the desire transport interface fo= r the > > > > management protocol, such as MCTP, PLDM and IPMI. This way we can > > > > flexibly support any transport interface for the management protoco= l. > > > > > > > > > > Here is the example of using ManageabilityPkg, which is PLDM over= MCTP > > > > over KCS. > > > > > ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf= { > > > > > > > > > > > > > > > > ManageabilityTransportLib|ManageabilityPkg/Library/ManageabilityTranspo= r > > > > tKcsLib/Dxe/DxeManageabilityTransportKcs.inf > > > > > } > > > > > ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf= { > > > > > > > > > > > > > > > > ManageabilityTransportLib|ManageabilityPkg/Library/ManageabilityTranspo= r > > > > tKcsLib/Dxe/DxeManageabilityTransportKcs.inf > > > > > } > > > > > ManageabilityPkg/Universal/PldmProtocol/Dxe/PldmProtocolDxe.inf= { > > > > > > > > > > > > > > > > ManageabilityTransportLib|ManageabilityPkg/Library/ManageabilityTranspo= r > > > > tMctpLib/Dxe/DxeManageabilityTransportMctp.inf > > > > > } > > > > > > > > > > So you can implement ManageabilityTransport library for either in= dustry > > > > standard or proprietary implementation for the specific management > > > > protocol. > > > > > > > > > > BTW, We do have PLDM SMBIOS over MCTP implementation but not > > > > upstream yet. > > > > > > > > > > Hope this information helps. > > > > > Thanks > > > > > Abner > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: discuss@edk2.groups.io On Behalf= Of > > > > > > Konstantin Aladyshev via groups.io > > > > > > Sent: Tuesday, August 22, 2023 7:00 PM > > > > > > To: discuss ; devel@edk2.groups.io > > > > > > Subject: [edk2-discuss] PLDM messages via MCTP over KCS > > > > > > > > > > > > Caution: This message originated from an External Source. Use p= roper > > > > caution > > > > > > when opening attachments, clicking links, or responding. > > > > > > > > > > > > > > > > > > Hi! > > > > > > > > > > > > I'm trying to build `ManageabilityPkg` from the edk2-platforms > > > > > > repo to issue PLDM messages via MCTP over KCS. Is it possible = with > > > > > > the current code? I see all the building blocks, but have troub= le > > > > > > putting it all together. > > > > > > > > > > > > The main question that bothers me is what implementation should= I set > > > > > > for the `ManageabilityTransportLib`? > > > > > > By default it is set to dummy `BaseManageabilityTransportNull.i= nf` > > > > > > (https://github.com/tianocore/edk2- > > > > > > > > > > > > platforms/blob/master/Features/ManageabilityPkg/ManageabilityPkg.dsc). > > > > > > > > > > > > On one case to get PLDM via MCTP it looks that I need to set it= to > > > > > > `DxeManageabilityTransportMctp.inf` > > > > > > ManageabilityTransportLib| <...>/DxeManageabilityTransportMctp.= inf > > > > > > (https://github.com/tianocore/edk2- > > > > > > > > > > > > platforms/blob/master/Features/ManageabilityPkg/Library/ManageabilityTr= a > > > > > > nsportMctpLib/Dxe/DxeManageabilityTransportMctp.inf) > > > > > > > > > > > > But on the other case if I want MCTP over KCS I need to set it = to > > > > > > `DxeManageabilityTransportKcs.inf` > > > > > > ManageabilityTransportLib| <...>/DxeManageabilityTransportKcs.i= nf > > > > > > (https://github.com/tianocore/edk2- > > > > > > > > > > > > platforms/blob/master/Features/ManageabilityPkg/Library/ManageabilityTr= a > > > > > > nsportKcsLib/Dxe/DxeManageabilityTransportKcs.inf) > > > > > > > > > > > > What is the right way to resolve this? > > > > > > > > > > > > There are no platforms in the repo that actually implement PLDM= /MCTP > > > > > > functionality, so there is no example that I can use as a refer= ence. > > > > > > > > > > > > > > > > > > Best regards, > > > > > > Konstantin Aladyshev > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >=20 > > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108191): https://edk2.groups.io/g/devel/message/108191 Mute This Topic: https://groups.io/mt/100897530/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-