From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 25899D80A38 for ; Tue, 28 Nov 2023 07:08:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=aPKERPSijPtS4ndV2pEa7gFLZ/zNjQUigrQQAa6csR4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1701155317; v=1; b=dgxjheI7UbolpCC+GStwfN3ILaql3dAdOTXlvqv1Kz1a2WfIJMaRuivEEoAtQ0RPedXIe+Hx y7FTX/dcDG4mq99pZwO1k84S6cIG8xFzcegh9yUyI4en/mGfMv6O/fiTurUtIUvaz2x72Uca8OY u7FJQAs1en4c8PeUkYRwOcFE= X-Received: by 127.0.0.2 with SMTP id VOnTYY7687511xg9cKUN5ghL; Mon, 27 Nov 2023 23:08:37 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.78]) by mx.groups.io with SMTP id smtpd.web10.27419.1701155316556676530 for ; Mon, 27 Nov 2023 23:08:36 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ScoI/pI77SSnJnFzoY7E1CktUDaXu3OcNWjqOt5DskKfs9CDESq9la9ir7zovcITjHXWEBMsrUF8As2DBPDONGVCHLa8H/rXgL35qywtayNBaEvqewTAaERxO5rU0iFmU6cmM147oiNjVB5114ZHrVpjtCeyXZh3m5iO7PqNsczmUWYpQj/GTs4mlFB+i4eZ357E9KPAfG6UwFZ7+8lVaGotCwThAeGX94Qn4DlIKko0ad88xB/Wv4e8Ts423KaLbD3TLy8nPF6tYCnR+QHxJxGxOznlouVYMOgs5/PJ4nypjWAPHD5Y2dV6kdSc7zXkwL/e4uakx0/3zOx/w9jNfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jcAvLnLfmXCYJxarhoG5ap3JABdPmM/gd2M8KUnxnnA=; b=hbenAksAMkTW3Eo7LEX2jX1AQX12wcNJSuJXt66psha7mgR+3lAcMiBjykh2s1HFOWmIViylhfaq35U9ikLh4xtT3U2qnP1nXBPL8jqjbSa8TlipAjfkH83AdxX7xo0jd7F1zfBD9kbH2P+VJ1Sno92BVH5FJbEqta3rHnYY/g5c0sVHrtom1PudGwwemPdYggekFRRJiOuOHDzXntB+Wk/XZ8aarSymtEiXORDaAKrnH/u9twGSpztMMRCumPK25YC7XAyY3AAmNZKgqODcnM1mPoAIv+oGWzUNW72cRUwhUZZwequF7NCSZ+yVwJmcyVBHcXCvWnpsl5rn0Wy25g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by BL1PR12MB5269.namprd12.prod.outlook.com (2603:10b6:208:30b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29; Tue, 28 Nov 2023 07:08:33 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05%5]) with mapi id 15.20.7025.022; Tue, 28 Nov 2023 07:08:33 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 3/6] RedfishClientPkg: feature driver enhancement. Thread-Topic: [edk2-redfish-client][PATCH 3/6] RedfishClientPkg: feature driver enhancement. Thread-Index: AQHaHhooiS7PuH83LEq3tkXv/IlkZ7CPGMOQgAA2QdCAAAfqoA== Date: Tue, 28 Nov 2023 07:08:33 +0000 Message-ID: References: <20231123143403.3388-1-nicklew@nvidia.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=a6594a7f-31e5-4cde-8583-dd9e7f3e78ea;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-11-28T03:25:06Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|BL1PR12MB5269:EE_ x-ms-office365-filtering-correlation-id: 79542d0a-3994-45b8-a16e-08dbefe0d55d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: nFN/EqxSYQbbx1cg566EZTXHpLrurHWk1yFep/g5BH/9JWW80dkSrEYE8+dYXO9Px+8l3LofQ25qcDTfmGtIYAZmmTaV8R3e71MXmhy/Mtd54MNqDPKSl/Gn8vXIeDcckKHaEkWlhQ+7ce4t++7K9a+vRiT5gu36xgHOxN0qun4ZWWG9dNdwObyDxwVAsqzGgYmyt8Kpjo6uEVMPSwcIrspr1/cwLfSFkyK3daa2nhFU6gDM8uX1Sm1jSNXsG1d72A6vK+PqXhwLsqbr/JXkyLY9De9HuhYcjqpjsIZmLKOdO6naVriZoq0KeORDO9K6FvnYOCk9aIs/AkesaZ4QbeU9+492YQq+MHVPxQr0ilZ2IRVHoCiYfw3CYTJdyPK9zuuQvo8f8UeVotzSLGMNKKPfWN2Iao0YFmvFqz/ClSTNSoC/cxEzr/49UYwTaUndx2UH3jIU5pjb+B6pWbdMdCp/HB03VPg+oNxi2cEJzG71grp07H/QijCG9rqKekTxk+jcVbAjwr7MWHSHVBlCITbNXS9kRiu5JdTpBWuGHe8dFTRbxrWPvdlP8l2OzjztM+Ul+6JWyON3xHPHLSzWRIijtCI5NOzSyrFtiKs/bQ2kZuMonUIb9dEzllkmpnhO8+DPecyPeznPdBhOH1OejrdZ3Qjs4IxMI+5Kir+Vea4= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?A13M50po8IPyvlQonf5xLiVXOZD5PLRLfwxXneBYv9Uo0JGlhMJ+H89ZJnIT?= =?us-ascii?Q?vxcMwXixlIGG16unRlefuFroffPaMVUS4OGkhI/vwS08n0FqO/82Nl5B6krl?= =?us-ascii?Q?P4Q2y7kLS5bA7gmwryQB1rd6x4RkekgTcuKb05sTOD98xAUW9cgXZMUZHbZ8?= =?us-ascii?Q?BpHy5Pq7Yh3PSXbE5euR/350dqki1ycJurqR0nKS680+bFoKuUgVNaZbYD3X?= =?us-ascii?Q?vRTbaaQuFIU6dDX7y5GUWzDUMVGvvOx46Xf6aQcqufKczZkCZxAoILS1SxY6?= =?us-ascii?Q?gyMpDNNfmFdvt8j5UCS5OsHTRZ5kRIPgpZOoe7aMQF5/kUJPeo05W24JDJs0?= =?us-ascii?Q?slwEhUA7IUkydWBO60zRpXL7i2RVwdeh1QAFfC5YeC9ituD9E5eTzqYTL/Gd?= =?us-ascii?Q?BIjmifhp+e8yIfaYDczJlCE6ulHyvY0MAEr3EL3Tq9yFWx/Ioa9E5APMzH+H?= =?us-ascii?Q?Eowa3Fhwi1UK5wWSdeVH4O8L0yBjBy4lxnTMjMUdbaCsxwvT3Oa8zYOnvx9Q?= =?us-ascii?Q?eYm1lCfhDzrVIOglDBOr5iIvI4Vqil5uEXkSAPqx0A8LXqvSgLm+aoi4IE0Y?= =?us-ascii?Q?rmy0hAGWH8l8ELOBOUgmrsAwpQRD2kFXLq4WuYf2zLBSvzFBu4qyXD1D/Iuv?= =?us-ascii?Q?XWggQ4kTBAhU45+9Y3RMjSsVXOdlP5ffy/ccE7emTcpHlGWKwdkhuLU+VpbO?= =?us-ascii?Q?FTbv2Av+0G0Finxl77UgveOJVoULMWIg7NG3j9GOUzjx77IpML46CoGU4Mxu?= =?us-ascii?Q?WoPAGYh2V9EuqZJpy6T+Jz77SBZKTACd81LSOxqkP5JMLbCLINsIOMEcBeed?= =?us-ascii?Q?SKP6v1F0Wr3XbI20Q1/pPr6VHbk3zXWUpcrGqBroCYAtFsJXXNUqyeAyabKO?= =?us-ascii?Q?vubOEcXgpzPsqbe27hRVoDDpCWWl7AQS+373hnmSEnIXbPRsMjfO43sLcsVu?= =?us-ascii?Q?tzIDjQWCxWhqd87IEH0unLadM77bqmWOzfbNnHTuuIPJRnZ6NWrAKbDxahVa?= =?us-ascii?Q?nkHkXEgUl1eVeOpJTprzt1pRFx6MwdWwVUa+QweLRQMMGAqpdeubysX9KxYR?= =?us-ascii?Q?Q5633qbSQYuhtmkRM3ZNOyXfXK/sD225IcpRwqG4fOrK1FZ31jTpC+M+S0UL?= =?us-ascii?Q?9xX6PlzPUHOyWMDX7tfI1C7ErSDVnyMQr2o6StlA3DQYkw0w2E9Y5MqABoAy?= =?us-ascii?Q?lgBEvnlwBl4TptjN6SNImUqi9RiekqQLAHA0KzEcPiNxc+yEvfwvipwPFdvl?= =?us-ascii?Q?gyqyQqY23dkCJ4M7jLdv44R+8OOJqokM9+w5W4IkVIONlyQ8eyWh//s1rMz8?= =?us-ascii?Q?fq90gbi/EzM8nBWAoHW1xQibsY4FoYsV5EHnXezE9xYspCfmac2PiFDWJmbW?= =?us-ascii?Q?atEfoliMpmaZGYxe6/WLbGcKyQd8CcbDRp1VcTxrudY/vzNuSq33C/n3fCbk?= =?us-ascii?Q?GKMPuDCuyX9yH7TvgBHE5B+qB3CX+tViSwHCd9kxyZLqdWh7tMtOPdX9LvSy?= =?us-ascii?Q?MWOkV0OEXZK10AmrxCXM6tL0vKdyKajR3lVRIHOc6qeSrrreDOUTb6l4uabb?= =?us-ascii?Q?TaXW7QnRpxyct89rNRT4OuTd0C7b1zsLWTY2DW9E?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79542d0a-3994-45b8-a16e-08dbefe0d55d X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2023 07:08:33.4294 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2krKmTsf73fNWOL1QpWbT/3AKLW0RIWv9uStlAxibdytHVtnJ+2/QlytXMdZchfV8CEph5+OHStOzxXZA90jTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5269 Precedence: Bulk 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@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: krxI3OQaw0QLAFSfoPw9BgEqx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=dgxjheI7; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") [AMD Official Use Only - General] Thanks Nickle, I just created BZ #4608 to track this TODO item. For this patch, Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Tuesday, November 28, 2023 2:44 PM > To: Chang, Abner ; devel@edk2.groups.io > Cc: Igor Kulchytskyy ; Nick Ramirez > Subject: RE: [edk2-redfish-client][PATCH 3/6] RedfishClientPkg: feature d= river > enhancement. > > [AMD Official Use Only - General] > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Hi Abner, > > Thanks for your review. Please find my comment below. > > > This may spend some time on network to get the whole resource from URI = if > the > > resource size is big, but we just need the information of ETAG header. = We can > > think of using HEAD HTTP method. > > However, this seems fine for now as the following code gets the pending > settings > > from the same HTTP response body retrieved above. > > The worst case would be there is no pending setting, however we waste > network > > bandwidth to get the whole response body. Not sure if HTTP query $selec= t > can > > improve this or not for retrieving pending setting annotation. > > Yes, it is good idea to use HTTP HEAD method to get ETag and save the > bandwidth. "$select" may reduce the data size but it may increase the loa= ding > of BMC while BMC is doing filtering. > > HTTP HEAD relies on BMC support, and it seems to me that OpenBMC does > not support HTTP HEAD yet. Let's put this to our to-do list and implement > HTTP HEAD function while we have this support in BMC. > > Thanks, > Nickle > > > -----Original Message----- > > From: Chang, Abner > > Sent: Tuesday, November 28, 2023 12:05 PM > > To: Nickle Wang ; devel@edk2.groups.io > > Cc: Igor Kulchytskyy ; Nick Ramirez > > > Subject: RE: [edk2-redfish-client][PATCH 3/6] RedfishClientPkg: feature > driver > > enhancement. > > > > External email: Use caution opening links or attachments > > > > > > [AMD Official Use Only - General] > > > > > -----Original Message----- > > > From: Nickle Wang > > > Sent: Thursday, November 23, 2023 10:34 PM > > > To: devel@edk2.groups.io > > > Cc: Chang, Abner ; Igor Kulchytskyy > > > ; Nick Ramirez > > > Subject: [edk2-redfish-client][PATCH 3/6] RedfishClientPkg: feature > > > driver enhancement. > > > > > > Caution: This message originated from an External Source. Use proper > > > caution when opening attachments, clicking links, or responding. > > > > > > > > > -Fix typo (include function RedfisSetRedfishUri and parameter > > > MaxLengthConfigLang) > > > -Add more debug message. > > > -Do not save ETag to variable every time when new ETag is created in > > > SetEtagWithUri(). > > > -Introduce SetEtagFromUri() to get ETag from BMC and save it in > > > variable. > > > -Introduce GetPendingSettings() to check and see if Redfish pending > > > settings is supported or not. > > > > > > Signed-off-by: Nickle Wang > > > Cc: Abner Chang > > > Cc: Igor Kulchytskyy > > > Cc: Nick Ramirez > > > --- > > > .../Library/RedfishFeatureUtilityLib.h | 81 ++++++-- > > > .../Features/Bios/v1_0_9/Common/BiosCommon.c | 4 +- > > > .../v1_5_0/Common/ComputerSystemCommon.c | 4 +- > > > .../Memory/V1_7_1/Common/MemoryCommon.c | 4 +- > > > .../RedfishFeatureUtilityLib.c | 192 ++++++++++++++++= +- > > > 5 files changed, 253 insertions(+), 32 deletions(-) > > > > > > diff --git > > > a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > > > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > > > index e2f728b2..6347585c 100644 > > > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > > > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > > > @@ -22,7 +22,7 @@ > > > > > > Read redfish resource by given resource URI. > > > > > > - @param[in] Service Redfish srvice instacne to make query. > > > + @param[in] Service Redfish service instance to make query. > > > @param[in] ResourceUri Target resource URI. > > > @param[out] Response HTTP response from redfish service. > > > > > > @@ -47,7 +47,7 @@ GetResourceByUri ( > > > @param[out] ArraySignatureClose String to the close of array > signature. > > > > > > @retval EFI_SUCCESS Index is found. > > > - @retval EFI_NOT_FOUND The non-array configure languag= e string > is > > > retured. > > > + @retval EFI_NOT_FOUND The non-array configure languag= e string > is > > > returned. > > > @retval EFI_INVALID_PARAMETER The format of input ConfigureLa= ng > is > > > wrong. > > > @retval Others Errors occur. > > > > > > @@ -118,10 +118,10 @@ GetNumberOfRedpathNodes ( > > > > > > @param[in] NodeString The node string to parse. > > > @param[in] Index Index of the node. > > > - @param[out] EndOfNodePtr Pointer to receive the poitner = to > > > + @param[out] EndOfNodePtr Pointer to receive the pointer = to > > > the last character of node stri= ng. > > > > > > - @retval EFI_STRING the begining of the node string= . > > > + @retval EFI_STRING the beginning of the node strin= g. > > > > > > **/ > > > EFI_STRING > > > @@ -140,7 +140,7 @@ GetRedpathNodeByIndex ( > > > @param[out] Index The array index number. > > > > > > @retval EFI_SUCCESS Index is found. > > > - @retval EFI_NOT_FOUND The non-array configure languag= e string > is > > > retured. > > > + @retval EFI_NOT_FOUND The non-array configure languag= e string > is > > > returned. > > > @retval EFI_INVALID_PARAMETER The format of input ConfigureLa= ng > is > > > wrong. > > > @retval Others Errors occur. > > > > > > @@ -188,9 +188,9 @@ DestroyConfiglanguageList ( > > > > > > @param[in] DestConfigLang Pointer to the node's configure = language > > > string. > > > The memory pointed by ConfigLang= must be allocated > > > - through memory allocation interf= ace. Becasue we will > > > replace > > > + through memory allocation > > > + interface. Because we will > > > replace > > > the pointer in this function. > > > - @param[in] MaxtLengthConfigLang The maximum length of > ConfigLang. > > > + @param[in] MaxLengthConfigLang The maximum length of > ConfigLang. > > > @param[in] ConfigLangInstance Pointer to Collection member ins= tance. > > > > > > @retval EFI_SUCCESS The instance is inserted to the config= ure > language. > > > @@ -200,7 +200,7 @@ DestroyConfiglanguageList ( EFI_STATUS > > > SetResourceConfigLangMemberInstance ( > > > IN EFI_STRING *DestConfigLang, > > > - IN UINTN MaxtLengthConfigLang, > > > + IN UINTN MaxLengthConfigLang, > > > IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *ConfigLangInstance > > > ); > > > > > > @@ -244,7 +244,7 @@ ApplyFeatureSettingsStringType ( > > > > > > /** > > > > > > - Apply property value to UEFI HII database in numric type. > > > + Apply property value to UEFI HII database in numeric type. > > > > > > @param[in] Schema Property schema. > > > @param[in] Version Property schema version. > > > @@ -356,7 +356,7 @@ ApplyFeatureSettingsNumericArrayType ( > > > @param[in] Schema Property schema. > > > @param[in] Version Property schema version. > > > @param[in] ConfigureLang Configure language refers to this proper= ty. > > > - @param[in] ArrayHead Head of Redfich CS boolean array value. > > > + @param[in] ArrayHead Head of Redfish CS boolean array value. > > > > > > @retval EFI_SUCCESS New value is applied successfully. > > > @retval Others Errors occur. > > > @@ -421,19 +421,19 @@ CreatePayloadToPatchResource ( > > > @param[in] ConfigLang ConfigLang to save > > > @param[in] Uri Redfish Uri to save > > > > > > - @retval EFI_INVALID_PARAMETR SystemId is NULL or EMPTY > > > + @retval EFI_INVALID_PARAMETER SystemId is NULL or EMPTY > > > @retval EFI_SUCCESS Redfish uri is saved > > > > > > **/ > > > EFI_STATUS > > > -RedfisSetRedfishUri ( > > > +RedfishSetRedfishUri ( > > > IN EFI_STRING ConfigLang, > > > IN EFI_STRING Uri > > > ); > > > > > > /** > > > > > > - Get the property name by given Configure Langauge. > > > + Get the property name by given Configure Language. > > > > > > @param[in] ResourceUri URI of root of resource. > > > @param[in] ConfigureLang Configure Language string. > > > @@ -527,6 +527,25 @@ PropertyChecker ( > > > IN BOOLEAN ProvisionMode > > > ); > > > > > > +/** > > > + This function query ETag from given URI string and keep it in data= base. > > > + > > > + @param[in] Service Redfish service instance to make= query. > > > + @param[in] Uri URI to query ETag. > > > + @param[in] CheckPendingSettings Set this to true and > > > + @Redfish.Settings > > > will > > > + be handled together. FALSE other= wise. > > > + > > > + @retval EFI_SUCCESS ETAG and URI are applied successfully. > > > + @retval Others Errors occur. > > > + > > > +**/ > > > +EFI_STATUS > > > +SetEtagFromUri ( > > > + IN REDFISH_SERVICE *RedfishService, > > > + IN EFI_STRING Uri, > > > + IN BOOLEAN CheckPendingSettings > > > + ); > > > + > > > /** > > > > > > Keep ETAG string and URI string in database. > > > @@ -576,7 +595,7 @@ GetOdataId ( > > > > > > /** > > > > > > - Return config language from given URI and prperty name. It's call > > > responsibility to release returned buffer. > > > + Return config language from given URI and property name. It's call > > > responsibility to release returned buffer. > > > > > > @param[in] Uri The URI to match > > > @param[in] PropertyName The property name of resource. This is > optional. > > > @@ -790,7 +809,7 @@ MatchPropertyWithJsonContext ( > > > > > > /** > > > > > > - Create string array and append to arry node in Redfish JSON conver= t > format. > > > + Create string array and append to array node in Redfish JSON > > > + convert > > > format. > > > > > > @param[in,out] Head The head of string array. > > > @param[in] StringArray Input string array. > > > @@ -809,7 +828,7 @@ AddRedfishCharArray ( > > > > > > /** > > > > > > - Create numeric array and append to arry node in Redfish JSON > > > convert format. > > > + Create numeric array and append to array node in Redfish JSON > > > + convert > > > format. > > > > > > @param[in,out] Head The head of string array. > > > @param[in] NumericArray Input numeric array. > > > @@ -828,7 +847,7 @@ AddRedfishNumericArray ( > > > > > > /** > > > > > > - Create boolean array and append to arry node in Redfish JSON > > > convert format. > > > + Create boolean array and append to array node in Redfish JSON > > > + convert > > > format. > > > > > > @param[in,out] Head The head of string array. > > > @param[in] BooleanArray Input boolean array. > > > @@ -871,7 +890,7 @@ CompareRedfishStringArrayValues ( > > > Check and see if value in Redfish numeric array are all the same a= s the one > > > from HII configuration. > > > > > > - @param[in] Head The head of Redfish CS numeraic array. > > > + @param[in] Head The head of Redfish CS numeric array. > > > @param[in] NumericArray Input numeric array. > > > @param[in] ArraySize The size of NumericArray. > > > > > > @@ -914,9 +933,9 @@ CompareRedfishBooleanArrayValues ( > > > This is just a simple check. > > > > > > @param[in] RedfishVagueKeyValuePtr The vague key value sets o= n > > > Redfish service. > > > - @param[in] RedfishVagueKeyValueNumber The numebr of vague key > > > value sets > > > + @param[in] RedfishVagueKeyValueNumber The number of vague key > > > value sets > > > @param[in] ConfigVagueKeyValuePtr The vague configuration on > > > platform. > > > - @param[in] ConfigVagueKeyValueNumber The numebr of vague key > value > > > sets > > > + @param[in] ConfigVagueKeyValueNumber The number of vague key > value > > > sets > > > > > > @retval TRUE All values are the same. > > > FALSE There is some difference. > > > @@ -949,4 +968,26 @@ GetEtagAndLocation ( > > > OUT EFI_STRING *Location OPTIONAL > > > ); > > > > > > +/** > > > + > > > + Check and see if "@Redfish.Settings" exist in given Payload. If > > > + found, return > > > the > > > + payload and URI to pending settings. Caller has to release > "SettingPayload" > > > and > > > + "SettingUri". > > > + > > > > > + @param[in] Payload Payload that may contain "@Redfish.Set= tings" > > > + @param[out] SettingPayload Payload keeps pending settings. > > > + @param[out] SettingUri URI to pending settings. > > > > > > Missed Doxgen tag for RedfishService. > > Please also update the function header of GetPendingSettings in C sourc= e > file. > > > > > + > > > + @retval EFI_SUCCESS Pending settings is found and returned= . > > > + @retval Others Error happens > > > + > > > +**/ > > > +EFI_STATUS > > > +GetPendingSettings ( > > > + IN REDFISH_SERVICE RedfishService, > > > + IN REDFISH_PAYLOAD Payload, > > > + OUT REDFISH_RESPONSE *SettingResponse, > > > + OUT EFI_STRING *SettingUri > > > + ); > > > + > > > #endif > > > diff --git > a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > > > b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > > > index f96c90cc..98288d66 100644 > > > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > > > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > > > @@ -338,7 +338,7 @@ ProvisioningBiosResource ( > > > // Keep location of new resource. > > > // > > > if (NewResourceLocation !=3D NULL) { > > > - RedfisSetRedfishUri (ConfigureLang, NewResourceLocation); > > > + RedfishSetRedfishUri (ConfigureLang, NewResourceLocation); > > > } > > > > > > // > > > @@ -745,7 +745,7 @@ RedfishIdentifyResourceCommon ( > > > // > > > // Keep URI and ConfigLang mapping > > > // > > > - RedfisSetRedfishUri (ConfigLangList.List[0].ConfigureLang, Priva= te- > >Uri); > > > + RedfishSetRedfishUri (ConfigLangList.List[0].ConfigureLang, > > > + Private->Uri); > > > // > > > // Set the configuration language in the > > > RESOURCE_INFORMATION_EXCHANGE. > > > // This information is sent back to the parent resource (e.g. th= e > > > collection driver). > > > diff --git > > > > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > > > SystemCommon.c > > > > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > > > SystemCommon.c > > > index 7ed1bd55..1ffb7d1d 100644 > > > --- > > > > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > > > SystemCommon.c > > > +++ > > > > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > > > SystemCommon.c > > > @@ -1274,7 +1274,7 @@ ProvisioningComputerSystemResource ( > > > // Keep location of new resource. > > > // > > > if (NewResourceLocation !=3D NULL) { > > > - RedfisSetRedfishUri (ConfigureLang, NewResourceLocation); > > > + RedfishSetRedfishUri (ConfigureLang, NewResourceLocation); > > > } > > > > > > // > > > @@ -1621,7 +1621,7 @@ RedfishIdentifyResourceCommon ( > > > // > > > // Keep URI and ConfigLang mapping > > > // > > > - RedfisSetRedfishUri (ConfigLangList.List[0].ConfigureLang, Priva= te- > >Uri); > > > + RedfishSetRedfishUri (ConfigLangList.List[0].ConfigureLang, > > > + Private->Uri); > > > // > > > // Set the configuration language in the > > > RESOURCE_INFORMATION_EXCHANGE. > > > // This information is sent back to the parent resource (e.g. th= e > > > collection driver). > > > diff --git > > > > a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c > > > > b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon. > > > c > > > index b7434036..4c41f16b 100644 > > > --- > > > > a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c > > > +++ > > > > b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon. > > > c > > > @@ -2190,7 +2190,7 @@ ProvisioningMemoryResource ( > > > // Keep location of new resource. > > > // > > > if (NewResourceLocation !=3D NULL) { > > > - RedfisSetRedfishUri (ConfigureLang, NewResourceLocation); > > > + RedfishSetRedfishUri (ConfigureLang, NewResourceLocation); > > > } > > > > > > // > > > @@ -2537,7 +2537,7 @@ RedfishIdentifyResourceCommon ( > > > // > > > // Keep URI and ConfigLang mapping > > > // > > > - RedfisSetRedfishUri (ConfigLangList.List[0].ConfigureLang, Priva= te- > >Uri); > > > + RedfishSetRedfishUri (ConfigLangList.List[0].ConfigureLang, > > > + Private->Uri); > > > // > > > // Set the configuration language in the > > > RESOURCE_INFORMATION_EXCHANGE. > > > // This information is sent back to the parent resource (e.g. th= e > > > collection driver). > > > diff --git > > > > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > > > c > > > > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > > > c > > > index 13e29902..753cd7b2 100644 > > > --- > > > > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > > > c > > > +++ > > > > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > > > c > > > @@ -107,6 +107,119 @@ GetArraykeyFromUri ( > > > return EFI_SUCCESS; > > > } > > > > > > +/** > > > + > > > + This function query ETag from given URI string and keep it in data= base. > > > + > > > + @param[in] Service Redfish service instance to make= query. > > > + @param[in] Uri URI to query ETag. > > > + @param[in] CheckPendingSettings Set this to true and > > > + @Redfish.Settings > > > will > > > + be handled together. FALSE other= wise. > > > + > > > + @retval EFI_SUCCESS ETAG and URI are applied successfully. > > > + @retval Others Errors occur. > > > + > > > +**/ > > > +EFI_STATUS > > > +SetEtagFromUri ( > > > + IN REDFISH_SERVICE *RedfishService, > > > + IN EFI_STRING Uri, > > > + IN BOOLEAN CheckPendingSettings > > > + ) > > > +{ > > > + EFI_STATUS Status; > > > + CHAR8 *Etag; > > > + CHAR8 *AsciiUri; > > > + REDFISH_RESPONSE Response; > > > + EFI_STRING PendingSettingUri; > > > + > > > + if ((RedfishService =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > > > + return EFI_INVALID_PARAMETER; > > > + } > > > + > > > + AsciiUri =3D NULL; > > > + Etag =3D NULL; > > > + PendingSettingUri =3D NULL; > > > + > > > + Status =3D RedfishLocateProtocol ((VOID **)&mEtagProtocol, > > > &gEdkIIRedfishETagProtocolGuid); > > > + if (EFI_ERROR (Status)) { > > > + DEBUG ((DEBUG_ERROR, "%a: fail to locate > > > gEdkIIRedfishETagProtocolGuid: %r\n", __func__, Status)); > > > + return Status; > > > + } > > > + > > > + Status =3D GetResourceByUri (RedfishService, Uri, &Response); > > This may spend some time on network to get the whole resource from URI = if > the > > resource size is big, but we just need the information of ETAG header. = We can > > think of using HEAD HTTP method. > > However, this seems fine for now as the following code gets the pending > settings > > from the same HTTP response body retrieved above. > > The worst case would be there is no pending setting, however we waste > network > > bandwidth to get the whole response body. Not sure if HTTP query $selec= t > can > > improve this or not for retrieving pending setting annotation. > > > > Abner > > > > > > > + if (EFI_ERROR (Status)) { > > > + DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", > > > + __func__, > > > Uri)); > > > + return Status; > > > + } > > > + > > > + // > > > + // Find etag in HTTP response header // Status =3D > > > + GetEtagAndLocation (&Response, &Etag, NULL); if (EFI_ERROR > > > + (Status)) { > > > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n"= , > > > __func__)); > > > + Status =3D EFI_NOT_FOUND; > > > + goto ON_RELEASE; > > > + } > > > + > > > + AsciiUri =3D StrUnicodeToAscii (Uri); if (AsciiUri =3D=3D NULL) { > > > + Status =3D EFI_OUT_OF_RESOURCES; > > > + goto ON_RELEASE; > > > + } > > > + > > > + // > > > + // Save ETag to variable. > > > + // > > > + Status =3D mEtagProtocol->Set (mEtagProtocol, AsciiUri, Etag); if > > > + (EFI_ERROR (Status)) { > > > + DEBUG ((DEBUG_ERROR, "%a: failed to set ETag %a -> %a\n", > > > + __func__, > > > Etag, AsciiUri)); > > > + } > > > + > > > + if (CheckPendingSettings && (Response.Payload !=3D NULL)) { > > > + // > > > + // Check to see if there is @Redfish.Settings > > > + // > > > + Status =3D GetPendingSettings ( > > > + RedfishService, > > > + Response.Payload, > > > + NULL, > > > + &PendingSettingUri > > > + ); > > > + if (!EFI_ERROR (Status)) { > > > + DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: > > > + %s\n", > > > __func__, PendingSettingUri)); > > > + > > > + Status =3D SetEtagFromUri (RedfishService, PendingSettingUri, = FALSE); > > > + } > > > + } > > > + > > > +ON_RELEASE: > > > + > > > + if (AsciiUri !=3D NULL) { > > > + FreePool (AsciiUri); > > > + } > > > + > > > + if (Etag !=3D NULL) { > > > + FreePool (Etag); > > > + } > > > + > > > + if (PendingSettingUri !=3D NULL) { > > > + FreePool (PendingSettingUri); > > > + } > > > + > > > + if (Response.Payload !=3D NULL) { > > > + RedfishFreeResponse ( > > > + Response.StatusCode, > > > + Response.HeaderCount, > > > + Response.Headers, > > > + Response.Payload > > > + ); > > > + } > > > + > > > + return Status; > > > +} > > > + > > > /** > > > > > > Keep ETAG string and URI string in database. > > > @@ -143,7 +256,6 @@ SetEtagWithUri ( > > > } > > > > > > mEtagProtocol->Set (mEtagProtocol, AsciiUri, EtagStr); > > > - mEtagProtocol->Flush (mEtagProtocol); > > > > > > FreePool (AsciiUri); > > > > > > @@ -505,6 +617,8 @@ ApplyFeatureSettingsVagueType ( > > > return EFI_INVALID_PARAMETER; > > > } > > > > > > + DEBUG ((REDFISH_DEBUG_TRACE, "%a: schema: %a %a config lang: %s > > > NumberOfVagueValues: %d\n", __func__, Schema, Version, > ConfigureLang, > > > NumberOfVagueValues)); > > > + > > > ConfigureLangAscii =3D AllocatePool (StrLen (ConfigureLang) + 1); > > > if (ConfigureLangAscii =3D=3D NULL) { > > > Status =3D EFI_OUT_OF_RESOURCES; > > > @@ -1473,7 +1587,7 @@ DestroyConfiglanguageList ( > > > The memory pointed by ConfigLang= must be allocated > > > through memory allocation > > > interface. Because we will replace > > > the pointer in this function. > > > - @param[in] MaxtLengthConfigLang The maximum length of > ConfigLang. > > > + @param[in] MaxLengthConfigLang The maximum length of > ConfigLang. > > > @param[in] ConfigLangInstance Pointer to Collection member ins= tance. > > > > > > @retval EFI_SUCCESS The instance is inserted to the config= ure > language. > > > @@ -1483,7 +1597,7 @@ DestroyConfiglanguageList ( EFI_STATUS > > > SetResourceConfigLangMemberInstance ( > > > IN EFI_STRING *DestConfigLang, > > > - IN UINTN MaxtLengthConfigLang, > > > + IN UINTN MaxLengthConfigLang, > > > IN REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG *ConfigLangInstance > > > ) > > > { > > > @@ -1508,14 +1622,14 @@ SetResourceConfigLangMemberInstance ( > > > if (ConfigLangInstance->ConfigureLang =3D=3D NULL) { > > > return EFI_INVALID_PARAMETER; > > > } else { > > > - StrCatS (*DestConfigLang, MaxtLengthConfigLang, > ConfigLangInstance- > > > >ConfigureLang); > > > + StrCatS (*DestConfigLang, MaxLengthConfigLang, > > > + ConfigLangInstance- > > > >ConfigureLang); > > > return EFI_SUCCESS; > > > } > > > } > > > > > > MaxStrLength =3D StrSize (ThisConfigLang) + StrSize > > > ((EFI_STRING)&InstanceStr); > > > NewConfigLang =3D ThisConfigLang; > > > - if (MaxtLengthConfigLang < MaxStrLength) { > > > + if (MaxLengthConfigLang < MaxStrLength) { > > > NewConfigLang =3D (EFI_STRING)AllocateZeroPool (MaxStrLength); > > > if (NewConfigLang =3D=3D NULL) { > > > DEBUG ((DEBUG_ERROR, "%a: Fail to allocate memory for > > > NewConfigLang.\n", __func__)); @@ -2191,7 +2305,7 @@ > GetConfigureLang > > > ( > > > > > > **/ > > > EFI_STATUS > > > -RedfisSetRedfishUri ( > > > +RedfishSetRedfishUri ( > > > IN EFI_STRING ConfigLang, > > > IN EFI_STRING Uri > > > ) > > > @@ -3524,6 +3638,72 @@ CompareRedfishBooleanArrayValues ( > > > return TRUE; > > > } > > > > > > +/** > > > + > > > + Check and see if "@Redfish.Settings" exist in given Payload. If > > > + found, return > > > the > > > + payload and URI to pending settings. Caller has to release > "SettingPayload" > > > and > > > + "SettingUri". > > > + > > > + @param[in] Payload Payload that may contain "@Redfish.Set= tings" > > > + @param[out] SettingPayload Payload keeps pending settings. > > > + @param[out] SettingUri URI to pending settings. > > > + > > > + @retval EFI_SUCCESS Pending settings is found and returned= . > > > + @retval Others Error happens > > > + > > > +**/ > > > +EFI_STATUS > > > +GetPendingSettings ( > > > + IN REDFISH_SERVICE RedfishService, > > > + IN REDFISH_PAYLOAD Payload, > > > + OUT REDFISH_RESPONSE *SettingResponse, > > > + OUT EFI_STRING *SettingUri > > > + ) > > > +{ > > > + CONST CHAR8 *RedfishSettingsUriKeys[] =3D { "@Redfish.Settin= gs", > > > "SettingsObject", "@odata.id" }; > > > + EDKII_JSON_VALUE JsonValue; > > > + UINTN Index; > > > + EFI_STATUS Status; > > > + > > > + if ((RedfishService =3D=3D NULL) || (Payload =3D=3D NULL) || > > > + (SettingResponse =3D=3D > > > NULL) || (SettingUri =3D=3D NULL)) { > > > + return EFI_INVALID_PARAMETER; > > > + } > > > + > > > + *SettingUri =3D NULL; > > > + JsonValue =3D RedfishJsonInPayload (Payload); > > > + > > > + // > > > + // Seeking RedfishSettings URI link. > > > + // > > > + for (Index =3D 0; Index < ARRAY_SIZE (RedfishSettingsUriKeys); Ind= ex++) { > > > + if (JsonValue =3D=3D NULL) { > > > + break; > > > + } > > > + > > > + JsonValue =3D JsonObjectGetValue (JsonValueGetObject (JsonValue)= , > > > RedfishSettingsUriKeys[Index]); > > > + } > > > + > > > + if (JsonValue !=3D NULL) { > > > + // > > > + // Verify RedfishSettings URI link is valid to retrieve resource= or not. > > > + // > > > + *SettingUri =3D JsonValueGetUnicodeString (JsonValue); > > > + if (*SettingUri =3D=3D NULL) { > > > + return EFI_NOT_FOUND; > > > + } > > > + > > > + Status =3D GetResourceByUri (RedfishService, *SettingUri, > SettingResponse); > > > + if (EFI_ERROR (Status)) { > > > + DEBUG ((DEBUG_ERROR, "%a: @Redfish.Settings exists, get > > > + resource > > > from: %s failed: %r\n", __func__, *SettingUri, Status)); > > > + return Status; > > > + } > > > + > > > + return EFI_SUCCESS; > > > + } > > > + > > > + return EFI_NOT_FOUND; > > > +} > > > + > > > /** > > > > > > Check and see if any difference between two vague value set. > > > -- > > > 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 (#111798): https://edk2.groups.io/g/devel/message/111798 Mute This Topic: https://groups.io/mt/102767544/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-