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.web08.3674.1626756558248988312 for ; Mon, 19 Jul 2021 21:49:18 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@hpe.com header.s=pps0720 header.b=e20hZSOM; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0835467ab0=abner.chang@hpe.com) Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16K4m25g020360; Tue, 20 Jul 2021 04:49:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=VXLtDVFy7W28T2qFutljocJElFK0VxHDTPrnJ2Ebo5A=; b=e20hZSOMKlHJ3GPItKYL7uumwx0aoH2P0Dx5cXgw8etLld22hqx/YOP81Bpfji+kM+5C Gblhy/H1VTccfnVV8l1fqRHS2P2x8S5QJXvEv+NujPK0Gg3bvWAWbP/h5YSyD/jrJKzF 0u+c/jLd7CeAtoSGKpiF9h5iF1u4VaNsFzQwOPckl6C6nUukRhSFQPmd19aJ3Pmae3hU Xg+UZKeBhsNJLZLxRcoxF3nKOXvrGEG2T0E8/lltFyHzUai/8V2Ldw1gD69xdCXrVT6e JXWbLlhaSYCHSR2wRCpGDZPz+xX3JRyKNcJZvEnW4Tr4zheso5noofZODpaGsso3EsAS LQ== Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 39vyuu3aa7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 20 Jul 2021 04:49:02 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 146C182; Tue, 20 Jul 2021 04:49:02 +0000 (UTC) Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 5F2C83A; Tue, 20 Jul 2021 04:49:00 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao , Andrew Fish , Leif Lindholm , Michael D Kinney Subject: [staging/edk2-redfish-client PATCH v2 1/2] RedfishClientPkg: Initial commit Date: Tue, 20 Jul 2021 11:53:57 +0800 Message-Id: <20210720035358.22177-2-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210720035358.22177-1-abner.chang@hpe.com> References: <20210720035358.22177-1-abner.chang@hpe.com> X-Proofpoint-GUID: UFaF7MWhf-Jrv4-ACR7RkSsqyd7N6UzH X-Proofpoint-ORIG-GUID: UFaF7MWhf-Jrv4-ACR7RkSsqyd7N6UzH 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.790 definitions=2021-07-20_01:2021-07-19,2021-07-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 impostorscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107200026 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-002e3701.pphosted.com id 16K4m25g020360 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Initial commit of architecture diagrams and Readme.md Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney --- RedfishClientPkg/Readme.md | 185 +++ .../Media/RedfishClientDriverStack.svg | 1068 +++++++++++++++++ 2 files changed, 1253 insertions(+) create mode 100644 RedfishClientPkg/Readme.md create mode 100644 RedfishClientPkg/Documents/Media/RedfishClientDriverS= tack.svg diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md new file mode 100644 index 0000000000..9e56fb9039 --- /dev/null +++ b/RedfishClientPkg/Readme.md @@ -0,0 +1,185 @@ +# UEFI Redfish Client EDK2 Implementation + +## Introduction +UEFI Redfish Client EDK2 solution is implemented base on +[*EDK2 Redfish Foundation*](https://github.com/tianocore/edk2/blob/maste= r/RedfishPkg/Readme.md), +the implementation utilizes the EFI protocols provided by EDK2 Redfish +Foundation to communicate with the Redfish service for creating, consumi= ng, and +updating the Redfish properties which are managed by firmware. This solu= tion +requests the instance of **EFI REST EX Protocol** through EFI Redfish Di= scover +Protocol and interacts with Redfish service using **EFI REST EX Protocol= ** later +on. The essential part of this implementation is to map the EDK2 HII opt= ions to +the corresponding Redfish properties that are already defined in the sta= ndard +Redfish schemas published by +[*DMTF Redfish working group*](https://www.dmtf.org/standards/redfish). +The advantage of this design is to strengthen the interoperability among= the +servers produced by different OEMs when configuring the platform through= Redfish +service. Using the properties defined in Redfish standard schema for con= figuring +platform reduces the overhead of Redfish client tools to have different +implementations in order to compliant with OEM servers. The solution als= o +reduces OEM-defined proprietary BIOS Attributes that lead to the diverge= nce of +platform configuration namings in Redfish BIOS Attribute Registry, howev= er, +those different namings refer to the same platform functionality. + +## The Scope of UEFI Redfish Client EDK2 Implementation +- Platform Configurable settings + +This is the first stage of UEFI Redfish Client EDK2 Implementation. Asso= ciate +Redfish property with HII option. + +- Provisioning of Firmware Managed Platform Redfish Resource + +The current design of UEFI Redfish Client EDK2 Implementation can alread= y +support the provisioning of firmware-owned platform Redfish resource, ho= wever, +this requires addtional support on edk2 HII. Therefore, provisioning of +firmware managed platform Redfish resource would be the second stage. + +Below are the block diagrams of UEFI Redfish Client EDK2 Implementation. + +## EDK2 Redfish Client Implementation Diagrams +![UEFI Redfish Client Implementation](https://github.com/changab/edk2-st= aging/blob/edk2-redfish-client/RedfishClientPkg/Documents/Media/RedfishCl= ientDriverStack.svg?raw=3Dtrue) + +## EFI EDK2 Redfish Client Framework +The functionality of each block in the diagrams are described in belwo s= ections, + +### EDK2 Redfish Foundation ***[[1]](#[0])*** +EDK2 Redfish Redfish Foundation provides the facilities of communicating= with +Redfish service. Such as the discovery of Redfish service, the credentia= l to +access Redfish service, *EFI REST EX Protocol* instance which is the tra= nsport +layer to Redfish service, and so on. Please refer to +[*EDK2 Redfish Foundation*](https://github.com/tianocore/edk2/blob/maste= r/RedfishPkg/Readme.md). + +### Redfish Profile Simulator ***[[2]](#[0])*** +Redfish Profile Simulator is an +[*open source project*](https://github.com/DMTF/Redfish-Profile-Simulato= r) on +DMTF GitHub, which simulates the HTTP request methods (POST, PATCH, PUT,= GET) on +Redfish resource maintained by Redfish Profile Simulator. EDK2 open sour= ce uses +this simulator for the use case when Redfish service has not been set up= on the +platform, or for the quick Redfish firmware feature development. We clon= e this +project under RedfishClientPkg and maintain it by edk2 because this proj= ect has +currently been using and updating rarely. That is easier for edk2 to add +features to the simulator or modify the simulator to align with edk2 req= uirement +on Redfish service, such as ETAG and HTTP POST support.
+Another open source project of Redfish simulator is +[*Redfish Interface Emulator*](https://github.com/DMTF/Redfish-Interface= -Emulator), +however, we don't pay much attention to this project because we have bee= n +dedicating to Redfish Profile Simulator since we started the UEFI Redfis= h EDK2 +project. + +### EDK2 Redfish JSON Schema to C Structure Convertor ***[[3]](#[0])*** +This is the script auto-generated EDK2 drivers and libraries that provid= e the +Redfish schema naming based JSON to C structure and vise versa converter= s. C +structure is another representation of Redfish properties other than JSO= N and +CSDL(XML). The higher layer Redfish client application can deal with C s= tructure +instead of using JSON library to manipulate Redfish properties. The scri= pt +[*Redfish Schema C Struct Generator*](https://github.com/DMTF/Redfish-Sc= hema-C-Struct-Generator) +is still a private project on DMTF GitHub. Below is the reference of scr= ipt +auto-generated +[*Redfish JSON C Struct Converter Lib*](https://github.com/changab/Redfi= sh-JSON-C-Struct-Converter-Lib) +libraries. The converters generated by the script are followed +**EFI REST JSON Structure Protocol** defined in UEFI spec 2.8, section 2= 9.7.3. + +### EDK2 Redfish Non-Collection ***[[4]](#[0])*** and Collection ***[[5]= ](#[0]) +*** Feature Drivers EDK2 Redfish feature driver is an intermediary drive= r that +sits between **JSON Schema to C Structure converters** and **EFI Platfor= m +Configuration to Redfish Protocol**. The Redfish feature driver gets and= sets +the platform configuration and incorporates it with Redfish JSON schema = C +structure to manipulate Redfish JSON resources. Then applies the setting= s from +Redfish service to platform configurations, or vise versa to update plat= form +configurations to Redfish service. Both EDK2 Redfish Non-Collection and +Collection Feature drivers are script auto-generated base on Redfish sch= ema +naming. The EDK2 Redfish Non-Collection feature driver manages the resou= rce of +specific Resdifsh resource type, while the EDK2 Redfish Collection featu= re +driver manages the members which have the same resource type in collecti= on +resource (e.g the ComputerSystem resource and ComputerSystemCollection r= esource) +. + +### EDKII Redfish Platform Config Protocol ***[[6]](#[0])*** +EDKII Redfish Platform Config Protocol is an abstract driver that abstra= cts the +platform configuration format and storage from EDK2 Redfish Feature driv= er. +This protocol provides the interfaces to get and set platform configurat= ion with +the format and configuration storage agnostic to the Redfish feature dri= ver. +The platform can provide its own EDKII Redfish Platform Config driver in= stance +to access platform-specific configuration format and storage. On EDK2 op= en +source, EDKII Redfish Platform Config Protocol accesses the platform +configuration in EDK2 HII defined format. + +Below is the prototype of **EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL**, + +```C +struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL { + EDKII_REDFISH_PLATFORM_CONFIG_GET_VALUE GetValue; + EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE SetValue; + EDKII_REDFISH_PLATFORM_CONFIG_GET_CONFIG_LANG GetConfigureLang; + EDKII_REDFISH_PLATFORM_CONFIG_GET_SUPPORTED_SCHEMA GetSupportedSchema= ; +}; +``` + +### Other instances of EDKII Redfish Platform Config Protocol ***[[7]](#= [0])*** +For those Non-EDK2 HII-based platform configuration formats, the driver = instance +can provide its own implementation to get or set the platform configurat= ions. + +### EDK2 HII VFR Form ***[[8]](#[0])*** +According to **UEFI spec 2.9 section 35.6 Form Browser Protocol**, +**EFI_HII_REST_STYLE_FORMSET_GUID** is used on HII form to indicate that= HII +options declared in this form intend to interact with the REST architect= ural +style. On edk2 open source, the REST architectural style refers to the R= edfish +service. Besides **EFI_HII_REST_STYLE_FORMSET_GUID** is defined in the f= orm +scope, **EFI_IFR_FLAG_REST_STYLE** can be assigned to the HII options th= at +indicate those options intend to interact with the REST service. + +### EDK2 HII UNI file ***[[9]](#[0])*** +x-uefi-redfish Configure Language is used in UNI file to associate HII o= ption +with the particular Redfish property. The Hii options interact with EDK2= Redfish +Feature driver if the string of HII option is assigned with x-uefi-redfi= sh +Language as in below, + +```C +x-uefi-redfish-$(NAMESPACE) +where $(NAMESPACE) is the combination of Redfish ResourceTypeName and sc= hema version. +``` +For example, if the HII option is mapped to the property in Processor.v1= _0_0. +The x-uefi-redfish configure language is declared as below, +```C +x-uefi-redfish-Processor.v1_0_0 +``` +#### x-uefi-redfish Configure Language format: +- The string declared with x-uefi-redfish configure language is a path t= o the property +in Redfish resource +- The root of path is the Redfish resource type indicated in x-uefi-redf= ish configure +language +- The path is relative to root of Redfish resource type, not related to = Redfish service +- root. + +#### Examples, +```C +Properties: + +#string STR_BOOT_SOURCE_OVERRIDE_ENABLED_PROMPT #language x_uefi_redfish= _ComputerSystem.v1_0_0 "/Boot/BootSourceOverrideEnabled" +#string STR_BOOT_SOURCE_OVERRIDE_MODE_PROMPT #language x_uefi_redfish= _ComputerSystem.v1_0_0 "/Boot/BootSourceOverrideMode" +#string STR_BOOT_SOURCE_OVERRIDE_TARGET_PROMPT #language x_uefi_redfish= _ComputerSystem.v1_0_0 "/Boot/BootSourceOverrideTarget" +``` +```C +Properties in array object [NUM]: + +#string STR_BOOT_ORDER_1_PROMPT #language x_uefi_redfish_ComputerSystem= .v1_11_0 "/Boot/BootOrder/[1]/Boot0001" +#string STR_BOOT_ORDER_2_PROMPT #language x_uefi_redfish_ComputerSystem= .v1_11_0 "/Boot/BootOrder/[2]/Boot0002" +#string STR_BOOT_ORDER_3_PROMPT #language x_uefi_redfish_ComputerSystem= .v1_11_0 "/Boot/BootOrder/[3]/Boot0003" +``` +```C +Properties in collection object {NUM}: + +#string STR_MEMORY_1_BASE_MODULE_TYPE_PROMPT #language x_uefi_redfish_M= emory.v1_7_1 "/Memory/{1}/BaseModuleType" +#string STR_MEMORY_2_BASE_MODULE_TYPE_PROMPT #language x_uefi_redfish_M= emory.v1_7_1 "/Memory/{2}/BaseModuleType" +#string STR_MEMORY_3_BASE_MODULE_TYPE_PROMPT #language x_uefi_redfish_M= emory.v1_7_1 "/Memory/{3}/BaseModuleType" +``` + +### EDK2 Build Tool ***[[10]](#[0])*** +EDK2 Build is responsible to pull the necessary EDK2 Redfish JSON Schema= to C +Structure Convertors and EDK2 Redfish Feature drivers into edk2 build pr= ocess +according to the x-uefi-Redfish config language used in the HII VFR form= s. + +## The Contributors +Chang, Abner \ +Wang, Nickle \ +Chen, Aaron diff --git a/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.sv= g b/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg new file mode 100644 index 0000000000..881d9647e5 --- /dev/null +++ b/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg @@ -0,0 +1,1068 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VBackground-1 + + + Solid + + + + + + + + + + + Page-2 + + + + Rectangle.52 + + + + + + + + + + Can + Redfish Service + + Sheet.6 + + + + + + + + + + + + + Redfish Service + + + Sheet.8 + Redfish Profile Simulator On Network + + + + Redfish Profile Simulator On Network + + Sheet.10 + EFI REST EX + + + + EFI REST EX + + Rectangle + + + + + + + Rounded Rectangle.76 + + + + + + + + + + + + + + + + + + + + + + + + + Sheet.16 + EFI REST JSON to C Structure + + + + EFI REST JSON to C= Structure + + Sheet.17 + EFI Network Stack + + + + EFI Network Stack<= /text> + + Sheet.18 + EFI Redfish Discover Protocl + + + + EFI Redfish Discov= er Protocl + + Sheet.19 + EDKII Redfish Foundation + + + + EDKII Redfish Foundation = + + Curve connect 1 + + + + + + + + + Sheet.21 + EDKII Redfish Client + + + + EDKII Redfish Client + + Sheet.24 + + + + Sheet.25 + + + + Sheet.26 + Script-generated Redfish JSON schema to C Structure convertor + + + + Script-generated R= edfish JSON schema to C Structure convertor + + Sheet.28 + + + + Sheet.29 + + + + Sheet.30 + + + + Sheet.31 + ComputerSystem + + + + ComputerSystem + + Sheet.32 + BootOption + + + + BootOption= + + Sheet.33 + Memory + + + + Memory + + Sheet.34 + + + + Sheet.35 + + + + Sheet.36 + Script-generated EDK2 Redfish Feature Driver + + + + Script-generated = EDK2 Redfish Feature Driver + + Sheet.40 + ComputerSystem + + + + ComputerSystem + + Sheet.41 + BootOption + + + + BootOption= + + Sheet.42 + Memory + + + + Memory + + Sheet.43 + + + + Sheet.46 + + + + Sheet.47 + + + + Sheet.48 + + + + Sheet.49 + ComputerSystemCollection + + + + ComputerSystemColle= ction + + Sheet.50 + BootOptionCollection + + + + BootOptionCollecti= on + + Sheet.51 + MemoryCollection + + + + MemoryCollection<= /text> + + Curve connect 2.56 + + + + + + + Sheet.57 + + + + 1-D double + + + + + + + Sheet.64 + EDKII REDFISH_PLATFORM_CONFIG_PROTOCOL + + + + + + + EDKII REDFISH_PLATFORM_CONFI= G_PROTOCOL + + Sheet.65 + EDKII REDFISH_PLATFORM_CONFIG_PROTOCOL + + + + + + + EDKII REDFISH_PLATFORM_CONFI= G_PROTOCOL + + Sheet.67 + Other Platform-specific Implementations + + + + Other Platform-sp= ecific Implementations + + + + + Can.71 + EFI Variable/ FW Storage + + Sheet.72 + + + + + + + + + + + + EFI Variable/ FW Storage + + + + + + Can.73 + Other Storage + + Sheet.74 + + + + + + + + + + + + Other Storage <= /g> + + + 1-D double.76 + + + + + + + 1-D double.77 + + + + + + + Sheet.78 + + + + + + + + + + + + + + + Folded Corner + + + + + + + + Sheet.81 + + + + + + + + + + + + + + + + + + + + + + + Can.69 + EDK2 HII Database + + Sheet.83 + + + + + + + + + + + + EDK2 HII Database = + + + Sheet.84 + EDKII REDFISH_PLATFORM_CONFIG_PROTOCOL + + + + + + + EDKII REDFISH_PLATFORM_CONFIG_PROTOCOL + + 1-D double.75 + + + + + + + 1-D double.68 + + + + + + + + + + Sheet.87 + EDK2 Open Source Implementation + + + + EDK2 Open Source = Implementation + + 1-D double.88 + + + + + + + 1-D double.89 + + + + + + + Curve connect 1.61 + + + + + + + + + Curve connect 1.62 + + + + + + + + + Curve connect 2.54 + + + + + + + Sheet.96 + Script-generated EDK2 Redfish Collection Driver + + + + Script-generated = EDK2 Redfish Collection Driver + + Rounded Rectangle.98 + EDK2 HII UNI file #string STR_OPTION_A #language x-uefi-redfi..= . + + + + + + + + + + + + + + + + + + + + + + EDK2 HII UNI = file#string STR_OPTION_A #language x-uefi-redfish-SCHEMA.VERSION =E2=80=9C/SCHEMA/PropertyA=E2=80=9D #string STR_OPTION_B #language x-uefi-redfish-SCHEMA.VERSION =E2=80=9C/SCHEMA/PropertyB=E2=80=9D#string STR_OPTION_C #language x-uefi-redfish-SCHEMA.VERSION =E2=80=9C/SCHEMA/PropertyC=E2=80=9D + + Rounded Rectangle.100 + EDK2 HII VFR Form Option A Enabled Option B Disabled Option C..= . + + + + + + + + + + + + + + + + + + + + + + EDK2 HII VFR Fo= rmOption A EnabledOption B DisabledOption C <= tspan + class=3D"st53">0x16 + + Rounded Rectangle.101 + EDK2 HII VFR Form Option A Enabled Option B Disabled Option C..= . + + + + + + + + + + + + + + + + + + + + + + EDK2 HII VFR Fo= rmOption A EnabledOption B DisabledOption C <= tspan + class=3D"st53">0x16 + + Rounded Rectangle + EDK2 HII VFR Form Option A Enabled Option B Disabled Option C..= . + + + + + + + + + + + + + + + + + + + + + + EDK2 HII VFR Fo= rmOption A EnabledOption B DisabledOption C 0x16 <= /g> + + Curve connect 1.110 + + + + + + + + + Sheet.122 + [1] + + + + [1] + + Sheet.123 + [2] + + + + [2] + + Sheet.124 + [3] + + + + [3] + + Sheet.125 + [4] + + + + [4] + + Sheet.126 + [5] + + + + [5] + + Sheet.127 + [6] + + + + [6] + + Sheet.128 + [8] + + + + [8] + + Sheet.129 + [9] + + + + [9] + + Curve connect 2.132 + + + + + + + Sheet.133 + Script-generated EDK2 Redfish client driver/library based on ..= . + + + + Script-generated = EDK2 Redfish client driver/library based on the standard Redfish schemas published by DMTF + + Rectangle.134 + + + + + + + Sheet.135 + Script-generated code + + + + Script-generated = code + + Rectangle.137 + + + + + + + Sheet.138 + UEFI/EDK2 open source + + + + UEFI/EDK2 open sou= rce + + Configure + + + + + + + + Side to top/bottom.145 + + + + + + + + Bottom to top fixed 2 + + + + + + + + + + + Side to top/bottom + + + + + + + + Sheet.152 + [10] + + + + [10] + + Sheet.153 + EDK2 Build Tool + + + + EDK2 Build Tool + + Curve connect 2 + + + + + + + Sheet.154 + [7] + + + + [7] + + + + + + + + --=20 2.17.1