From nobody Fri Apr 26 12:01:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+74095+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+74095+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1618413410; cv=none; d=zohomail.com; s=zohoarc; b=BgpeEk03yzTkrzptT2hzPw4Jz1f0Iy4l3dRszD3x8jLbNJpCXfqXUw0W315zrGdN6mgxBcnt5jZGZEx+IBITTCAUTNFQDiaDDdv46xHgCZi5Ryi0qf/f9jzsz/xmTtkg3D0P5ZVTaO9S9dbbmXs4LkBsRLdp2Lyo2h85pJWVdY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618413410; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=MvB21aI1u4Gn3DKvIhEn2AmCAE7X5oYHRxT7p6tr0tk=; b=UzMUhdP/gtXM+8JPl8C0eg27DBl80f4Gz6tJ45SjRc+boGH/oFwwyQxDjR/Rk0/3pbtRvOQsnofM5SukrV1JEtCgkF9cYU2Opfy6/HLSJ5+i4JYv288FrO/SpgK8OJtm1RBI5WuQRBgYon5Aop1A/DjDvFLe4tmBdL+23XV/uxg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+74095+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 161841341095448.50220348889229; Wed, 14 Apr 2021 08:16:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id gcDrYY1788612xRKWe2629XO; Wed, 14 Apr 2021 08:16:50 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web09.14665.1618413408577115836 for ; Wed, 14 Apr 2021 08:16:49 -0700 X-Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13EFDSLJ020438; Wed, 14 Apr 2021 15:16:45 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 37wtf3vauc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Apr 2021 15:16:45 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id 81092A1; Wed, 14 Apr 2021 15:16:44 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id D412548; Wed, 14 Apr 2021 15:16:41 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Jiaxin Wu , Ting Ye , Siyuan Fu , Fan Wang , Jiewen Yao , Nickle Wang , Andrew Fish , Laszlo Ersek , Leif Lindholm , Michael D Kinney Subject: [edk2-devel] [PATCH v2] RedfishPkg: Add EDK2 Redfish Foundation diagrams Date: Wed, 14 Apr 2021 22:24:42 +0800 Message-Id: <20210414142442.10210-1-abner.chang@hpe.com> X-Proofpoint-GUID: NZH8kwOjtLmi5pCQ-B4PyXwO57CW6RVR X-Proofpoint-ORIG-GUID: NZH8kwOjtLmi5pCQ-B4PyXwO57CW6RVR X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-002e3701.pphosted.com id 13EFDSLJ020438 Precedence: Bulk List-Unsubscribe: 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,abner.chang@hpe.com X-Gm-Message-State: pBLR6cO9HXdNJkDhDlaIXxmox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1618413410; bh=DUPKFNHWHjYqgNkuxALAgQYFc23ASDKTfKSOth0wXDg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=suYTOhW0cOGrEBZnO9k5Qef7xAQAC2cMVVT/AiFeNzlUpBoSg3rnsHXjBv8Y06kirNM r0B31OXCpje8IJgCQq97UJrlW+wIwA3dJxcqb1tSmbKq8OSNCbABHrFJu3UAXau38ATCY uzPVld1x4AGYD9DKGAihO+0FTsllnszZH/o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The Readme.md to delineate the EDK2 Redfish foundation driver stack diagrams. Signed-off-by: Abner Chang Cc: Jiaxin Wu Cc: Ting Ye Cc: Siyuan Fu Cc: Fan Wang Cc: Jiewen Yao Cc: Nickle Wang Cc: Andrew Fish Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Michael D Kinney Acked-by: Laszlo Ersek Reviewed-by: Nickle Wang --- RedfishPkg/Readme.md | 117 +++ .../Documents/Media/RedfishDriverStack.svg | 965 ++++++++++++++++++ 2 files changed, 1082 insertions(+) create mode 100644 RedfishPkg/Readme.md create mode 100644 RedfishPkg/Documents/Media/RedfishDriverStack.svg diff --git a/RedfishPkg/Readme.md b/RedfishPkg/Readme.md new file mode 100644 index 0000000000..af5b3e25d8 --- /dev/null +++ b/RedfishPkg/Readme.md @@ -0,0 +1,117 @@ +# UEFI Redfish EDK2 Implementation + +## Introduction +UEFI Redfish EDK2 solution is an efficient and secure solution for the end= -users to remote configure (in Out-of-band) UEFI platform configurations by= leveraging the Redfish RESTful API. It's simple for end-users to access t= he configurations of UEFI firmware which have the equivalent properties def= ined in Redfish schema. + +Below are the block diagrams of UEFI Redfish EDK2 Implementation. ***[EDK2= Redfish Foundation[1]](#[0])*** in the lower part of the figure refers to = the EDK2 Redfish Foundation, which provides the fundamental EDK2 drivers to= communicate with Redfish service ***([[19]](#[0]) in the above figure)***.= The Redfish service could be implemented in BMC to manage the system, or o= n the network for managing multiple systems. + +***[EDK2 Redfish Client[2]](#[0])*** in the upper part of the figure refer= s to the EDK2 Redfish client, which is the EDK2 Redfish application used to= configure platform configurations by consuming the Redfish properties. The= EDK2 Redfish client can also provision the UEFI platform-owned Redfish pro= perties, consume and update Redfish properties as well. The ***[EDK2 Redfis= h Feature DXE Drivers [17]](#[0])*** is the next project after EDK2 Redfish= Foundation. Each EDK2 Redfish Feature DXE Driver is designed to communicat= e with the particular Redfish data model defined in the Redfish schema *(e.= g. Edk2RedfishBiosDxe driver manipulates the properties defined in Redfish = BIOS data model)*. + +## EDK2 Redfish Implementation Diagrams +![UEFI Redfish Implementation](https://github.com/tianocore/edk2/blob/mast= er/RedfishPkg/Documents/Media/RedfishDriverStack.svg?raw=3Dtrue) + +## EFI EDK2 Redfish Driver Stack +Below are the EDK2 drivers implemented on EDK2, + +### EDK2 Redfish Host Interface DXE Driver ***[[6]](#[0])*** + +The abstract EDK2 DXE driver to create SMBIOS type 42 record through EFI S= MBIOS protocol according to the device descriptor and protocol type data (d= efined in SMBIOS type 42h ***[[7]](#[0])***) provided by platform level Red= fish host interface library. On EDK2 open source implementation (**Emulator= Pkg**), SMBIOS type 42 data is retrieved from EFI variables created by Redf= ishPlatformConfig.efi ***[[20]](#[0])*** under EFI shell. OEM may provide i= ts own PlatformHostInterfaceLib ***[[11]](#[0])*** instance for the platfor= m-specific implementation. + +### EDK2 Refish Credential DXE Driver ***[[5]](#[0])*** + +The abstract DXE driver which incorporates with RedfishPlatformCredentialL= ib ***[[10]](#[0])*** to acquire the credential of Redfish service. On edk2= EmulatorPkg implementation, the credential is hardcoded using the fixed Ac= count/Password in order to connect to Redfish service established by [Redfi= sh Profile Simulator](https://github.com/DMTF/Redfish-Profile-Simulator). O= EM may provide its own RedfishPlatformCredentialLib instance for the platfo= rm-specific implementation. + +### EFI REST EX UEFI Driver for Redfish service ***[[4]](#[0])*** + +This is the network-based driver instance of EFI_REST_EX protocol [(UEFI s= pec 2.8, section 29.7.2)](http://uefi.org/specifications) for communicating= with Redfish service using the HTTP protocol. OEM may have its own EFI RES= T EX UEFI Driver instance on which the underlying transport to Redfish serv= ice could be proprietary. + +### EFI Redfish Discover UEFI Driver ***[[3]](#[0])*** + +EFI Redfish Discover Protocol implementation (UEFI spec 2.8, section 31.1)= . Only support Redfish service discovery through Redfish Host Interface. Th= e Redfish service discovery using SSDP over UDP ***[[18]](#[0])*** is not i= mplemented at the moment. + +### EFI REST JSON Structure DXE Driver ***[[9]](#[0])*** + +EFI REST JSON Structure DXE implementation (UEFI spec 2.8, section 29.7.3)= . This could be used by EDK2 Redfish Feature DXE Drivers ***[[17]](#[0])***= . The EDK2 Redfish feature drivers manipulate platform-owned Redfish proper= ties in C structure format and convert them into the payload in JSON format= through this protocol. This driver leverages the effort of [Redfish Schema= to C Generator](https://github.com/DMTF/Redfish-Schema-C-Struct-Generator)= to have the "C Structure" <-> "JSON" conversion. + +### EDK2 Redfish Config Handler UEFI Driver ***[[15]](#[0])*** + +This is the centralized manager of EDK2 Redfish feature drivers, it initia= tes EDK2 Redfish feature drivers by invoking init() function of EDK2 Redfis= h Config Handler Protocol ***[[16]](#[0])*** installed by each EDK2 Redfish= feature driver. EDK2 Redfish Config Handler driver is an UEFI driver which= has the dependency with EFI REST EX protocol and utilizes EFI Redfish Disc= over protocol to discover Redfish service that manages this system. + +### EDK2 Content Coding Library ***[[12]](#[0])*** +The library is incorporated with RedfishLib ***[[13]](#[0])*** to encode a= nd decode Redfish JSON payload. This is the platform library to support HTT= P Content-Encoding/Accept-Encoding headers. EumlatorPkg use the NULL instan= ce of this library because [Redfish Profile Simulator](https://github.com/D= MTF/Redfish-Profile-Simulator) supports neither HTTP Content-Encoding heade= r on the payload returned to Redfish client nor HTTP Accept-Encoding header. + +## Other Open Source Projects + The following libraries are the wrappers of other open source projects u= sed in RedfishPkg + + * **RedfishPkg\PrivateLibrary\RedfishLib** ***[[13]](#[0])*** + This is the wrapper of open source project ***[libredfish](https://githu= b.com/DMTF/libredfish)***, + which is the library to initialize the connection to Redfish service wit= h the proper credential and execute Create/Read/Update/Delete (CRUD) HTTP m= ethods on Redfish properties. + + * **RedfishPkg\Library\JsonLib** ***[[14]](#[0])*** + This is the wrapper of open source project ***[Jansson](https://digip.or= g/jansson)***, which is the library that provides APIs to manipulate JSON = payload. + +## Platform Components for EDK2 EmulatorPkg: + * **RedfishPlatformCredentialLib** + the EDK2 Emulator platform implementation of acquiring credential to bui= ld up the communication between UEFI firmware and Redfish service. ***[[10]= ](#[0])*** + + * **RedfishPlatformHostInterfaceLib** + EDK2 Emulator platform implementation which provides the information of = building up SMBIOS type 42h record. ***[[11]](#[0])*** + +## Miscellaneous: + + * **EFI Shell Application** + RedfishPlatformConfig.exe is an EFI Shell application used to set up th= e Redfish service information for the EDK2 Emulator platform. The informati= on such as IP address, subnet, and port. + ```C + For example, run shell command "RedfishPlatformConfig.efi -s 192.168.1= 0.101 255.255.255.0 192.168.10.123 255.255.255.0", which means + the source IP address is 192.168.10.101, and the Redfish Server IP a= ddress is 192.168.10.123. + ``` + + * **Redfish Profile Simulator** + Refer to [Redfish Profile Simulator](https://github.com/DMTF/Redfish-Pr= ofile-Simulator) to set up the Redfish service. + We are also in the progress to contribute bug fixes and enhancements to= the mainstream Redfish Profile Simulator in order to incorporate with EDK2= Redfish solution. + +## Connect to Redfish Service on EDK2 Emulator Platform + 1. Install the WinpCap and copy [SnpNt32Io.dll](https://github.com/tian= ocore/edk2-NetNt32Io) to the building directory of the Emulator platform. T= his is the emulated network interface for EDK2 Emulator Platform. + ```C + e.g. %WORKSPACE%/Build/EmulatorX64/DEBUG_VS2015x86/X64 + ``` + + 2. Enable below macros in EmulatorPkg.dsc + ```C + NETWORK_HTTP_ENABLE =3D TRUE + SECURE_BOOT_ENABLE =3D TRUE + REDFISH_ENABLE =3D TRUE + ``` + + 3. Allow HTTP connection + Enable below macro to allow HTTP connection on EDK2 network stack for c= onnecting to [Redfish Profile Simulator](https://github.com/DMTF/Redfish-Pr= ofile-Simulator) becasue Redfish Profile Simulator doesn't support HTTPS. + ```C + NETWORK_ALLOW_HTTP_CONNECTIONS =3D TRUE + ``` + + 4. Assign the correct MAC Address + Assign the correct MAC address of the network interface card emulated b= y WinpCap. + - Rebuild EmulatorPkg and boot to EFI shell once SnpNt32Io.dll is copie= d to the building directory and the macros mentioned in #2 are all set to T= URE. + - Execute the EFI shell command "ifconfig -l" under EFI shell and look = for MAC address information, then assign the MAC address to below PCD. + ```c + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePa= th|{DEVICE_PATH("MAC(000000000000,0x1)")} + ``` + + 5. Configure the Redfish service on the EDK2 Emulator platform + + Execute RedfishPlatformConfig.efi under EFI shell to configure the Redf= ish service information. The EFI variables are created for storing Redfish = service information and is consumed by RedfishPlatformHostInterfaceLib und= er EmulatorPkg. + +## Related Materials +1. [DSP0270](https://www.dmtf.org/sites/default/files/standards/documents/= DSP0270_1.3.0.pdf) - Redfish Host Interface Specification, 1.3.0 +2. [DSP0266](https://www.dmtf.org/sites/default/files/standards/documents/= DSP0266_1.12.0.pdf) - Redfish Specification, 1.12.0 +3. Redfish Schemas - https://redfish.dmtf.org/schemas/v1/ +4. UEFI Specification - http://uefi.org/specifications + +## The Contributors +Thanks to the below predecessors who contributed to the UEFI EDK2 Redfish = Prove of Concept code.\ +Fu, Siyuan \ +Ye, Ting \ +Wang, Fan \ +Wu, Jiaxin \ +Yao, Jiewen \ +Shia, Cinnamon diff --git a/RedfishPkg/Documents/Media/RedfishDriverStack.svg b/RedfishPkg= /Documents/Media/RedfishDriverStack.svg new file mode 100644 index 0000000000..76269b787b --- /dev/null +++ b/RedfishPkg/Documents/Media/RedfishDriverStack.svg @@ -0,0 +1,965 @@ + + + + + EDKII Redfish Driver Stack Diagrams + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VBackground-1 + + + Solid + + + + + + + + + + + Page-1 + + + + Sheet.1 + + + + Sheet.2 + RedfishLib (libredfish) + + + + RedfishLib(libredfish) = + + Sheet.3 + JsonLib (jansson) + + + + JsonLib(jansson) = + + Sheet.4 + EFI Redfish Discover (UEFI Driver Model) + + + + EFI Redfish Discover(UEFI Driver Model)<= /text> + + Sheet.5 + EFI REST EX (UEFI Driver Model) + + + + EFI REST EX(UEFI Driver Model)<= /text> + + Sheet.6 + EFI REST JSON to C Structure (DXE Driver) + + + + EFI REST JSON= to C Structure= (DXE Driver) + + Sheet.7 + EDKII Redfish Credential (DXE Driver) + + + + EDKII Redfish= Credential(<= tspan class=3D"st10">DXE Driver) + + Sheet.8 + EDKII Platform Content Coding Library + + + + EDKII Platfor= m Content Coding Library= + + Sheet.9 + EDKII Network Stacks (UEFI Driver Model) + + + + EDKII Network= Stacks(<= tspan class=3D"st10">UEFI Driver Model) + + Sheet.10 + EDKII Redfish Host Interface (DXE Driver) + + + + EDKII Redfish= Host Interface(DXE Driver) + + Sheet.11 + SMBIOS Type 42 + + + + = SMBIOS Type 42 + + Sheet.12 + RedfishPlatformConfig.efi + + + + RedfishPlatformConfig.efi + + Sheet.13 + Platform Redfish Credential Library + + + + Platform Redf= ish Credential Li= brary + + Sheet.14 + Platform Redfish Host Interface Library + + + + = Platform Redfi= sh Host Interface Lib= rary + + Sheet.20 + + + + Sheet.26 + + + + Sheet.27 + + + + Sheet.34 + + + + Sheet.35 + + + + Sheet.42 + + + + Sheet.43 + + + + Sheet.44 + + + + + + + Can + Redfish Service + + Sheet.46 + + + + + + + + + + + + + Redfish Service= + + + Rounded Rectangle + + + + + + + + + + + + + + + + + + + + + + Rounded Rectangle.48 + + + + + + + + + + + + + + + + + + + + + + Sheet.49 + On Network + + + + On Network = + + Sheet.51 + BMC + + + + BMC + + Sheet.53 + + + + Sheet.54 + + + + Sheet.55 + + + + Sheet.56 + EDKII Redfish Foundation + + + + EDKII Redfish Foundation + + Sheet.57 + EDKII Redfish Client + + + + EDKII Redfish Client + + Rounded Rectangle.58 + SSDP over UDP + + + + + + + + + + + + + + + + + + + + + + SS= DP over UDP + + + + + Can.60 + Redfish Service + + Sheet.61 + + + + + + + + + + + + + Redfish Service= + + + Rounded Rectangle.62 + + + + + + + + + + + + + + + + + + + + + + Sheet.63 + BMC + + + + BMC + + Sheet.64 + Build up Redfish Host Interface + + + + Build up Redfish Host Inte= rface + + Sheet.66 + EFI Shell Application, which builds up Redfish Host inte= rface... + + + + EFI Shell Application, whi= chbuilds up Redfi= sh Host interfacefor EDK2 emulator platform(Emul= atorPkg=EF=BC=89 = + + Sheet.69 + Get Authentication + + + + Get Authentication + + Sheet.71 + RedfishBiosDxe + + + + RedfishBiosDx= e + + Sheet.72 + RedfishBootInfoDxe + + + + RedfishBootIn= foDxe + + Sheet.73 + EDKII Redfish Feature DXE Drivers + + + + EDKII Redfish Feature DXE Drivers= + + Rectangle + + + + + + + Rounded Rectangle.76 + + + + + + + + + + + + + + + + + + + + + + + + + Sheet.77 + EDKII RedfishConfigDriver (UEF Driver Model) + + + + EDKII RedfishConfigD= river(UEF Driver Model) + + Sheet.79 + + + + Rounded Rectangle.80 + + + + + + + + + + + + + + + + + + + + + + Rounded Rectangle.81 + + + + + + + + + + + + + + + + + + + + + + Sheet.90 + + + + Sheet.93 + + + + Sheet.99 + + + + Sheet.100 + + + + Wavy connector 2 + + + + + + + + + Sheet.128 + + + + Sheet.129 + + + + Sheet.130 + + + + Sheet.141 + + + + Sheet.142 + + + + Sheet.143 + + + + Sheet.144 + + + + Sheet.145 + + + + Sheet.147 + EDKII Open Source + + + + EDKII Open Source = + + Sheet.148 + Other Open Source + + + + Other Open Source = + + Sheet.149 + OEM EDKII Library + + + + OEM EDKII Library = + + Sheet.150 + Redfish Payload Flow + + + + Redfish Payload Flow + + Sheet.151 + + + + Sheet.153 + + + + Sheet.154 + + + + Rounded Rectangle.82 + + + + + + + + + + + + + + + + + + + + + + Rounded Rectangle.83 + EDKII Redfish Config Handler Protocol + + + + + + + + + + + + + + + + + + + + + + EDKII Redfish Config Handler Pro= tocol + + Sheet.157 + [1] + + + + [1] + + Sheet.158 + [2] + + + + [2] + + Sheet.159 + [3] + + + + [3] + + Sheet.160 + [4] + + + + [4] + + Sheet.161 + [5] + + + + [5] + + Sheet.162 + [6] + + + + [6] + + Sheet.163 + [7] + + + + [7] + + Sheet.164 + [8] + + + + [8] + + Sheet.165 + [9] + + + + [9] + + Sheet.166 + [10] + + + + [10] + + Sheet.167 + [11] + + + + [11] + + Sheet.168 + [12] + + + + [12] + + Sheet.169 + [13] + + + + [13] + + Sheet.170 + [14] + + + + [14] + + Sheet.171 + [15] + + + + [15] + + Sheet.172 + [16] + + + + [16] + + Sheet.173 + [17] + + + + [17] + + Sheet.174 + [18] + + + + [18] + + Sheet.175 + [19] + + + + [19] + + Sheet.176 + [20] + + + + [20] + + --=20 2.17.1 -=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 (#74095): https://edk2.groups.io/g/devel/message/74095 Mute This Topic: https://groups.io/mt/82093820/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-