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 6A4EB7803DE for ; Fri, 22 Mar 2024 09:58:27 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pJsubtpZZn/dtIED/VEjQSgDXcsFd6KevJiyXXVYH+I=; c=relaxed/simple; d=groups.io; h=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:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1711101505; v=1; b=B2CdNjeFjoyrgRHnUjvhW9zSDV7luVCIb7LcgZOQv9cm8jSmY4kmwuyQW6vQlB+SJ2v+ydjw V34UQufvmfoKB5y3MK1tnnqQu0eS2SBWKOSEncSQLJwok2pGJDY+Rsg16YeRIWJBU8R/IP2MTQU G7NCwOvWr/bhngtSKcYmmDXMTt6lv1TCnmCq4QMUAmSb+NUbJjqom3t6JFLCgitf03CYsp3N7Ke VnPGbuffiRGxMF6MJMZgsclp0BA7lhhQu9+S7VwQ1ppI9genlYlgB0WuGZ3wmXqGikHd7nnKrTG ehG0miX7s3EN8R/UShdtEtJ9RaPLm1MHa6OwZMxQnZtMA== X-Received: by 127.0.0.2 with SMTP id uEW8YY7687511xaaFaIqPwU0; Fri, 22 Mar 2024 02:58:25 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.70]) by mx.groups.io with SMTP id smtpd.web10.9137.1711101505252514185 for ; Fri, 22 Mar 2024 02:58:25 -0700 X-Received: from CYXPR12MB9444.namprd12.prod.outlook.com (2603:10b6:930:d6::20) by IA0PR12MB8716.namprd12.prod.outlook.com (2603:10b6:208:485::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.24; Fri, 22 Mar 2024 09:58:22 +0000 X-Received: from CYXPR12MB9444.namprd12.prod.outlook.com ([fe80::293d:16b6:e86f:c08c]) by CYXPR12MB9444.namprd12.prod.outlook.com ([fe80::293d:16b6:e86f:c08c%6]) with mapi id 15.20.7409.023; Fri, 22 Mar 2024 09:58:22 +0000 From: "Chang, Abner via groups.io" To: M M , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nickle Wang Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V3 1/2] RedfishClientPkg: Set SettingsObject URI as the config language Thread-Topic: [edk2-devel] [edk2-redfish-client][PATCH V3 1/2] RedfishClientPkg: Set SettingsObject URI as the config language Thread-Index: AQHafDoShkgIGrHfTkmdIojDs0mWgrFDhmAw Date: Fri, 22 Mar 2024 09:58:22 +0000 Message-ID: References: <20240322090959.237-1-abner.chang@amd.com> <295BA3E2-90F6-456B-95D0-75393D77F13D@gmail.com> In-Reply-To: <295BA3E2-90F6-456B-95D0-75393D77F13D@gmail.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=08a0d0ce-f266-4116-8bea-9c453db0ddd0;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=2024-03-22T09:57:56Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CYXPR12MB9444:EE_|IA0PR12MB8716:EE_ x-ms-office365-filtering-correlation-id: 20a29e4b-4204-46c5-322f-08dc4a569c2f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 6IDPAr0t09B8rQRCKyzGPSLhhXYy2mOnBdq5AIAnuxL1UQxJIViH9du36FCi3lt4JRrgYeE9a7pph1cEAUc2Oq25IazDc7w+GhzMEwpYLDI48DLK+UkGrbbxnvD+rP5BpwBN9WKNy0jMrIhWtnE6BxPEdNuvKOCBQRXQmxgZPPY21uk/dpEV6AU14Gpgb61rlFj8iW7FEaDt9niUCT9XbPaG3YiU7BPAKspSS6EsppoxZ/c2x8c4opFgZB/aDdvjYyj5DpEL76xB7IpjHt1FMdIdoKfbjVGx8KuVLM/YR6zA/93XqbChh7yysqmnDNk+IOwkYstIPXeRqBRTQ40E+XZAGqHis7rPH1vwsvWpU4LJSGBnojSZlXJXE30ynM2ihDE/RULdIW20nVlXA0IzmFhGNLPPTiQRwyVTFmT3W3QUAZoPieiMTUX/AsG6oJQomGdDi2/JAJ0ORmAsJ9yTZ5hJobX/hOAIJpTnkxfWDbk5xsZAt9O/uor0QCPxAAVvX5XvD+cwDuCEmiWgvQSMmbWiwlsDtvLmEGeqY9TONN9jO9Id8O5mtgEChSr6fjpDlUGO7OixkAb6eXTLps8Z+ZdSXe1xYGUIg3hB/JCqNJS+frCk5MahyUE0wTfP6KAX1BOJq7ouTq1/tcisYzUMMiMLPpPyEpj/DYZvDRosB5UagwAmVFcDgpfWI6x7V3jBnhtNw2fsSnlt9PrGJ8yURmgVQoGSYkBTmLh+pZSPswE= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?NAcqn3HD8X6r45in2G4LHpUaMM+BwsJM4os8HJauon1MeIZCNygVAIo7wOb3?= =?us-ascii?Q?c+pZZR9XBHDa9QqOYzeVOaJw7GgtNriS5UUkWZ6fu8yLVuuWFdj996GlbhLe?= =?us-ascii?Q?+IDHOS9hh9IG1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us-ascii?Q?EwoelxpLTvjzFT1GnevgJh+N1jJi8/+BuYzNu5mCMoi+ZdKD2GipudArPM2i?= =?us-ascii?Q?t4MVHbzPoWkB+mt5mfuJNwlHg5c0SfrVy8E2hdYzikEh40mybbOyR1iwVd6r?= =?us-ascii?Q?VfKax/BEb8TPyCd643Lnk5X3hnZt/Ap8JDObv1WCQQn5Bkz1ScZMQeaWtOH7?= =?us-ascii?Q?m25HYw1svn3tVsLxUySoQDiqGgqpjWfzismjDkViaghYMHrwkJXjH+F6Zubz?= =?us-ascii?Q?gl2Bl0xdfncYZly2wvoMoeyamZUPFr81zWxs4RqG0aTMBGWb59/NlfAIp7jk?= =?us-ascii?Q?Y1ICEE2nr+Xe1bE3arGLFQyVh1XBsbT34i79e4qL8MeMLS6Q1Do4o/LKgO4N?= =?us-ascii?Q?W2+aLZjUznciXts2oaxEvtya2bcrElJDooTkap/1FpPIBMtKSvMHfSs3h/g5?= =?us-ascii?Q?gt9uI9meRroI8nYD2RNF4o3dYSg/V3SgrdAzR1RXSckxU02yxZCRL49yrC+b?= =?us-ascii?Q?/ob6vQE1P7iYU6WHAcmFmfaIUooALRqh1l2Q9ozspWTXPF+qpjt6EdDAg+zA?= =?us-ascii?Q?vCg8AMhv0h8f3ybCRsw=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CYXPR12MB9444.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20a29e4b-4204-46c5-322f-08dc4a569c2f X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Mar 2024 09:58:22.7587 (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: pGF3HR+g8UPrVxY8gOqw1qKqSyDVe5pGIJkyMAvmsXCwroOILdc/DkA1XDbDjdQwFGyZ3pLHj1hRyUFESa5pIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8716 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 Resent-Date: Fri, 22 Mar 2024 02:58:25 -0700 Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: O3ZhZFKIdMxFSaHNFBkD2vqOx7686176AA= 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=20240206 header.b=B2CdNjeF; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io [AMD Official Use Only - General] Hi Mike, Thanks for catching this, V4 sent. Abner > -----Original Message----- > From: M M > Sent: Friday, March 22, 2024 5:20 PM > To: devel@edk2.groups.io; Chang, Abner > Cc: Igor Kulchytskyy ; Nickle Wang > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V3 1/2] > RedfishClientPkg: Set SettingsObject URI as the config language > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Hi Abner, > > > On 22. 3. 2024., at 12:09, Chang, Abner via groups.io > wrote: > > > > From: Abner Chang > > > > Set SettingsObject URI in @Redfish.Settings resource as the config > > language which is the same as the config language of parent URI > > that mandates @Redfish.Settings. > > With this, we can find the config language of the properties in > > SettingsObject URI. > > > > Signed-off-by: Abner Chang > > Cc: Igor Kulchytskyy > > Co-authored-by: Nickle Wang > > --- > > .../Library/RedfishFeatureUtilityLib.h | 17 ++++ > > .../RedfishFeatureUtilityLib.c | 86 ++++++++++++++++--- > > .../RedfishConfigLangMapDxe.c | 15 +++- > > 3 files changed, 101 insertions(+), 17 deletions(-) > > > > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.= h > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > > index ba9ea01501..3c5f248eb7 100644 > > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > > @@ -369,6 +369,23 @@ RedfishSetRedfishUri ( > > IN EFI_STRING Uri > > ); > > > > +/** > > + > > + Save Redfish SettingsObject URI in database for further use. > > + > > + @param[in] ParentUri Parent URI of @Redfish.Settings prop= erty. > > + @param[in] SettingObjectUri Redfish SettingsObject Uri to save. > > + > > + @retval EFI_INVALID_PARAMETER SystemId is NULL or EMPTY > > + @retval EFI_SUCCESS Redfish uri is saved > > + > > +**/ > > +EFI_STATUS > > +SetRedfishSettingsObjectsUri ( > > + IN EFI_STRING ParentUri, > > + IN EFI_STRING SettingObjectUri > > + ); > > + > > /** > > > > Get the property name by given Configure Language. > > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > > index cc2b37b796..c37bf85310 100644 > > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > > +++ > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib. > c > > @@ -2082,7 +2082,6 @@ GetConfigureLang ( > > EFI_STRING ResultStr; > > EFI_STRING UnicodeUri; > > EFI_STATUS Status; > > - EFI_STRING StrFound; > > > > if (IS_EMPTY_STRING (Uri)) { > > return NULL; > > @@ -2101,18 +2100,6 @@ GetConfigureLang ( > > } > > > > ConfigLang =3D RedfishGetConfigLanguage (UnicodeUri); > > - if (ConfigLang =3D=3D NULL) { > > - // > > - // @Redfish.Settings share the same schema as its parent. > > - // Remove "Settings" and try again. > > - // > > - StrFound =3D StrStr (UnicodeUri, L"/Settings"); > > - if (StrFound !=3D NULL) { > > - StrFound[0] =3D L'\0'; > > - DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try= : > %s\n", __func__, UnicodeUri)); > > - ConfigLang =3D RedfishGetConfigLanguage (UnicodeUri); > > - } > > - } > > > > FreePool (UnicodeUri); > > > > @@ -2172,6 +2159,61 @@ RedfishSetRedfishUri ( > > return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, > ConfigLang, Uri); > > } > > > > +/** > > + > > + Save Redfish SettingsObject URI in database for further use. > > + > > + @param[in] ParentUri Parent URI of @Redfish.Settings prop= erty. > > + @param[in] SettingObjectUri Redfish SettingsObject Uri to save. > > + > > + @retval EFI_INVALID_PARAMETER ParentUri or SettingObjectUri is NUL= L. > > + @retval EFI_NOT_FOUND Config language for ParentUri is not= found. > > + @retval EFI_SUCCESS Redfish URI is saved with correspond= ing > > + config language. > > + > > +**/ > > +EFI_STATUS > > +SetRedfishSettingsObjectsUri ( > > + IN EFI_STRING ParentUri, > > + IN EFI_STRING SettingObjectUri > > + ) > > +{ > > + EFI_STATUS Status; > > + EFI_STRING ConfigLang; > > + > > + if ((ParentUri =3D=3D NULL) || (SettingObjectUri =3D=3D NULL)) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + // > > + // Check if the SettingsObject URI already in the database. > > + // > > + ConfigLang =3D RedfishGetConfigLanguage (SettingObjectUri); > > + if (ConfigLang =3D=3D NULL) { > > + // > > + // No config language of SettingsObject URI is found. > > + // Get the config language of parent URI because the data model of > > + // SettingsObject URI resource is the same as the data model of pa= rent > URI. > > + // > > + ConfigLang =3D RedfishGetConfigLanguage (ParentUri); > > + if (ConfigLang =3D=3D NULL) { > > + DEBUG ((DEBUG_ERROR, "%a: Failed to get the config language of > parent URI that mandates SettingsObject - %s.\n", __func__, ParentUri)); > > + return EFI_NOT_FOUND; > > + } > > + > > + // Set the config language of settings URI using parent's URI conf= ig > language. > > + Status =3D RedfishSetRedfishUri (ConfigLang, SettingObjectUri); > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "%a: Fails to set the config language of > SettingsObject - %s.\n", __func__, SettingObjectUri)); > > looks like there is ConfigLang leak in this function. > > > + return Status; > > + } > > + > > + DEBUG ((DEBUG_INFO, "%a: Set the config language of SettingsObject= - > %s: SUCCESS.\n", __func__, SettingObjectUri)); > > + } > > + > > + return EFI_SUCCESS; > > +} > > + > > /** > > > > Get @odata.id from give HTTP payload. It's call responsibility to rel= ease > returned buffer. > > @@ -3532,6 +3574,7 @@ CompareRedfishBooleanArrayValues ( > > payload and URI to pending settings. Caller has to release "SettingPa= yload" > and > > "SettingUri". > > > > + @param[in] RedfishService Instance of REDFISH_SERVICE > > @param[in] Payload Payload that may contain "@Redfish.Settin= gs" > > @param[out] SettingPayload Payload keeps pending settings. > > @param[out] SettingUri URI to pending settings. > > @@ -3552,6 +3595,7 @@ GetPendingSettings ( > > EDKII_JSON_VALUE JsonValue; > > UINTN Index; > > EFI_STATUS Status; > > + EFI_STRING StrFound; > > > > if ((RedfishService =3D=3D NULL) || (Payload =3D=3D NULL) || (Setting= Response =3D=3D > NULL) || (SettingUri =3D=3D NULL)) { > > return EFI_INVALID_PARAMETER; > > @@ -3586,6 +3630,22 @@ GetPendingSettings ( > > return Status; > > } > > > > + // > > + // Setting URI exists, check if settings URI is valid or not. > > + // > > + StrFound =3D StrStr (*SettingUri, L"/Settings"); > > + if (StrFound !=3D NULL) { > > + DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI: > %s\n", __func__, *SettingUri)); > > + } else { > > + StrFound =3D StrStr (*SettingUri, L"/SD"); > > + if (StrFound !=3D NULL) { > > + DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"SD\" found in URI: %s\n", > __func__, *SettingUri)); > > + } else { > > + DEBUG ((DEBUG_ERROR, "%a: Not an valid @redfish.settings URI\n= ", > __func__, *SettingUri)); > > + ASSERT (FALSE); > > + } > > + } > > + > > return EFI_SUCCESS; > > } > > > > diff --git > a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c > b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c > > index 8c93044580..4071e30c17 100644 > > --- > a/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c > > +++ > b/RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.c > > @@ -2,6 +2,7 @@ > > > > (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> > Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > > + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.=
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -606,10 +607,16 @@ RedfishConfigLangMapSet ( > > Status =3D EFI_NOT_FOUND; > > Target =3D FindConfigLangMapRecord (&Private->ConfigLangList.ListHead= er, > ConfigLang, FALSE); > > if (Target !=3D NULL) { > > - // > > - // Remove old one and create new one. > > - // > > - Status =3D DeleteConfigLangMapRecord (&Private->ConfigLangList, Ta= rget); > > + if (Uri !=3D NULL) { > > + if (StrCmp (Uri, Target->Uri) =3D=3D 0) { > > + return EFI_SUCCESS; > > + } > > + } else { > > + // > > + // Remove old one and create new one. > > + // > > + Status =3D DeleteConfigLangMapRecord (&Private->ConfigLangList, > Target); > > + } > > } > > > > // > > -- > > 2.37.1.windows.1 > > Regards, > Mike. -=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 (#117044): https://edk2.groups.io/g/devel/message/117044 Mute This Topic: https://groups.io/mt/105081867/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-