Skip to content

Latest commit

 

History

History
 
 

RedfishClientPkg

UEFI Redfish Client EDK2 Implementation

Introduction

UEFI Redfish Client EDK2 solution is implemented base on EDK2 Redfish Foundation, the implementation utilizes the EFI protocols provided by EDK2 Redfish Foundation to communicate with the Redfish service for creating, consuming, and updating the Redfish properties which are managed by firmware. This solution requests the instance of EFI REST EX Protocol through EFI Redfish Discover 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 options to the corresponding Redfish properties that are already defined in the standard Redfish schemas published by DMTF Redfish working group. 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 configuring platform reduces the overhead of Redfish client tools to have different implementations in order to compliant with OEM servers. The solution also reduces OEM-defined proprietary BIOS Attributes that lead to the divergence of platform configuration namings in Redfish BIOS Attribute Registry, however, 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. Associate Redfish property with HII option.

  • Provisioning of Firmware Managed Platform Redfish Resource

The current design of UEFI Redfish Client EDK2 Implementation can already support the provisioning of firmware-owned platform Redfish resource, however, 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.

UEFI Redfish Client Implementation

EFI EDK2 Redfish Client Framework

The functionality of each block in the diagrams are described in belwo sections,

EDK2 Redfish Foundation [1]

EDK2 Redfish Redfish Foundation provides the facilities of communicating with Redfish service. Such as the discovery of Redfish service, the credential to access Redfish service, EFI REST EX Protocol instance which is the transport layer to Redfish service, and so on. Please refer to EDK2 Redfish Foundation.

Redfish Profile Simulator [2]

Redfish Profile Simulator is an open source project on DMTF GitHub, which simulates the HTTP request methods (POST, PATCH, PUT, GET) on Redfish resource maintained by Redfish Profile Simulator. EDK2 open source 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 clone this project under RedfishClientPkg and maintain it by edk2 because this project 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 requirement on Redfish service, such as ETAG and HTTP POST support.
Another open source project of Redfish simulator is Redfish Interface Emulator, however, we don't pay much attention to this project because we have been dedicating to Redfish Profile Simulator since we started the UEFI Redfish EDK2 project.

EDK2 Redfish JSON Schema to C Structure Convertor [3]

This is the script auto-generated EDK2 drivers and libraries that provide the Redfish schema naming based JSON to C structure and vise versa converters. C structure is another representation of Redfish properties other than JSON and CSDL(XML). The higher layer Redfish client application can deal with C structure instead of using JSON library to manipulate Redfish properties. The script Redfish Schema C Struct Generator is still a private project on DMTF GitHub. Below is the reference of script auto-generated Redfish 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 29.7.3.

EDK2 Redfish Non-Collection [4] and Collection ***[5]

*** Feature Drivers EDK2 Redfish feature driver is an intermediary driver that sits between JSON Schema to C Structure converters and EFI Platform 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 settings from Redfish service to platform configurations, or vise versa to update platform configurations to Redfish service. Both EDK2 Redfish Non-Collection and Collection Feature drivers are script auto-generated base on Redfish schema naming. The EDK2 Redfish Non-Collection feature driver manages the resource of specific Resdifsh resource type, while the EDK2 Redfish Collection feature driver manages the members which have the same resource type in collection resource (e.g the ComputerSystem resource and ComputerSystemCollection resource) .

EDKII Redfish Platform Config Protocol [6]

EDKII Redfish Platform Config Protocol is an abstract driver that abstracts the platform configuration format and storage from EDK2 Redfish Feature driver. This protocol provides the interfaces to get and set platform configuration with the format and configuration storage agnostic to the Redfish feature driver. The platform can provide its own EDKII Redfish Platform Config driver instance to access platform-specific configuration format and storage. On EDK2 open 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,

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]

For those Non-EDK2 HII-based platform configuration formats, the driver instance can provide its own implementation to get or set the platform configurations.

EDKII Redfish Feature Core DXE Driver [12]

EDKII Redfish Feature Core DXE driver provides the protocol interface to the auto-generated Redfish feature driver to register itself for the Redfish resource URI it manages.

struct _EDKII_REDFISH_FEATURE_PROTOCOL {
  REDFISH_FEATURE_REGISTER      Register;
  REDFISH_FEATURE_UNREGISTER    Unregister;
};

Redfish Feature Core DXE driver records the URI according to the URI hierarchy, and then it starts up the Redfish feature drivers based on the hierarchy when the particular event [11] is triggered. This makes sure the upper-level Redfish resource is built up before the lower-level resource. For example, ComputerSystem resource must be ready before the Memory resource managed by MemoryCollection because the Memory resource is part of ComputerSystem resource.

Start-Up Event to Trigger EDKII Redfish Feature Core [11]

This is an EFI event for triggering EDKII Redfish Feature Core to travel URIs in the database and execute the callback that registered by Redfish feature drivers. The event GUID is defined in below PCD and is default set to gEfiEventReadyToBootGuid.

PcdEdkIIRedfishFeatureDriverStartupEventGuid

This PCD can be overridden to any events based on the platform implementation. EDKII Redfish Feature Core can be triggered earlier, for example before the BDS or in the early DXE phase if the platform provides the EFI REST EX protocol which is available before the BDS phase.

EDK2 HII VFR Form [8]

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 architectural style. On edk2 open source, the REST architectural style refers to the Redfish service. Besides EFI_HII_REST_STYLE_FORMSET_GUID is defined in the form scope, EFI_IFR_FLAG_REST_STYLE can be assigned to the HII options that indicate those options intend to interact with the REST service.

EDK2 HII UNI file [9]

x-uefi-redfish Configure Language is used in UNI file to associate HII option 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-redfish Language as in below,

x-uefi-redfish-$(NAMESPACE)
where $(NAMESPACE) is the combination of Redfish ResourceTypeName and schema 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,

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 to the property in Redfish resource
  • The root of path is the Redfish resource type indicated in x-uefi-redfish configure language
  • The path is relative to root of Redfish resource type, not related to Redfish service
  • root.

Examples,

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"
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"
Properties in collection object {NUM}:

#string STR_MEMORY_1_BASE_MODULE_TYPE_PROMPT  #language x_uefi_redfish_Memory.v1_7_1  "/Memory/{1}/BaseModuleType"
#string STR_MEMORY_2_BASE_MODULE_TYPE_PROMPT  #language x_uefi_redfish_Memory.v1_7_1  "/Memory/{2}/BaseModuleType"
#string STR_MEMORY_3_BASE_MODULE_TYPE_PROMPT  #language x_uefi_redfish_Memory.v1_7_1  "/Memory/{3}/BaseModuleType"

EDK2 Build Tool [10]

EDK2 Build is responsible to pull the necessary EDK2 Redfish JSON Schema to C Structure Convertors and EDK2 Redfish Feature drivers into edk2 build process according to the x-uefi-Redfish config language used in the HII VFR forms.

The Contributors

Chang, Abner abner.chang@hpe.com
Wang, Nickle nickle.wang@hpe.com
Chen, Aaron aaron.chen@hpe.com