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 067E994181D for ; Tue, 26 Mar 2024 12:13:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pQI6ccKCJMmUcaXzJJcY34wvAEp8eMvTYKWa24iyktQ=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language: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=1711455223; v=1; b=dsB6j2cYnFUwWmthH3cQy+zT/8Dsb6ZGyaAoCmvleqzL42nl8Rxb+CEv5tfp2ljsJ/Dfxrgg ByukZsCH4XoN7KVZ9MXpp/0eP3WWkksCKRMLi+idrUg58ZX9M2xGp3nljVHHmdKu+Gd6H4fHOkM O7ld6P2hJ8E1QUbSgN+CYJf1k1nKbDIs1d9laRmnWG+wGlcwSQOaO0lnRYQy2oqP4R0uRoZLLPI FdP3cLsrvcIJuy3fsWdIKMyyBNP4k+6AzirAUuTUIpQ8FaZvZFJ+Muh1hoMlCzv5UyK6bPsPqh+ FazNepbHAr8E79tTQsRx3HSgmdq72ICk2bOz7lYxb0wQg== X-Received: by 127.0.0.2 with SMTP id X2R3YY7687511x604WTZFSSf; Tue, 26 Mar 2024 05:13:43 -0700 X-Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.100]) by mx.groups.io with SMTP id smtpd.web11.7179.1711455222914443823 for ; Tue, 26 Mar 2024 05:13:43 -0700 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by IA0PR12MB8747.namprd12.prod.outlook.com (2603:10b6:208:48b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Tue, 26 Mar 2024 12:13:38 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::fef9:2c9c:21b5:6f50]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::fef9:2c9c:21b5:6f50%2]) with mapi id 15.20.7409.031; Tue, 26 Mar 2024 12:13:38 +0000 From: "Nickle Wang via groups.io" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language Thread-Topic: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language Thread-Index: AQHafGcZhkEZ/Uk3jkGOazQqRXC/lbFJ9SlA Date: Tue, 26 Mar 2024 12:13:38 +0000 Message-ID: References: <20240322144124.1671-1-abner.chang@amd.com> In-Reply-To: <20240322144124.1671-1-abner.chang@amd.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|IA0PR12MB8747:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 7MKbSdqO57x9jym7HZnAwgWTSuCBifKWfStY05s3XQuJwFti44kLmlEQHWEK1SABBJj25pc6wgcQpsKoQxbQ9PBbq9BbPYE1YMFoM3hOZBQlbD1q7rgmyL/vVsgMs9wZ/jQwlKgRpHSuEB+uef61Ur4Yu9LLn80rQ+3pq/Rt2TBAObw/5aQQanCQKiFEKZOuKcFOzPADLblwEFFsbkmjk5qbzwBlf+hRSqPIXX1pWnwkgBp2vEfsaQykgSIvWErHfiIKQQqVDWGnv0nLLimuo7fUErnMpWjG1kq8vwIeqCqc7oH+/jAFQFyZgQ2KB6X6TauxXkLO4+yAWLHJ7eT0nFsevD44qOMacTgnz810HZyZd7c4j5RDk2SwAUPAhvVkcl+AuFge2nNVDXmgece+33Nms6eU1gVShIt/T6a0hkUUBM+iE6KXHu0Vd0LICku8Nng2U5+UqYpoly1o7QYJguO/GOn0D/i+hCA6OytVeoXsfAkDn2yqLmoN3sT4vGeu4xjs4dugwGH+vkhAgz+AsPdQ3sNU4KzoZg9v/43U9URzzTP3cKUUhYetTk0zzyguvhU1kSAKyPXOfakyrsugbfuXl2xAlRFM6TilXV4BGBeloFXjfbT3/VnXszLc9FOQrzGVNf3XAKFlxnnu6+NruE7XyUOASicXGaHlLFW1wc0= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Q2XTAD+53KLg1P3LOTQfe+S6jFogVh0qwIROwithq9+zpipIr2AqDQEXwY9Q?= =?us-ascii?Q?WeXOoyRmkLOVmzXsW9j1Twky4qdZE/8USxmvG81qQzeRFkzUEqVtTnpMtmpP?= =?us-ascii?Q?UXmQ8IZ62+/qEuHIPmmYvuEDg1tm6Uqm7D2tDTGtsqIchY5k+WLBlQx30Rlz?= =?us-ascii?Q?QEBALI6HDHoDyqeMQWVf5PGq6Ewyhldsk8VzrV0gv0VCMLWvQYNRHAdB1LRT?= =?us-ascii?Q?idaJKQe75KUwT5h312DcBFjxgWLyZ3077m2WZNjTU/VcEDWFM0CvEbDMwwRC?= =?us-ascii?Q?z7Qci6YQudkxbzfC4NGLVVcCihTtJJIw/lt0uJpM2YHKSEFqHba7Rht+TZNl?= =?us-ascii?Q?d9o6RWVCb2esvr/yqzfCA4Ol2D6abMpk9r5JCFhMCDvgD2GOb8BhXGKxZCtP?= =?us-ascii?Q?AjpypFMjP5EWBTEPsZV0tDPm8y3lKNOl/MdzitHPDd8mBxy842xQA64mBr8N?= =?us-ascii?Q?ezOBP8JGNe8sSnygxOIc0Osf3MysaUtKUkWYtx0LYpKUHhD7m6en16WueZdF?= =?us-ascii?Q?5ug7XTi40QBdeAjwhoWZYCrOLsgNAigtcVip1rELQP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e9guj7HQzH9zV8q3urP/rf+2dpycpOFHXH/rxACwl?= =?us-ascii?Q?QbLZrpClb86+6S6rEcZvRZ5+Ol0NEg+L9UIVWOoF/EVWCuaGPXaQPix8gIHo?= =?us-ascii?Q?3YYnPNDphxXzxmzsDvY=3D?= 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: 8e8fdf91-7e42-486b-d9fb-08dc4d8e2af7 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2024 12:13:38.0992 (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: qeOtxMobY+5piA4R3O5NN507f3ThIy2FSKqUU5IdJxJFpvHms6TFNBu34Pa92Ae/zt+u0VOpUnXefGTLYdyKdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8747 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: Tue, 26 Mar 2024 05:13:43 -0700 Reply-To: devel@edk2.groups.io,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: QmRiBNSNV9NAsc4Er6L3bmSAx7686176AA= 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=dsB6j2cY; 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 Thanks for working on this, Abner. Reviewed-by: Nickle Wang Regards, Nickle > -----Original Message----- > From: abner.chang@amd.com > Sent: Friday, March 22, 2024 10:41 PM > To: devel@edk2.groups.io > Cc: Igor Kulchytskyy ; Nickle Wang > Subject: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set Settin= gsObject > URI as the config language >=20 > External email: Use caution opening links or attachments >=20 >=20 > From: Abner Chang >=20 > Set SettingsObject URI in @Redfish.Settings resource as the config langua= ge > 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 SettingsO= bject URI. >=20 > Signed-off-by: Abner Chang > Cc: Igor Kulchytskyy > Co-authored-by: Nickle Wang > --- > .../Library/RedfishFeatureUtilityLib.h | 17 ++++ > .../RedfishFeatureUtilityLib.c | 89 ++++++++++++++++--- > .../RedfishConfigLangMapDxe.c | 15 +++- > 3 files changed, 104 insertions(+), 17 deletions(-) >=20 > 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 > ); >=20 > +/** > + > + Save Redfish SettingsObject URI in database for further use. > + > + @param[in] ParentUri Parent URI of @Redfish.Settings proper= ty. > + @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 > + ); > + > /** >=20 > 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..dda80c4608 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt > +++ ilityLib.c > @@ -2082,7 +2082,6 @@ GetConfigureLang ( > EFI_STRING ResultStr; > EFI_STRING UnicodeUri; > EFI_STATUS Status; > - EFI_STRING StrFound; >=20 > if (IS_EMPTY_STRING (Uri)) { > return NULL; > @@ -2101,18 +2100,6 @@ GetConfigureLang ( > } >=20 > 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); > - } > - } >=20 > FreePool (UnicodeUri); >=20 > @@ -2172,6 +2159,64 @@ RedfishSetRedfishUri ( > return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, ConfigLang= , > Uri); } >=20 > +/** > + > + Save Redfish SettingsObject URI in database for further use. > + > + @param[in] ParentUri Parent URI of @Redfish.Settings proper= ty. > + @param[in] SettingObjectUri Redfish SettingsObject Uri to save. > + > + @retval EFI_INVALID_PARAMETER ParentUri or SettingObjectUri is NULL. > + @retval EFI_NOT_FOUND Config language for ParentUri is not f= ound. > + @retval EFI_SUCCESS Redfish URI is saved with correspondin= g > + 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. > + // > + Status =3D EFI_SUCCESS; > + 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 pare= nt URI. > + // > + ConfigLang =3D RedfishGetConfigLanguage (ParentUri); > + if (ConfigLang =3D=3D NULL) { > + DEBUG ((DEBUG_ERROR, "%a: Failed to get the config language of par= ent > URI that mandates SettingsObject - %s.\n", __func__, ParentUri)); > + Status =3D EFI_NOT_FOUND; > + } else { > + > + // 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)); > + } else { > + DEBUG ((DEBUG_INFO, "%a: Set the config language of SettingsObje= ct - %s: > SUCCESS.\n", __func__, SettingObjectUri)); > + } > + FreePool (ConfigLang); // Free the ConfigLang of parent URI. > + } > + } else { > + FreePool (ConfigLang); // Free the ConfigLang of SettingObject URI. > + } > + return Status; > +} > + > /** >=20 > Get @odata.id from give HTTP payload. It's call responsibility to rele= ase > returned buffer. > @@ -3532,6 +3577,7 @@ CompareRedfishBooleanArrayValues ( > payload and URI to pending settings. Caller has to release "SettingPay= load" and > "SettingUri". >=20 > + @param[in] RedfishService Instance of REDFISH_SERVICE > @param[in] Payload Payload that may contain "@Redfish.Setting= s" > @param[out] SettingPayload Payload keeps pending settings. > @param[out] SettingUri URI to pending settings. > @@ -3552,6 +3598,7 @@ GetPendingSettings ( > EDKII_JSON_VALUE JsonValue; > UINTN Index; > EFI_STATUS Status; > + EFI_STRING StrFound; >=20 > if ((RedfishService =3D=3D NULL) || (Payload =3D=3D NULL) || (SettingR= esponse =3D=3D NULL) > || (SettingUri =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > @@ -3586,6 +3633,22 @@ GetPendingSettings ( > return Status; > } >=20 > + // > + // 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; > } >=20 > 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 @@ >=20 > (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.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -606,10 +607,16 @@ RedfishConfigLangMapSet ( > Status =3D EFI_NOT_FOUND; > Target =3D FindConfigLangMapRecord (&Private->ConfigLangList.ListHeade= r, > ConfigLang, FALSE); > if (Target !=3D NULL) { > - // > - // Remove old one and create new one. > - // > - Status =3D DeleteConfigLangMapRecord (&Private->ConfigLangList, Targ= et); > + 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, Ta= rget); > + } > } >=20 > // > -- > 2.37.1.windows.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 (#117112): https://edk2.groups.io/g/devel/message/117112 Mute This Topic: https://groups.io/mt/105086466/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-