From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@hpe.com header.s=pps0720 header.b=CRKBzamz; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0738e09fff=abner.chang@hpe.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=HODefFuBbXBrfo5XTjzwbanfaolugN/TA5/jtxtV/Ps=; b=CRKBzamzROj2gPVPQ2/J9eB2EmHFDxJcvSySf8CPSogb1szLVpWXFzwKD+GiKu5Xkk0S 8bmvDsPlWT8Wg8Q90pGGpacFg6B2SWEO0wj1jWmIvPlr6kw0RNIx4RdphXj8fCzfpZx0 mSgPGnkuv36fwg+fx4TpyhwHAlg9nZKxilezO3gC/wshfgbgM+KoOmOD89xjBmd0bwCk cOtGWQgJMHCB0CgQGf0pUzhwnrm95MXCsA829urAxbmbq2zyz0sufZmeQ4ZZiWADHs0r IR9XsVprTSbYD8AwH0D/GVqHwWPDXIcdwtM3/SRLn4IvWZP7w1SABAWfGKKHdPRngbpU ug== 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 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) 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: [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-Mailer: git-send-email 2.17.1 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-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-04-14_10:2021-04-14,2021-04-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 clxscore=1015 adultscore=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 priorityscore=1501 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104140103 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-002e3701.pphosted.com id 13EFDSLJ020438 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 --- 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 e= nd-users to remote configure (in Out-of-band) UEFI platform configuration= s by leveraging the Redfish RESTful API. It's simple for end-users to ac= cess the configurations of UEFI firmware which have the equivalent proper= ties defined in Redfish schema. + +Below are the block diagrams of UEFI Redfish EDK2 Implementation. ***[ED= K2 Redfish Foundation[1]](#[0])*** in the lower part of the figure refers= to the EDK2 Redfish Foundation, which provides the fundamental EDK2 driv= ers to communicate with Redfish service ***([[19]](#[0]) in the above fig= ure)***. The Redfish service could be implemented in BMC to manage the sy= stem, or on the network for managing multiple systems. + +***[EDK2 Redfish Client[2]](#[0])*** in the upper part of the figure ref= ers to the EDK2 Redfish client, which is the EDK2 Redfish application use= d to configure platform configurations by consuming the Redfish propertie= s. The EDK2 Redfish client can also provision the UEFI platform-owned Red= fish properties, consume and update Redfish properties as well. The ***[E= DK2 Redfish Feature DXE Drivers [17]](#[0])*** is the next project after = EDK2 Redfish Foundation. Each EDK2 Redfish Feature DXE Driver is designed= to communicate with the particular Redfish data model defined in the Red= fish schema *(e.g. Edk2RedfishBiosDxe driver manipulates the properties d= efined in Redfish BIOS data model)*. + +## EDK2 Redfish Implementation Diagrams +![UEFI Redfish Implementation](https://github.com/tianocore/edk2/blob/ma= ster/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= SMBIOS protocol according to the device descriptor and protocol type dat= a (defined in SMBIOS type 42h ***[[7]](#[0])***) provided by platform lev= el Redfish host interface library. On EDK2 open source implementation (**= EmulatorPkg**), SMBIOS type 42 data is retrieved from EFI variables creat= ed by RedfishPlatformConfig.efi ***[[20]](#[0])*** under EFI shell. OEM m= ay provide its own PlatformHostInterfaceLib ***[[11]](#[0])*** instance f= or the platform-specific implementation. + +### EDK2 Refish Credential DXE Driver ***[[5]](#[0])*** + +The abstract DXE driver which incorporates with RedfishPlatformCredentia= lLib ***[[10]](#[0])*** to acquire the credential of Redfish service. On = edk2 EmulatorPkg implementation, the credential is hardcoded using the fi= xed Account/Password in order to connect to Redfish service established b= y [Redfish Profile Simulator](https://github.com/DMTF/Redfish-Profile-Sim= ulator). OEM may provide its own RedfishPlatformCredentialLib instance fo= r the platform-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= spec 2.8, section 29.7.2)](http://uefi.org/specifications) for communica= ting with Redfish service using the HTTP protocol. OEM may have its own E= FI REST EX UEFI Driver instance on which the underlying transport to Redf= ish service 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= . The Redfish service discovery using SSDP over UDP ***[[18]](#[0])*** is= not implemented 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 = properties in C structure format and convert them into the payload in JSO= N format through this protocol. This driver leverages the effort of [Redf= ish Schema to C Generator](https://github.com/DMTF/Redfish-Schema-C-Struc= t-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 init= iates EDK2 Redfish feature drivers by invoking init() function of EDK2 Re= dfish Config Handler Protocol ***[[16]](#[0])*** installed by each EDK2 R= edfish feature driver. EDK2 Redfish Config Handler driver is an UEFI driv= er which has the dependency with EFI REST EX protocol and utilizes EFI Re= dfish Discover protocol to discover Redfish service that manages this sys= tem. + +### EDK2 Content Coding Library ***[[12]](#[0])*** +The library is incorporated with RedfishLib ***[[13]](#[0])*** to encode= and decode Redfish JSON payload. This is the platform library to support= HTTP Content-Encoding/Accept-Encoding headers. EumlatorPkg use the NULL = instance of this library because [Redfish Profile Simulator](https://gith= ub.com/DMTF/Redfish-Profile-Simulator) supports neither HTTP Content-Enco= ding header on the payload returned to Redfish client nor HTTP Accept-Enc= oding header. + +## Other Open Source Projects + The following libraries are the wrappers of other open source projects= used in RedfishPkg + + * **RedfishPkg\PrivateLibrary\RedfishLib** ***[[13]](#[0])*** + This is the wrapper of open source project ***[libredfish](https://git= hub.com/DMTF/libredfish)***, + which is the library to initialize the connection to Redfish service w= ith the proper credential and execute Create/Read/Update/Delete (CRUD) HT= TP methods on Redfish properties. + + * **RedfishPkg\Library\JsonLib** ***[[14]](#[0])*** + This is the wrapper of open source project ***[Jansson](https://digip.= org/jansson)***, which is the library that provides APIs to manipulate J= SON payload. + +## Platform Components for EDK2 EmulatorPkg: + * **RedfishPlatformCredentialLib** + the EDK2 Emulator platform implementation of acquiring credential to b= uild up the communication between UEFI firmware and Redfish service. ***[= [10]](#[0])*** + + * **RedfishPlatformHostInterfaceLib** + EDK2 Emulator platform implementation which provides the information o= f building up SMBIOS type 42h record. ***[[11]](#[0])*** + +## Miscellaneous: + + * **EFI Shell Application** + RedfishPlatformConfig.exe is an EFI Shell application used to set up = the Redfish service information for the EDK2 Emulator platform. The infor= mation such as IP address, subnet, and port. + ```C + For example, run shell command "RedfishPlatformConfig.efi -s 192.168= .10.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= address is 192.168.10.123. + ``` + + * **Redfish Profile Simulator** + Refer to [Redfish Profile Simulator](https://github.com/DMTF/Redfish-= Profile-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/ti= anocore/edk2-NetNt32Io) to the building directory of the Emulator platfor= m. This 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= connecting to [Redfish Profile Simulator](https://github.com/DMTF/Redfis= h-Profile-Simulator) becasue Redfish Profile Simulator doesn't support HT= TPS. + ```C + NETWORK_ALLOW_HTTP_CONNECTIONS =3D TRUE + ``` + + 4. Assign the correct MAC Address + Assign the correct MAC address of the network interface card emulated= by WinpCap. + - Rebuild EmulatorPkg and boot to EFI shell once SnpNt32Io.dll is cop= ied to the building directory and the macros mentioned in #2 are all set = to TURE. + - Execute the EFI shell command "ifconfig -l" under EFI shell and loo= k for MAC address information, then assign the MAC address to below PCD. + ```c + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.Device= Path|{DEVICE_PATH("MAC(000000000000,0x1)")} + ``` + + 5. Configure the Redfish service on the EDK2 Emulator platform + + Execute RedfishPlatformConfig.efi under EFI shell to configure the Re= dfish service information. The EFI variables are created for storing Redf= ish service information and is consumed by RedfishPlatformHostInterfaceL= ib under EmulatorPkg. + +## Related Materials +1. [DSP0270](https://www.dmtf.org/sites/default/files/standards/document= s/DSP0270_1.3.0.pdf) - Redfish Host Interface Specification, 1.3.0 +2. [DSP0266](https://www.dmtf.org/sites/default/files/standards/document= s/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 Redfis= h 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/RedfishP= kg/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(<= tspan class=3D"st5">jansson) = + + Sheet.4 + EFI Redfish Discover (UEFI Driver Model) + + + + EFI Redfish Discover(= UEFI Driver Model) + + Sheet.5 + EFI REST EX (UEFI Driver Model) + + + + = EFI REST EX(= UEFI Driver Model) + + Sheet.6 + EFI REST JSON to C Structure (DXE Driver) + + + + EFI REST = JSON to C Structu= re(DXE Driver) + + Sheet.7 + EDKII Redfish Credential (DXE Driver) + + + + EDKII Red= fish Credential(DXE Driver)<= /text> + + Sheet.8 + EDKII Platform Content Coding Library + + + + EDKII Pla= tform Content Coding Libra= ry + + Sheet.9 + EDKII Network Stacks (UEFI Driver Model) + + + + EDKII Net= work Stacks(UEFI Driver Model) + + Sheet.10 + EDKII Redfish Host Interface (DXE Driver) + + + + EDKII Red= fish 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 = Redfish Credential = Library + + Sheet.14 + Platform Redfish Host Interface Library + + + + Platform R= edfish Host Interface L= ibrary + + Sheet.20 + + + + Sheet.26 + + + + Sheet.27 + + + + Sheet.34 + + + + Sheet.35 + + + + Sheet.42 + + + + Sheet.43 + + + + Sheet.44 + + + + + + + Can + Redfish Service + + Sheet.46 + + + + + + + + + + + + + Redfish Servi= ce + + + 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 + + + + <= v:paragraph/>EDKII Redfish Foundation + + Sheet.57 + EDKII Redfish Client + + + + <= v:paragraph/>EDKII Redfish Client + + Rounded Rectangle.58 + SSDP over UDP + + + + + + + + + + + + + + + + + + + + + + SSDP over UDP + + + + + Can.60 + Redfish Service + + Sheet.61 + + + + + + + + + + + + + Redfish Servi= ce + + + Rounded Rectangle.62 + + + + + + + + + + + + + + + + + + + + + + Sheet.63 + BMC + + + + BMC + + Sheet.64 + Build up Redfish Host Interface + + + + <= v:paragraph v:bulletSize=3D"0.166667"/>Build up Redfish Host = Interface + + Sheet.66 + EFI Shell Application, which builds up Redfish Host in= terface... + + + + <= v:paragraph v:bulletSize=3D"0.166667"/>EFI Shell Application,= whichbuilds up Red= fish Host interfacefor EDK2 emulator platform(Em= ulatorPkg=EF=BC=89= + + Sheet.69 + Get Authentication + + + + <= v:paragraph v:bulletSize=3D"0.166667"/>Get Authentication + + Sheet.71 + RedfishBiosDxe + + + + RedfishBi= osDxe + + Sheet.72 + RedfishBootInfoDxe + + + + RedfishBo= otInfoDxe + + Sheet.73 + EDKII Redfish Feature DXE Drivers + + + + EDKII Redfish Feature DXE Drive= rs + + Rectangle + + + + + + + Rounded Rectangle.76 + + + + + + + + + + + + + + + + + + + + + + + + + Sheet.77 + EDKII RedfishConfigDriver (UEF Driver Model) + + + + = EDKII RedfishConfi= gDriver(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 + + + + <= v:paragraph v:bulletSize=3D"0.166667"/>EDKII Open Source + + Sheet.148 + Other Open Source + + + + <= v:paragraph v:bulletSize=3D"0.166667"/>Other Open Source + + Sheet.149 + OEM EDKII Library + + + + <= v:paragraph v:bulletSize=3D"0.166667"/>OEM EDKII Library + + Sheet.150 + Redfish Payload Flow + + + + <= v:paragraph v:bulletSize=3D"0.166667"/>Redfish Payload Flow + + Sheet.151 + + + + Sheet.153 + + + + Sheet.154 + + + + Rounded Rectangle.82 + + + + + + + + + + + + + + + + + + + + + + Rounded Rectangle.83 + EDKII Redfish Config Handler Protocol + + + + + + + + + + + + + + + + + + + + + + EDKII Redfish Config Handler P= rotocol + + 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