From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.89]) by mx.groups.io with SMTP id smtpd.web11.21471.1677676699694010094 for ; Wed, 01 Mar 2023 05:18:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=kCQjIUjs; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.95.89, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HfBhAskHZz9v978bWol2kWrBE9i2+94knEHStDgqn1gQZrf2M+eOibDbSYsidCFxgNSt768c7j1C1nO/WBzq2H8GL0ikuRd5r6W1qI/2siOEhiEaZYxCoorWRrJg7WfIm/2Ynuni/Df/6yTjSX8l5zcMWC82jLogQQ+GhlWifHjdV8vKsnuF9yZ3quW0Ff8hwjajZ4ztwfktqzfMCQghTzDRG8z90J0CkXwB5A4nJ5lmp2nxFKJTxkVv9a7CYtosb+/2PLbRUBpjK5Z/h3UH2eSCAuxUamp0L+3+eDgdn/zihKLF6zjBYPaAiL0KZi8yAM271uQ21/4X/OFSx+2Ibw== 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=Li9PzQGCif3TAiLJOion195QEbS3vSjNV6VQwlZOXOY=; b=hYhh0fu8DsTjZ6JmAXy2a2hjuHG5HVIYxOOxNCGKS5vc0Np6h9Ks+aICoks7d3qqOAJfAFO/Jkg4ZzW0GHd6+zeskiJY/BryOZL9b/P93evv9Hj4Zhs1eWf7n4+FJecP9lWOi3HWg5YWcJYn/oWmfDqYx8FFk3iMH4I8RV80w4YF3NRlDJWIau7k6Li9d9zBxVVNfS/FR2xnbmLPNlocmBIO/6XNcvQYDOZ6hbJeItvzBDK46xarWGwPDZrUQHvpVviGfb7S3ZWrpaveIPixLM9wjMa6e+pd+8izQr/vwxARFz44lniPK4oORWsxdKJCioT/IF7FP0Ge9BC2u62aOQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Li9PzQGCif3TAiLJOion195QEbS3vSjNV6VQwlZOXOY=; b=kCQjIUjs2LsiUej0ACS34pvRwKlKvLVpOgCH2uyYZDJOuNV7RK7QB2YEAJp69uVLMllEZx38vnVks53QytGOtMAc8DjUJ3pkD4jguJd/aEIUABb0tXBaZu26CgNXjLHl8tf1l4o+VkibVRvrYugjB4EK0t5FVPP3zbetoljNNqcUNRs+qgeWW/NJ0a1Ezmf5mqoGu1JLJh8CMkiYADvc4t/mOf+RPI8hOeCVuk1h1abwwm1UGlU9qXAZ3lNMAmqmaX6uXgxdS+aPKQqd0A5b6smY8eDLQ0zP/kTmTBXEZlMBjdIoiTikQ7KaK3zrs7zsnSqG3ah/TtONYoJRzswE+w== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by MW4PR12MB6801.namprd12.prod.outlook.com (2603:10b6:303:1e8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.27; Wed, 1 Mar 2023 13:18:17 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::c27a:fa4b:66ea:d266]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::c27a:fa4b:66ea:d266%4]) with mapi id 15.20.6134.027; Wed, 1 Mar 2023 13:18:17 +0000 From: "Nickle Wang" To: "Chang, Abner" , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-staging][PATCH] RedfishClientPkg: Add mechanism to reboot system if config is changed Thread-Topic: [edk2-staging][PATCH] RedfishClientPkg: Add mechanism to reboot system if config is changed Thread-Index: AQHZQHHa2gdXckYNckylMk5iKdjV367RiVxwgBR1wFA= Date: Wed, 1 Mar 2023 13:18:16 +0000 Message-ID: References: <20230214124236.145-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_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-02-16T12:55:30Z; 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_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=e5ad1649-bad4-4e09-8291-5bb523d2872b; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|MW4PR12MB6801:EE_ x-ms-office365-filtering-correlation-id: 3bc92abc-dbd8-435d-905a-08db1a576b52 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BG31oaRdHS5IWQySOgDgcDr3PUtcYVwE8mT7n5b/CGPRdTmnwtHZH2+CvUprRpSkHyYC1ELvKoGKqv+RN3wfM5RKOUtbzYpXUKB7gz3wGJiijnMfw6o/p6t6hdIimL/orp88fOzMZ3L2nIAvs2I88GG0k7NOkK75nkJnvFX8k4XUGeuMO3992ov08NE42+mMaU3OlDKmN9Cn6iFXPeB50lR9sjAqVvsrjdYUDsnVWodZzUf4V5zDxnTOsdLdiOFHfMvN5C95cp5XqzkJConz7ZYWC2oxKmCSB6bfEBMhupxvLv8biXJGKdnccx3WBIzC3ehxnHTo1XGCcr30QEV1tq59yAhSMe0naCgkzSaoliPdYtk9Z+W5XxQXGvdYcCP/kVM4AWfe0zHkqfby3TMO55CQtiRo/ouamSTL9lPNMldrK7D/1NAYIrm6igyXNL4RK5rawpw+iwC+bhkrnGYnzAG1+Cg0+gTT12GI2BU8wy3Da//fwbKcy4OXO/mQdtK2mNRr5tlPxslCjX2ld60fkKlN5ZVnkWA9grZm1usXI/2lV5CXG4IXRhQbMml0aoAOMcm1oPVmc96gNXxPIDoMf0pSB7OSfw/XnQsK6LdmeP2qRTjwx15QQpX2QQ+9bGGkipvoIf4Q59rQKavJBK0gvdSfI4M+PSPj18Um7iQzor6yBVRehXATwRQ3KiSGGkS3kc/GyRv1DE7aIDAK+TemwQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR12MB7031.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(366004)(376002)(136003)(39860400002)(346002)(451199018)(83380400001)(8936002)(52536014)(2906002)(30864003)(5660300002)(122000001)(38100700002)(41300700001)(107886003)(6506007)(66476007)(64756008)(76116006)(4326008)(8676002)(478600001)(53546011)(186003)(66946007)(66446008)(71200400001)(9686003)(33656002)(316002)(7696005)(38070700005)(55016003)(66556008)(86362001)(54906003)(110136005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1nndsb60jqgduJImgLlCIpUy86bbf8JUsLgCFJAd8l4CvuYpS7MRE/zxpmlr?= =?us-ascii?Q?vlSoS7eDgBwMgI/49yXoyOuZO+SCxgkueS6zK2pR9H4C2RS57zjC5YXoTqKE?= =?us-ascii?Q?4Pnjk7GNTMq6Mscw07SKnbaAb8WI37qwY1Rgf/Xix6m5h3CxUa7VIpimTUvG?= =?us-ascii?Q?3gT16NwWAShJ86Cwy7aXeIpf0kYAoQRGb9Dxens+P8n5Mb16YmSgiFAylyYh?= =?us-ascii?Q?R7oZlS4M0v2/LgW4J98+WwhFMvronnurgczVepWQ3JqovnregKxCnjr2G3Kc?= =?us-ascii?Q?8h8x/RSUYPL98zhIvdynQaX3evCqsiX84LmjnQDZTZ7Q/SYwmu96BU8tZGaI?= =?us-ascii?Q?IsYtD8RXsYntnM1G2xFdy3N8QQ5oUorg6n3G2oV86ufs1M4Ft8qDlQmT68ub?= =?us-ascii?Q?sMSHoAhKT4qF0QTJBOOB1s1e6TReEzxZLnUTlLu5jGORraHY7ZV7Jgwg22Nq?= =?us-ascii?Q?oHjAd/QmUAIbu5qhxqpmH27ntfDn3Z+97z781u/JG5QLKfrb0DBjnB4V9hJd?= =?us-ascii?Q?ptUOPpZV3v71ZullKTdvIr0Axil5+BFGOPCViIwSVpGOJMCn+g5mt+NBL7Yn?= =?us-ascii?Q?JDEYlnbgLyjFoBKRG2QCz4RpNVaTycy0vEhFEC9wUDnJKudaQBYnaI44H/Xa?= =?us-ascii?Q?1dQfutI1wUAJ4Jm7pt4O/WUFsq6hLZgI0e2VyIHo2T0yvXCpIWLV3c6tNhEM?= =?us-ascii?Q?pygbkGDO+WGR8rvQiafYiJf701AMbId3ean0/gkaYNWm7k6Xy0Awg24HDaLS?= =?us-ascii?Q?q0SOE7DQMAeB37z606amlbW3sfjI7tZzGBJN59fAbJT0KJ+Wt6bK2739Rk/D?= =?us-ascii?Q?y4odUS3XiToKkjv3xmifOR1ZYjd1bU2ovYnebMHZH+u3nYUtFPMJkD/JBeOJ?= =?us-ascii?Q?PLggYgJmbw56LyQf0whlXwbKT+CM8t09+3TZdasIWxi+gjEdGXSIfqjG0XPe?= =?us-ascii?Q?FBxEg5rqFWz4NDGfCWxE1SvUkE/q+wO+BTpO0F7qL5oHQ6BjCtsFOE2BDbRO?= =?us-ascii?Q?Op9UUr+BWIy7Rko28zjIbtf84Fy/WrbTBE3kZG/e/H+kdGB2OS5BhUD92SYO?= =?us-ascii?Q?lXNzjTr5UE/nuKw9fqMEe1YVjDVdV6ylzEr7J/8LOPB+cSJ4J+29uc1EVwS3?= =?us-ascii?Q?L41Eqsu62dfEmeqikr8yxoKXOr3aLdzINIbH0c3KBdleTZugN70VZ48ZaB0A?= =?us-ascii?Q?s5kZtm2QqhUTnuHaR1V+XwsDisD1NoqXe/wlLK49WUUYMGWvZn2r3xFDKXMv?= =?us-ascii?Q?+097zvY/qF6HfrSYlun/5t/GwRYRibVG67JgaLGSeye2T/qiXDOQSbXUbpFO?= =?us-ascii?Q?X/ms+iIFMsJiGEx8wVbTsAB4QuTQiP0/G1qVp/ZgTiI5nCyMPBkv5ED1rxys?= =?us-ascii?Q?rgZegj8ncJriWOMMcfCKedf3NZTXbJ3ZZtPjnBOERfv17AC5dvvtMx5ukTAl?= =?us-ascii?Q?iGVBOLl2ASJxhN2OWQPJyMsqBz+fMJXmr0Ii70w6Bj6IOMP+i8ywfOdxr+m1?= =?us-ascii?Q?iHoCjsDQWunzlF3CIPU7f4xH2mpRoinVI4I5lrW46DavFrKtG9/fVR9rveoI?= =?us-ascii?Q?qGsZiVWueTOQ/fsMS8Wqqs5BoHlAYaOUe3Ylnl15F5/KUEJERO6U2SufQFYk?= =?us-ascii?Q?zKDYJ4/75Pq4lm9t4a8gEQuhoS/sZoyeIGJVIama5+df?= 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: 3bc92abc-dbd8-435d-905a-08db1a576b52 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2023 13:18:16.7639 (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: BrYuEwnwuUK0P7L/AdXv7Auz48jBoQC7JRiBUsxvd8TF0IysEt00r70jukxB/uazlHxbTa1Rnw3K2VwIvRnqzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6801 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for your review, Abner. Version 2 patch is sent. I also fixed uncrus= tify issue together. Regards, Nickle -----Original Message----- From: Chang, Abner =20 Sent: Thursday, February 16, 2023 8:56 PM To: Nickle Wang ; devel@edk2.groups.io Cc: Igor Kulchytskyy ; Nick Ramirez Subject: RE: [edk2-staging][PATCH] RedfishClientPkg: Add mechanism to reboo= t system if config is changed External email: Use caution opening links or attachments [AMD Official Use Only - General] > -----Original Message----- > From: Nickle Wang > Sent: Tuesday, February 14, 2023 8:43 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy=20 > ; Nick Ramirez > Subject: [edk2-staging][PATCH] RedfishClientPkg: Add mechanism to=20 > reboot system if config is changed > > Caution: This message originated from an External Source. Use proper=20 > caution when opening attachments, clicking links, or responding. > > > When system configuration is updated from RESTful interface, we need a=20 > system reboot so that the changes can be applied. Introduce PCD=20 > "PcdSystemRebootRequired" to RedfishClientPkg. RedfishFeatureUtility=20 > library will enable this flag when system config is updated. > RedfishFeatureCore driver will check this flag and perform cold reboot=20 > after all Redfish operations are finished. PCD "PcdSystemRebootTimeout" > is used to specify how many second BIOS will wait before reboot system. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > .../Library/RedfishFeatureUtilityLib.h | 3 + > .../RedfishFeatureUtilityLib.c | 65 ++++++++++++++++--- > .../RedfishFeatureUtilityLib.inf | 2 + > RedfishClientPkg/RedfishClientPkg.dec | 8 ++- > .../RedfishFeatureCoreDxe.c | 18 +++++ > .../RedfishFeatureCoreDxe.h | 3 + > .../RedfishFeatureCoreDxe.inf | 5 ++ > 7 files changed, 93 insertions(+), 11 deletions(-) > > diff --git=20 > a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > index 1325976d8c..bb5dc4f4ac 100644 > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > @@ -2,6 +2,7 @@ > This file defines the Redfish Feature Utility Library interface. > > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development=20 > LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -14,6 +15,8 @@ > #include > #include > > +#define REDFISH_ENABLE_SYSTEM_REBOOT()=20 > +PcdSetBoolS(PcdSystemRebootRequired, TRUE) > + > // > // Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG > // > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtil > ityLib > .c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtil > ityLib > .c > index bfd6fff2a7..9883a4d919 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtil > ityLib > .c > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeature > +++ Ut > +++ ilityLib.c > @@ -2,7 +2,7 @@ > Redfish feature utility library implementation > > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development=20 > LP
> - Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -324,7 +324,12 @@ ApplyFeatureSettingsStringType ( > RedfishValue.Value.Buffer =3D FeatureValue; > > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to %s failed: %r\n",=20 > __FUNCTION__, ConfigureLang, FeatureValue, Status)); > } > } else { > @@ -385,7 +390,12 @@ ApplyFeatureSettingsNumericType ( > RedfishValue.Value.Integer =3D (INT64)FeatureValue; > > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n",=20 > __FUNCTION__, ConfigureLang, FeatureValue, Status)); > } > } else { > @@ -446,7 +456,12 @@ ApplyFeatureSettingsBooleanType ( > RedfishValue.Value.Boolean =3D FeatureValue; > > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n",=20 > __FUNCTION__, ConfigureLang, (FeatureValue ? "True" : "False"), Status)); > } > } else { > @@ -561,7 +576,12 @@ ApplyFeatureSettingsVagueType ( > FreePool (RedfishValue.Value.Buffer); > RedfishValue.Value.Buffer =3D CurrentVagueValuePtr->Value- > >DataValue.CharPtr; > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureKeyLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %a to %a failed: %r\n",=20 > __FUNCTION__, ConfigureKeyLang, CurrentVagueValuePtr->Value- > >DataValue.CharPtr, Status)); > } > } else { > @@ -585,7 +605,12 @@ ApplyFeatureSettingsVagueType ( > > RedfishValue.Value.Boolean =3D=20 > (BOOLEAN)*CurrentVagueValuePtr- > >Value->DataValue.BoolPtr; > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureKeyLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to %a failed: %r\n",=20 > __FUNCTION__, ConfigureKeyLang, (*CurrentVagueValuePtr->Value- > >DataValue.BoolPtr ? "True" : "False"), Status)); > } > } else { > @@ -603,7 +628,12 @@ ApplyFeatureSettingsVagueType ( > > RedfishValue.Value.Integer =3D=20 > (INT64)*CurrentVagueValuePtr->Value- > >DataValue.Int64Ptr; > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureKeyLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s to 0x%x failed: %r\n",=20 > __FUNCTION__, ConfigureKeyLang, *CurrentVagueValuePtr->Value- > >DataValue.Int64Ptr, Status)); > } > } else { > @@ -775,7 +805,12 @@ ApplyFeatureSettingsStringArrayType ( > ASSERT (Index <=3D RedfishValue.ArrayCount); > > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n",=20 > __FUNCTION__, ConfigureLang, Status)); > } > } else { > @@ -869,7 +904,12 @@ ApplyFeatureSettingsNumericArrayType ( > ASSERT (Index <=3D RedfishValue.ArrayCount); > > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n",=20 > __FUNCTION__, ConfigureLang, Status)); > } > } else { > @@ -963,7 +1003,12 @@ ApplyFeatureSettingsBooleanArrayType ( > ASSERT (Index <=3D RedfishValue.ArrayCount); > > Status =3D RedfishPlatformConfigSetValue (Schema, Version,=20 > ConfigureLang, RedfishValue); > - if (EFI_ERROR (Status)) { > + if (!EFI_ERROR (Status)) { > + // > + // Configuration changed. Enable system reboot flag. > + // > + REDFISH_ENABLE_SYSTEM_REBOOT(); > + } else { > DEBUG ((DEBUG_ERROR, "%a, apply %s array failed: %r\n",=20 > __FUNCTION__, ConfigureLang, Status)); > } > } else { > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtil > ityLib > .inf > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtil > ityLib > .inf > index 84f338e680..d556990b63 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtil > ityLib > .inf > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeature > +++ Ut > +++ ilityLib.inf > @@ -1,6 +1,7 @@ > ## @file > # > # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development=20 > LP
> +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -49,6 +50,7 @@ > gEdkIIRedfishConfigLangMapProtocolGuid ## CONSUMED ## > > [Pcd] > + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootRequired > > [Guids] > > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index d3c97ecf68..634456e5d5 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dec > +++ b/RedfishClientPkg/RedfishClientPkg.dec > @@ -2,7 +2,7 @@ > # Redfish Client Package > # > # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development=20 > LP
-# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All=20 > rights reserved. > +# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All=20 > +rights > reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -65,3 +65,9 @@ > > gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartup > E > ventGuid|{0xB3, 0x8F, 0xE8, 0x7C, 0xD7, 0x4B, 0x79, 0x46, 0x87, 0xA8,=20 > ventGuid|0xA8, > 0xD8, 0xDE, 0xE5, 0x0D, 0x2B}|VOID*|0x10000003 > ## Default Redfish version string > > gEfiRedfishClientPkgTokenSpaceGuid.PcdDefaultRedfishVersion|L"v1"|VOID > *|0x10000004 > + ## The number of seconds that the firmware will wait before system=20 > + reboot > + > + > gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootTimeout|5|UINT16| > 0x2 > + 0000002 Can we name PcdSystemRebootTimeout as PcdRedfishSystemRebootTimeout? So it = won't be consider as a generic PCD for any use case. This is only for Redfi= sh. > + > +[PcdsDynamicEx] > + ## The flag used to indicate that system reboot is required due to=20 > +system configuration change > + > +gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootRequired|FALSE|B > OOLEA > +N|0x20000001 Same as above, we can name it as PcdRedfishSystemRebootRequired I have no problem with other changes. Thanks Abner > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > index 3414f0c942..b2b1307b6c 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > @@ -3,6 +3,7 @@ > for EDK2 Redfish Feature driver registration. > > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development=20 > LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -230,8 +231,10 @@ RedfishFeatureDriverStartup( > ) > { > REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; > + UINT16 RebootTimeout; > > StartupContext =3D (REDFISH_FEATURE_STARTUP_CONTEXT *)Context; > + RebootTimeout =3D PcdGet16 (PcdSystemRebootTimeout); > // > // Invoke EDK2 Redfish feature driver callback to start up > // the Redfish operations. > @@ -249,6 +252,11 @@ RedfishFeatureDriverStartup( > return; > } > > + // > + // Reset PcdSystemRebootRequired flag // PcdSetBoolS=20 > + (PcdSystemRebootRequired, FALSE); > + > // > // Signal event before doing provisioning > // > @@ -263,6 +271,16 @@ RedfishFeatureDriverStartup( > // Signal event after provisioning finished > // > SignalAfterProvisioningEvent (); > + > + // > + // If system configuration is changed, reboot system. > + // > + if (PcdGetBool (PcdSystemRebootRequired)) { > + Print (L"System configuration is changed from RESTful interface.=20 > + Reboot > system in %d seconds...\n", RebootTimeout); > + gBS->Stall (RebootTimeout * 1000000U); > + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > + CpuDeadLoop (); > + } > } > > /** > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > index 84b5e456d1..af274c01ca 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > @@ -2,6 +2,7 @@ > Definitions of RedfishFeatureCoreDxe > > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development=20 > LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -17,6 +18,8 @@ > #include > #include #include=20 > > +#include > +#include > #include > #include > > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > index ddcf991006..6cf35694fb 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > @@ -4,6 +4,8 @@ > # drivers for the registration. > # > # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development=20 > LP
> +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# > # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -40,6 +42,7 @@ > RedfishFeatureUtilityLib > UefiBootServicesTableLib > UefiDriverEntryPoint > + UefiRuntimeServicesTableLib > UefiLib > > [Protocols] > @@ -47,6 +50,8 @@ > > [Pcd] > > gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartup > E > ventGuid > + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootRequired > + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootTimeout > > [Depex] > TRUE > -- > 2.39.1.windows.1