Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redfish performance: support Redfish query parameter #47

Open
nicklela opened this issue Sep 5, 2023 · 0 comments
Open

Redfish performance: support Redfish query parameter #47

nicklela opened this issue Sep 5, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@nicklela
Copy link
Contributor

nicklela commented Sep 5, 2023

This is about to improve Redfish performance. This task focus on "7.3 Query parameters" in Redfish specification.

The idea is to use "$expand" to query Redfish collection at once and reduce the network communication between host and BMC. To do this, we have two tasks:

  1. Create RedfishFeaturesSupportedLib to check the protocol support capability by reading the attribute "ProtocolFeaturesSupported" defined in computer system schema.
  2. Enhance EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL. We don't have protocol revision filed defined EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL in the firs place. For backward compatibility, we have to create new protocol and fix this problem:
struct _EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2 {
  UINT32                                                                                                Revision;
  EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_PROVISIONING    Provisioning;
  EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_CONSUME         Consume;
  EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_UPDATE          Update;
  EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_CHECK           Check;
  EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_IDENTIFY        Identify;
  EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_GET_INFO        GetInfo;
}

And adding new parameter (JsonContext) to Provisioning, Consume, Update, Check and Identify so that collection driver uses "$expand" to get all instances and pass instance to non-collection driver. This is optional parameter and non-collection driver can check this parameter to see if non-collection driver has to download the context on its own or not.

/**
  Provising redfish resource by given URI.

  @param[in]   This                Pointer to EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance.
  @param[in]   Uri                 Target URI to create resource.
  @param[in]   HttpPostMode        TRUE if resource does not exist, HTTP POST method is used.
                                   FALSE if the resource exist but some of properties are missing,
                                   HTTP PUT method is used.

  @retval EFI_SUCCESS              Value is returned successfully.
  @retval Others                   Some error happened.

**/
typedef
EFI_STATUS
(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_PROVISIONING)(
  IN     EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2  *This,
  IN     EFI_STRING                              Uri,
  IN     CHAR8                                   *JsonContext OPTIONAL,
  IN     BOOLEAN                                 HttpPostMode
  );

/**
  Consume resource from given URI.

  @param[in]   This                Pointer to EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance.
  @param[in]   Uri                 The target URI to consume.

  @retval EFI_SUCCESS              Value is returned successfully.
  @retval Others                   Some error happened.

**/
typedef
EFI_STATUS
(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_CONSUME)(
  IN     EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2  *This,
  IN     EFI_STRING                              Uri,
  IN     CHAR8                                   *JsonContext OPTIONAL
  );

/**
  Update resource to given URI.

  @param[in]   This                Pointer to EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance.
  @param[in]   Uri                 The target URI to consume.

  @retval EFI_SUCCESS              Value is returned successfully.
  @retval Others                   Some error happened.

**/
typedef
EFI_STATUS
(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_UPDATE)(
  IN     EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2  *This,
  IN     EFI_STRING                              Uri,
  IN     CHAR8                                   *JsonContext OPTIONAL
  );

/**
  Check resource on given URI.

  @param[in]   This                Pointer to EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance.
  @param[in]   Uri                 The target URI to consume.

  @retval EFI_SUCCESS              Value is returned successfully.
  @retval Others                   Some error happened.

**/
typedef
EFI_STATUS
(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_CHECK)(
  IN     EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2  *This,
  IN     EFI_STRING                              Uri,
  IN     CHAR8                                   *JsonContext OPTIONAL
  );

/**
  Identify resource on given URI.

  @param[in]   This                Pointer to EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL instance.
  @param[in]   Uri                 The target URI to consume.

  @retval EFI_SUCCESS              This is target resource which we want to handle.
  @retval EFI_UNSUPPORTED          This is not the target resource.
  @retval Others                   Some error happened.

**/
typedef
EFI_STATUS
(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2_IDENTIFY)(
  IN     EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL2  *This,
  IN     EFI_STRING                              Uri,
  IN     CHAR8                                   *JsonContext OPTIONAL
  );
@nicklela nicklela added the enhancement New feature or request label Sep 5, 2023
@nicklela nicklela self-assigned this Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant