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 DAAC0D80A5F for ; Tue, 28 Nov 2023 06:44:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=saHNRmxb2Dsb4ezNZQJwruCjhxB+YMinjJbuUCLd1Gg=; 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=1701153856; v=1; b=mwvxmWCA60KdxGclAyAr344dB6V9y2zQ0xo9KTivuf6kNcyA2+svEjnvs0boLkH3NZqBbFL/ f7Ne9qDMr8THTB5N7yXXQyuhnHtie+347g6+Tjr3mjnDqrIhA2WNHg9CW6H7gzbM9NIt/HP0qvD CuQ9wtdv/SnZQvwOCjRjjvKM= X-Received: by 127.0.0.2 with SMTP id kG20YY7687511xoutjeRjlVr; Mon, 27 Nov 2023 22:44:16 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.49]) by mx.groups.io with SMTP id smtpd.web10.27207.1701153850913920575 for ; Mon, 27 Nov 2023 22:44:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=geH26VrkT/k165py/X54rLO1zjZ2s3u7WdBRWg7ZHMN36t/Aywh6/N0lV7ooHPF4J4tiFszudKkYwREaSlehoioSjqaJkKDIgQlBp3zwKJ2dDX4u6w5yLVYp3kgaR9YlUaIOei+KACHqhFXqzx7R5wXyBSDprW8b+8rwdbF/WzmWAn5dEvmX+xW7PQfVwJJjQJWOO4/VPNcJ8Qe3CYJG+UigAhqb6Tz2IR8eLRuetM/woeJyDImcmQO2CZqZKJpo3nMaX5LXWBQ7q5/IG366th0pduKgqPrz+mGjUdKyTsaOqXb65/+SnS+yiVu5dGzRsglWnx3jwNbJEuk9dJmb0A== 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=FVfc4eWYz2iJ1O50LjyUEOnr5UU3W4+eXabBplNGpQU=; b=gdPYlS2wP/bHtld+qExS/7MGlaptmN1M9h4tYxk1azCBEh9Ch38KwI6B08Au2JlvjDLcDaHmdCLIzht7XLCqAeA0OaJsXmOlrtHIdF5nlLeNi58/91iu/Lh9e3fbZYWxJA04swfA+z+cOD1ULwMfM76VUrOye4M9ciPdkUJeFmiJNtV638kORCUNXpQtE2ZEXdbhBVLMFG5XSCMdr/3KVSInVMxz2b6XkLJYTXbuww29j5rOEQhyf1IMP8rqLhBalRbyVfaPDUY96b7NdH7Xta0yc8b3jnRz5iKGRJY14OY7knO1RG1evj3z+EyE7jn+hV3iA9Kjjdaz79VQzCcDhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by SJ0PR12MB6928.namprd12.prod.outlook.com (2603:10b6:a03:47a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Tue, 28 Nov 2023 06:44:05 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::a78e:602e:415c:4cb4]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::a78e:602e:415c:4cb4%3]) with mapi id 15.20.7025.022; Tue, 28 Nov 2023 06:44:05 +0000 From: "Nickle Wang via groups.io" To: "Chang, Abner" , "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/IlkZ7CPGMOQgAA2QdA= Date: Tue, 28 Nov 2023 06:44:04 +0000 Message-ID: References: <20231123143403.3388-1-nicklew@nvidia.com> In-Reply-To: Accept-Language: en-US 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: MW4PR12MB7031:EE_|SJ0PR12MB6928:EE_ x-ms-office365-filtering-correlation-id: 369eabb8-f6e0-40f3-563c-08dbefdd6a21 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: kR4s2t1mXzuA5F7ZdI41liwNLn2cT4xBdPEjy+7FHvBX87qGnzwwboylHOrE2JoKHdTX6BO2vLWfgPTzybnKVDvKKttwDCZCXu+SDAgVn0y29AjcX2jacKOjQT9y7kxzObTwRRLJ4n6Xh0UGLvF5IHPvjsTsmvHA2Ggny7AJwd8qg2/t35QhVwkzI77/ONkNTH0ouHYdN5TTNA8QMam1y4CFjLOWbNcOi+qVX8vHEErR7XxkQoqYoZD330+B4n0ebhCcM6A5D9DWBinMn43ydvnjC4AXxa8kMsrdVDISyjL2wD1aFdyOqQPvpd1emk1N2sWVRVjl66Ez/mm4piMhwrehobpItv/3aDGH9Y4El28E7YbjkMCZS/YB3Qx9tMgP5ihyJxXgGZgbxyT8IhpWs3NBi/ffJRERv+7FhxzG9EyLV/7WSCxp78iNnltN/jiFru1yHqYVrdqpFbq72fvxdbWRvsDt6DO7P5y7oQLmwLmkinXtSbxBZZ4g8Q/dfujWckbWw+fiMogHe96+R+mcsZ/uJNeIwBngRIujYxk69aM8sMSIZBOV7sMTCMbZwZ2EYjocBisS4Ng4pdkP+1FwCgLvemQbLvMgPTMtJKtLzNZ/cZgJHjyUrwgPT34OcuBUQiuefIvJP3VHRBYgxBUtUs9m3kIYoVDFbp1L058FZOw= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?HPM+UqV5GLqDZ4lG9CO53Adr+NVHSVU3M3KzoJ3kCbeRG9wtYzxzPWLdm3/7?= =?us-ascii?Q?4J/HVNH9Xn9jUDPHkJxgM8ip8huJFHRy1hIkNt0DZDBEL8MSMpyMjeWQcD/N?= =?us-ascii?Q?bbNwLwxamarWYSB2Mb2JX68ak4Dg60JYgCJnAX9mYcnmLrRM8PVesNBv5D2O?= =?us-ascii?Q?149LftsTX2D/nAi9tssvwpH9i6HqaH9GtkCo+9gwzVYmqxnBdghtQJHi75VY?= =?us-ascii?Q?zRA1TNCmN1gqSlYgLtHM3ihfSva1fyHv+f4nVArqGQQ2i5Q0fbOI46POZ14o?= =?us-ascii?Q?nYJiyeyN3AoNHTVtfvtZH3pS1DongXWMdoWdQgTeBe8DNz9XOjoZe5agY9AF?= =?us-ascii?Q?XHc8v4zZGD19IlSUqA7hbrKajaYbCZiOxnalEv4V1ylr8mcaCTIsV+tlC36m?= =?us-ascii?Q?mSlP6m2DGarf31bMNWq8hj7dK/gqWy2y+ZZRNDP6ubgK4CLGWJeQXc2xK4by?= =?us-ascii?Q?R5k94LPXT98eV3CcDvnpEmLhT1OIpxDiuEhaXHApyrvkYWHwq9DvBqQcFu9V?= =?us-ascii?Q?WQ736cCztNl3PAjokAQpx1nCphmqLjm0ZpRWgvD7T8jqTc/h9VwKeg4mWmcX?= =?us-ascii?Q?STiLbrUWcoruBtTNZyUfMJ0UrFW0rMCoEFUugmNAEGk9LcoYJw+u8zqKpZsa?= =?us-ascii?Q?vTLSqptVLuJbNVrYSIlsCyGaLTaBBKi4Xq3UFR8iAGu1rwpOkRi8iHEXu5we?= =?us-ascii?Q?GDdd4KyCwRqihmSM3heYT223UTwIyed0TFEYuXHfbRlXIUq5xNtq4xw+QDNq?= =?us-ascii?Q?S/BXkxWl11K2YewVF1aOT3mviWpExbHkLav7CXAbpeX2et5tqIu5tqhrtvfN?= =?us-ascii?Q?xZeZZGpFXBCDvWB5yKsJpFDBmbcXMS9D9PnkgvsVdHIpWyGa/Df9Lv1A8wsQ?= =?us-ascii?Q?syuXU/6zh/KtjvZdg3AYZFJQ7o9PSljvxp1Bl67PCWHWjnu0P/yZAMzcUXju?= =?us-ascii?Q?2rSfzy/pwlYar8OcUa4VwLHX4iesCrlw77ztwPGzsKmknqDWz3+wTyIyvncs?= =?us-ascii?Q?4hqtmKoASiqg/bopJc9re/fbVCux1O2n07DQzsaHpshY9gj+wf4ZTj3RF+/d?= =?us-ascii?Q?/SoE8dvnD9K1Cjj09Ig/MSJm77gR9VnXwDcD+jXFIwJGspylT45K+i8boiE4?= =?us-ascii?Q?02iJ1KTmDcbz5s8p19MZYNKoor6oxez/io3UataK4QNpwL8l6auQ4fZB7itJ?= =?us-ascii?Q?YEDTJhlKjcv5yoJZ3fuzBZZhOWiBEEk1Du8iZroHFNhOoVcnKOfDOslqlEW+?= =?us-ascii?Q?h8IL1Sq6w7nAXPUXNOqjadNhHIT6s3AN2SNWdukiVYYlmLv77ntbhkGdHeSj?= =?us-ascii?Q?ycEkeWgLuRmuGO6APwo8OtEnJE8aqP0Dks2JtG9au2Jnr9PY595L3MYTrKBu?= =?us-ascii?Q?iMdTWRDpuXPpX0Uck0kiHqA1CsYH8BHj2kf59w+oG7i10pChHEplqghSZcCj?= =?us-ascii?Q?Ld5ss14rmy1gyX+cA7QZxAW3nfaIqjClK2ZNyqYfHAl26U+s2yF6xvWFFJrB?= =?us-ascii?Q?Kef6SEAGM5zMS9+SLKdVETP2H0gtOakbDrusnAsvkYagRa/PpLMD8+Wwu7fN?= =?us-ascii?Q?Q+uIL2tdCK8XTwZ7LvEqSWI55F4ja++iLyKOfUO+B1LCeVCYL+oadZMtBISa?= =?us-ascii?Q?s6hE6iYw4ehJJIo6d8lvsYbqJ5Q21R9SCI4tvvDLRCM/?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 369eabb8-f6e0-40f3-563c-08dbefdd6a21 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Nov 2023 06:44:05.0108 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WWAJ/LKYyiTXWiPyJbJGmf9sYA7flV6EBk98C2c9CsnqNLv+ACFyiz1hh4Vf1Xi6+d11vBz7HDoMTR/oXLrSvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6928 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,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: yIlkf6S84y8ps6tA0tbHU9X6x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Spam-Flag: yes X-Spam-Level: ************ X-GND-Spam-Score: 190 X-GND-Status: SPAM Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=mwvxmWCA; 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}") 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 s= ettings > from the same HTTP response body retrieved above. > The worst case would be there is no pending setting, however we waste net= work > bandwidth to get the whole response body. Not sure if HTTP query $select = 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 bandw= idth. "$select" may reduce the data size but it may increase the loading of= BMC while BMC is doing filtering. HTTP HEAD relies on BMC support, and it seems to me that OpenBMC does not s= upport HTTP HEAD yet. Let's put this to our to-do list and implement HTTP H= EAD 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 d= river > enhancement. >=20 > External email: Use caution opening links or attachments >=20 >=20 > [AMD Official Use Only - General] >=20 > > -----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 s= ignature. > > > > @retval EFI_SUCCESS Index is found. > > - @retval EFI_NOT_FOUND The non-array configure language = string is > > retured. > > + @retval EFI_NOT_FOUND The non-array configure language = string is > > returned. > > @retval EFI_INVALID_PARAMETER The format of input ConfigureLang= 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 string= . > > > > - @retval EFI_STRING the begining of the node string. > > + @retval EFI_STRING the beginning of the node string. > > > > **/ > > 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 language = string is > > retured. > > + @retval EFI_NOT_FOUND The non-array configure language = string is > > returned. > > @retval EFI_INVALID_PARAMETER The format of input ConfigureLang= is > > wrong. > > @retval Others Errors occur. > > > > @@ -188,9 +188,9 @@ DestroyConfiglanguageList ( > > > > @param[in] DestConfigLang Pointer to the node's configure la= nguage > > string. > > The memory pointed by ConfigLang m= ust be allocated > > - through memory allocation interfac= e. 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 insta= nce. > > > > @retval EFI_SUCCESS The instance is inserted to the configur= e 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 property= . > > - @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 databa= se. > > + > > + @param[in] Service Redfish service instance to make q= uery. > > + @param[in] Uri URI to query ETag. > > + @param[in] CheckPendingSettings Set this to true and > > + @Redfish.Settings > > will > > + be handled together. FALSE otherwi= se. > > + > > + @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 opt= ional. > > @@ -790,7 +809,7 @@ MatchPropertyWithJsonContext ( > > > > /** > > > > - Create string array and append to arry node in Redfish JSON convert = 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 as = 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 on > > 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 valu= e > > sets > > + @param[in] ConfigVagueKeyValueNumber The number of vague key valu= e > > 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 "SettingP= ayload" > > and > > + "SettingUri". > > + >=20 > > + @param[in] Payload Payload that may contain "@Redfish.Setti= ngs" > > + @param[out] SettingPayload Payload keeps pending settings. > > + @param[out] SettingUri URI to pending settings. >=20 >=20 > Missed Doxgen tag for RedfishService. > Please also update the function header of GetPendingSettings in C source = file. >=20 > > + > > + @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, Private= ->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. the > > 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, Private= ->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. the > > 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, Private= ->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. the > > collection driver). > > diff --git > > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > c > > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > c > > index 13e29902..753cd7b2 100644 > > --- > > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > c > > +++ > > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > c > > @@ -107,6 +107,119 @@ GetArraykeyFromUri ( > > return EFI_SUCCESS; > > } > > > > +/** > > + > > + This function query ETag from given URI string and keep it in databa= se. > > + > > + @param[in] Service Redfish service instance to make q= uery. > > + @param[in] Uri URI to query ETag. > > + @param[in] CheckPendingSettings Set this to true and > > + @Redfish.Settings > > will > > + be handled together. FALSE otherwi= se. > > + > > + @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 s= ettings > from the same HTTP response body retrieved above. > The worst case would be there is no pending setting, however we waste net= work > bandwidth to get the whole response body. Not sure if HTTP query $select = can > improve this or not for retrieving pending setting annotation. >=20 > Abner >=20 >=20 > > + 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, FA= LSE); > > + } > > + } > > + > > +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 m= ust 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 insta= nce. > > > > @retval EFI_SUCCESS The instance is inserted to the configur= e 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, ConfigLangInstan= ce- > > >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 "SettingP= ayload" > > and > > + "SettingUri". > > + > > + @param[in] Payload Payload that may contain "@Redfish.Setti= ngs" > > + @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.Settings= ", > > "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); Index= ++) { > > + 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 o= r not. > > + // > > + *SettingUri =3D JsonValueGetUnicodeString (JsonValue); > > + if (*SettingUri =3D=3D NULL) { > > + return EFI_NOT_FOUND; > > + } > > + > > + Status =3D GetResourceByUri (RedfishService, *SettingUri, SettingR= esponse); > > + 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 (#111797): https://edk2.groups.io/g/devel/message/111797 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-