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 C180B780091 for ; Mon, 1 Apr 2024 09:26:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Nh2CnmoghOTOFHNGGgS4aMSJwFTG7n4qcTEeUdYDkyQ=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240206; t=1711963598; v=1; b=0HMiipjs3THetS37Bbwdit8dORxHHJGr9LLrsTiz8zYyQErGmaOf5SnVRvfd8PTGEdLg1Qzh XUY2CDDp4TiiGUBZrnZ7BVd4Mb4V4+TOGAyimKyRpBm+kVu2c1OByEyrEHEFTyP+K2ILhbjyl5I LxXAqtjFkG1sxMsQOuZ3TovdGHm9vyMvsd+1+Tl1vpjvyJ5i6igOSF96sykpOWXfHYLGDW2hG1F mP7tIoy7fiVjss5pXPZabspYqVIfE7eVfvi/0Hp79GZzDTPhAW5pZ2C3wDDLAtixZmgHCb3KMfr J10cQMLNj4e/cyTrv5PBFZmeehXzFBQDxS/nKBKjuJHog== X-Received: by 127.0.0.2 with SMTP id XRB7YY7687511xedibLyMsmX; Mon, 01 Apr 2024 02:26:38 -0700 X-Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) by mx.groups.io with SMTP id smtpd.web10.33651.1711963597304179085 for ; Mon, 01 Apr 2024 02:26:37 -0700 X-Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d6c9678cbdso49155851fa.2 for ; Mon, 01 Apr 2024 02:26:37 -0700 (PDT) X-Gm-Message-State: h00XZliXxbkjbYHGaEOJGitRx7686176AA= X-Google-Smtp-Source: AGHT+IH8zOFqhENXRWn84b7WvPeaS+JyDd+v5OOTNkNgHMhCL/8fhWPz//vXiKww3YPOFfwE4An48GQ9kbpek9KnQ24= X-Received: by 2002:a2e:91cc:0:b0:2d6:c43e:f0b3 with SMTP id u12-20020a2e91cc000000b002d6c43ef0b3mr4710313ljg.50.1711963595119; Mon, 01 Apr 2024 02:26:35 -0700 (PDT) MIME-Version: 1.0 References: <20240322144124.1671-1-abner.chang@amd.com> <17C0DB2F6517C591.6770@groups.io> In-Reply-To: From: "Mike Maslenkin" Date: Mon, 1 Apr 2024 12:25:58 +0300 Message-ID: Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language To: "Chang, Abner" Cc: "devel@edk2.groups.io" , Nickle Wang , Igor Kulchytskyy 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: Mon, 01 Apr 2024 02:26:37 -0700 Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" 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=0HMiipjs; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Abner, Sorry for the delayed response. Patch looks good to me. Regards, Mike. On Mon, Apr 1, 2024 at 4:23=E2=80=AFAM Chang, Abner w= rote: > > [AMD Official Use Only - General] > > Hi Mike, > Just letting you know that I merged this patch set to clean up the backlo= gs. I believe your comment was addressed in V5. Just let me know if you sti= ll find any improper code. > Thanks > Abner > > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Chang, > > Abner via groups.io > > Sent: Thursday, March 28, 2024 2:54 PM > > To: Nickle Wang ; devel@edk2.groups.io; Mike > > Maslenkin > > Cc: Igor Kulchytskyy > > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V5 1/2] > > RedfishClientPkg: Set SettingsObject URI as the config language > > > > [AMD Official Use Only - General] > > > > Caution: This message originated from an External Source. Use proper ca= ution > > when opening attachments, clicking links, or responding. > > > > > > [AMD Official Use Only - General] > > > > Hi @Mike Maslenkin, would you like to review this patch again as I addr= essed > > your comments in V5 patch set. > > Thanks > > Abner > > > > > -----Original Message----- > > > From: Nickle Wang > > > Sent: Tuesday, March 26, 2024 8:14 PM > > > To: Chang, Abner ; devel@edk2.groups.io > > > Cc: Igor Kulchytskyy > > > Subject: RE: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Se= t > > > SettingsObject URI as the config language > > > > > > Caution: This message originated from an External Source. Use proper > > caution > > > when opening attachments, clicking links, or responding. > > > > > > > > > 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 > > > SettingsObject > > > > URI as the config language > > > > > > > > External email: Use caution opening links or attachments > > > > > > > > > > > > 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 mandate= s > > > > @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 | 89 +++++++++++++++= +--- > > > > .../RedfishConfigLangMapDxe.c | 15 +++- > > > > 3 files changed, 104 insertions(+), 17 deletions(-) > > > > > > > > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtility= Lib.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 = property. > > > > + @param[in] SettingObjectUri Redfish SettingsObject Uri to sa= ve. > > > > + > > > > + @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/RedfishFeatureUtili= tyLib. > > c > > > > > > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > c > > > > index cc2b37b796..dda80c4608 100644 > > > > --- > > > > > > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib. > > 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; > > > > > > > > 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,64 @@ RedfishSetRedfishUri ( > > > > return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, > > ConfigLang, > > > > Uri); } > > > > > > > > +/** > > > > + > > > > + Save Redfish SettingsObject URI in database for further use. > > > > + > > > > + @param[in] ParentUri Parent URI of @Redfish.Settings = property. > > > > + @param[in] SettingObjectUri Redfish SettingsObject Uri to sa= ve. > > > > + > > > > + @retval EFI_INVALID_PARAMETER ParentUri or SettingObjectUri is > > NULL. > > > > + @retval EFI_NOT_FOUND Config language for ParentUri is= not > > found. > > > > + @retval EFI_SUCCESS Redfish URI is saved with corres= ponding > > > > + 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 mode= l of > > > > + // SettingsObject URI resource is the same as the data model o= f parent > > 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)); > > > > + Status =3D EFI_NOT_FOUND; > > > > + } else { > > > > + > > > > + // Set the config language of settings URI using parent's UR= I config > > > language. > > > > + Status =3D RedfishSetRedfishUri (ConfigLang, SettingObjectUr= i); > > > > + 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 > > SettingsObject - > > > %s: > > > > SUCCESS.\n", __func__, SettingObjectUri)); > > > > + } > > > > + FreePool (ConfigLang); // Free the ConfigLang of parent URI. > > > > + } > > > > + } else { > > > > + FreePool (ConfigLang); // Free the ConfigLang of SettingObject= URI. > > > > + } > > > > + return Status; > > > > +} > > > > + > > > > /** > > > > > > > > Get @odata.id from give HTTP payload. It's call responsibility t= o release > > > > returned buffer. > > > > @@ -3532,6 +3577,7 @@ CompareRedfishBooleanArrayValues ( > > > > payload and URI to pending settings. Caller has to release > > "SettingPayload" > > > and > > > > "SettingUri". > > > > > > > > + @param[in] RedfishService Instance of REDFISH_SERVICE > > > > @param[in] Payload Payload that may contain "@Redfish.S= ettings" > > > > @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; > > > > > > > > if ((RedfishService =3D=3D NULL) || (Payload =3D=3D NULL) || (Se= ttingResponse =3D=3D > > > NULL) > > > > || (SettingUri =3D=3D NULL)) { > > > > return EFI_INVALID_PARAMETER; > > > > @@ -3586,6 +3633,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 U= RI\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 ri= ghts > > > > 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.ListHeader, > > > > ConfigLang, FALSE); > > > > if (Target !=3D NULL) { > > > > - // > > > > - // Remove old one and create new one. > > > > - // > > > > - Status =3D DeleteConfigLangMapRecord (&Private->ConfigLangList= , > > Target); > > > > + 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->ConfigLangLi= st, > > Target); > > > > + } > > > > } > > > > > > > > // > > > > -- > > > > 2.37.1.windows.1 > > > > > > > >=20 > > > -=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 (#117286): https://edk2.groups.io/g/devel/message/117286 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-