From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.49]) by mx.groups.io with SMTP id smtpd.web11.16408.1683864729515663007 for ; Thu, 11 May 2023 21:12:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=Iw179bLh; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.243.49, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eCnm7Aa+kRu/8CZ/cwdAVGBddCXKkhZ/AUgvERmDFNjXOSxDJ+WWh/f2ZLYZl4tayf7euWkClsU1uUZ8XEWyIoKdqtlj/f+nvvHLuWZ91SPzPUa6kby+f/8ysDfS44+ANP4/6dsBg/hthVJbPlE7hjccorQQnoDPRzjbvg74+Tr9h+CCxmiXNxRkj/X3qe9BXoNLH15tSU429/GWY+djATanGAQIpwndLtJIL0kMhnamREvk1/dAvZSu8Uk7JhpH1OlJIMoRAjz9ZBDu1C2STMdxHgHYaiJFSs5/64ZsLX2qLtSDXu8AfHmTwEgMhzu9pPBHHmxMrXIV0EpHrucSCg== 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=eLajkrQO+qcpAw36HxRKk/qN8LCRtyl5KZCtiY2TgtM=; b=Tr1EM7KT3HNQUrVQiDYYGcIdcNcLeW7yr2edSygH/EqW3L0SZZSX/vLYqEhtZQD/CNlyapH6zzeqq3ZTWzWZ+kSxvnGCanAasmtLbQxvWJCInvH640hnyjLPJ8BDoCoVJz7EUb/9jsTWqEcNn3h3nQo3/0//5mf7a3lQrAhhSCma09uxL2Z82pC1tOnYz0eMLsjf3WOFLbHv0finuqvxyIKKBRjy+29WDgdoc/3lvpysgjun7vZciIK7XHYANXavH1FDcU3tlOkj983bAKtK26KfUKXdGNfZ0xuN6OkfL+tRyCpdB46HIa+xIkvLTtBseHOULKShNd4ptVeOVE+OJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eLajkrQO+qcpAw36HxRKk/qN8LCRtyl5KZCtiY2TgtM=; b=Iw179bLhQSPxvssNluser1VnnXErDk48cnP8f/J5bKyvHs0Aja7jNVW/bjw+g6Uw0uaZR70OTHLFczUNvDbLKVn+E9vPXpClMcIhljp6EY1a08/VmUSOLfK6pnREN1nq0dgWRzC9a3mzl3sssvfdGHBub4nTyA2YUy3z71hYOnY= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by CH3PR12MB8355.namprd12.prod.outlook.com (2603:10b6:610:131::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Fri, 12 May 2023 04:12:07 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040%5]) with mapi id 15.20.6387.022; Fri, 12 May 2023 04:12:07 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-redfish-client][PATCH 3/4] RedfishClientPkg: Add mechanism to reboot system if config is changed Thread-Topic: [edk2-redfish-client][PATCH 3/4] RedfishClientPkg: Add mechanism to reboot system if config is changed Thread-Index: AQHZhIR+HmC7tE4qZE2ZeM+LVjQYwq9WBrnQ Date: Fri, 12 May 2023 04:12:07 +0000 Message-ID: References: <20230512034717.8627-1-nicklew@nvidia.com> In-Reply-To: <20230512034717.8627-1-nicklew@nvidia.com> Accept-Language: zh-CN, 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-05-12T04:12:05Z; 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=460f9de0-68be-448e-8b60-62a26b815218; 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=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|CH3PR12MB8355:EE_ x-ms-office365-filtering-correlation-id: f418b23f-4b6a-49d2-ed70-08db529f0ceb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kAewXBaaFLtJHEYDgMc/+UoQkfA4ej8NwYtc5LWZ5H0aJQV+5mDWzk6GWDELD3ENjKfn598CE8zUNnSJVMUnxSgsQrHDwAa5j3X0cByhp99oL1bBXUlH75hLdbbUAXvUiZUtM4hcg9oafnjhAfF1do84il7fVh2lT3SOYZFBurD8hkKdpyjk/JMouNG6HcZcIIuCoOsYK5wi37dLUXLQdMXFxTdvWmM+OGqPpvRu2eexLsZNBle48Q2Ut8B/aGokFAzKBxFpvuA4oiRDup7gfcA3a6+VQ4m+GC9IJznW8mZEffqLUfvkGAJlFB75zEkESoZxbdKnQ8ynGIwYY2K3yMeRfHMB0n0spaSpAr0aFqU3n6KJqwv1fkiDY6lKWLmmD1pXWlkYyHpbGi2bniRMpc4f/8FGRVRO+ZatIaneFAQNG/SNVHZWzy6d2lLpV/qD/4lXzk8GH3NRO785E4o6pJbe8HVdQXXcj44PcnSHt5Z4ReiUpJBNKCMiGLOIBb06Yotq+eSFS78+y3nMUEs8HNCGoZFSczqA3Ti6gbT4e5tm9vKtrOQFn98hlG8I0iqTOQqXs8hG8ciZ7h6wDO4F1T1V5YUa1n+tXW4J+v1VwLFKDzHpmv6zdvulJGNf6Bzi x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(366004)(346002)(39860400002)(396003)(451199021)(6506007)(26005)(9686003)(122000001)(38100700002)(7696005)(38070700005)(186003)(71200400001)(83380400001)(2906002)(41300700001)(4326008)(76116006)(30864003)(8676002)(55016003)(33656002)(66556008)(66946007)(52536014)(110136005)(478600001)(64756008)(53546011)(86362001)(5660300002)(66446008)(8936002)(316002)(66476007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?QUoaRBVIwsoAejoCH37G2cYluwgfCWgVD37Ch0TwrQtixinxI+TgBA7Mg86n?= =?us-ascii?Q?iEwibRKjT1PwzR7UTcuEm7o2TeHAkinEacIiUOkmN+3OLbw6oq25wY+zxq4Y?= =?us-ascii?Q?P/GxMwI2GZ5JBcehWv37cplT2uKHI+8FiRg0OFZpcLALS/Xxc0lJO92canEG?= =?us-ascii?Q?jytTZG5Qam+aAngk/t4r1FyucpiG1mpo5wpX3LvbOSgRVGHBBOQTbIhFiQ+n?= =?us-ascii?Q?SFCTMMB7pinTLR3EgwQLR2eH7gbmdVnSbqAFxKKrziE7a6l+tnawphcAOsQ4?= =?us-ascii?Q?bHjXUvZ2NFCz+3Oa8j40YfS66Wvs6NmFhL69chrY8OixQjhF0dNX0QAyJ9re?= =?us-ascii?Q?eC1wCe+B6VzqpDWkbKmCxs569KHfZt3uD6InquXNrgZYKuAEnt2IRH8LNcnp?= =?us-ascii?Q?6Pn8uEZlB98bRjXCyhDM/PCR+YrFGuhTLyp7pWU5OxVtIyG6s9y+nhci9zxm?= =?us-ascii?Q?RBAmAVOf2BmGs7M/CcpyUSN2DOwg1RZ7trb8SCSLNb+oGW0sj4d+I/iqXYPM?= =?us-ascii?Q?g0Qz1d3SlQWgBM2HBCQ+aXs0A2EB5lAmDhCbEBKvyd9S/s2qStWQnUXDLiUI?= =?us-ascii?Q?Xr0dU8sw+yyES93gGIDGpJqbZ7YeL8Boo9v3T9hULVuB6KyI30iuV5GC5zui?= =?us-ascii?Q?HhwG1f2Ix+qblexBpsuvn9QyhLXaup7KmeVCehNwmQ5pQcUj/J6A5GAMjYLn?= =?us-ascii?Q?siZ4cE1J+km6kBjzUcQBi253SZgxBo0VoaBtWYd4UurAeCl9pohH4y7gmFZl?= =?us-ascii?Q?5nucL0f8gjgDUl33YYng2o4OP7eI+dtQ/sGy/noM+1fCVkTzNwINYplvnh7h?= =?us-ascii?Q?nqGoVz9qNLy+nIq/Q92X6uRgC/VCkTCkdAQ4CwptU1c8YU6AFnVhWqBS/g4c?= =?us-ascii?Q?A47nG3TlG8LWtomXy2Lho1JJlKHVbIsXBVAgn17ggAtRh7LXe0mePaYezwtE?= =?us-ascii?Q?/33E6E8rKoD9yE8b+QAgV6OV0vcfWPiqycVvN3lSEGpJ8Zr8iYUrdp9pWc7f?= =?us-ascii?Q?mS/d8lUKDY8g9p7A/k727RLOwaBl+kxTuwpRptsR3Z/Yw2K9KjdThUCGnpFz?= =?us-ascii?Q?iPsWkImcmL0bs/J4N/r2poz3Oy48w23o1skac2WQoU68SsMZ9i1OTTEv9zKo?= =?us-ascii?Q?A0/9LeIEenXt4jzfWZk+qL/+ZyPmTagSdv62NKnOfnbdo4OdWDW/1gVAy5BO?= =?us-ascii?Q?NQotBAQ9z/tJK6zbyIy3FM9KfNlKIsBabRLSMNu+6QQsN2+/iJ4B5tn/chJm?= =?us-ascii?Q?F+lAWw1AeuA6y6dcQI7fRnZrj1NHLpaBU2YkfBgVrJO5Wi2KcGqSDZeUhvLL?= =?us-ascii?Q?34kNTm4Jkt8MD+EiMHNfQXt6Jw9Y2G2+LMp24+1VYSWIklMWylMeDBywWJGr?= =?us-ascii?Q?dvCxV21lau2b8P6VDyQx7NGM5hNQ1B0g1Ti0DchuvuDEbqhNF8t+FD/ojpAT?= =?us-ascii?Q?r/4PydCfWO1isW7tDMuRt44/z0PhXFYm5lYgnlgtsdO5NKYYU0jmPgwhyU5n?= =?us-ascii?Q?eZdlwnhvm0UfyViMUVd/+TqLcEQGnoT2+K+MKbFvKQR8LMSSFFxhz+71P5HT?= =?us-ascii?Q?WiwdH7ewzUVvveyImvs=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f418b23f-4b6a-49d2-ed70-08db529f0ceb X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2023 04:12:07.2973 (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: OnGGZaZOq5Lh1tlG5JqUrL/yU1sQhiVLseIm2MlYkImoJ8bqXbmXouU40kylXVY0+7vIGVS3NK51VQ5aQY2JsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8355 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Friday, May 12, 2023 11:47 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > > Subject: [edk2-redfish-client][PATCH 3/4] RedfishClientPkg: Add mechanism > to reboot system if config is changed >=20 > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. >=20 >=20 > When system configuration is updated from RESTful interface, we need a > system reboot so that the changes can be applied. Introduce PCD > "PcdSystemRebootRequired" to RedfishClientPkg. RedfishFeatureUtility > library will enable this flag when system config is updated. > RedfishFeatureCore driver will check this flag and perform cold reboot af= ter > all Redfish operations are finished. PCD "PcdSystemRebootTimeout" > is used to specify how many second BIOS will wait before reboot system. >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > --- > RedfishClientPkg/RedfishClientPkg.dec | 8 ++- > .../RedfishFeatureUtilityLib.inf | 3 + > .../RedfishFeatureCoreDxe.inf | 5 ++ > .../Library/RedfishFeatureUtilityLib.h | 3 + > .../RedfishFeatureCoreDxe.h | 3 + > .../RedfishFeatureUtilityLib.c | 65 ++++++++++++++++--- > .../RedfishFeatureCoreDxe.c | 40 +++++++++--- > 7 files changed, 106 insertions(+), 21 deletions(-) >=20 > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index d3c97ecf..c0ab30ab 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dec > +++ b/RedfishClientPkg/RedfishClientPkg.dec > @@ -2,7 +2,7 @@ > # Redfish Client Package > # > # (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> -# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -65,3 +65,9 @@ >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupE > ventGuid|{0xB3, 0x8F, 0xE8, 0x7C, 0xD7, 0x4B, 0x79, 0x46, 0x87, 0xA8, 0xA= 8, > 0xD8, 0xDE, 0xE5, 0x0D, 0x2B}|VOID*|0x10000003 > ## Default Redfish version string >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdDefaultRedfishVersion|L"v1"|VOID > *|0x10000004 > + ## The number of seconds that the firmware will wait before system > + reboot > + > + > gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootTimeout|5| > UIN > + T16|0x20000002 > + > +[PcdsDynamicEx] > + ## The flag used to indicate that system reboot is required due to > +system configuration change > + > +gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootRequired|F > ALSE > +|BOOLEAN|0x20000001 > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > index 84f338e6..66d5dce6 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt > +++ ilityLib.inf > @@ -1,6 +1,8 @@ > ## @file > +# INF for Redfish feature utility library. > # > # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -49,6 +51,7 @@ > gEdkIIRedfishConfigLangMapProtocolGuid ## CONSUMED ## >=20 > [Pcd] > + gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootRequired >=20 > [Guids] >=20 > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > index ddcf9910..c67525ee 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 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 >=20 > [Protocols] > @@ -47,6 +50,8 @@ >=20 > [Pcd] >=20 > gEfiRedfishClientPkgTokenSpaceGuid.PcdEdkIIRedfishFeatureDriverStartupE > ventGuid > + gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootRequired > + gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishSystemRebootTimeout >=20 > [Depex] > TRUE > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h > index d2733476..14296432 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. >=20 > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -14,6 +15,8 @@ > #include > #include >=20 > +#define REDFISH_ENABLE_SYSTEM_REBOOT() > +PcdSetBoolS(PcdRedfishSystemRebootRequired, TRUE) > + > // > // Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG > // > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > index ff3c787a..a94c7930 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.h > @@ -2,6 +2,7 @@ > Definitions of RedfishFeatureCoreDxe >=20 > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -18,6 +19,8 @@ > #include > #include #include > > +#include > +#include > #include > #include >=20 > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > index e87af3d5..ed8a021c 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt > +++ ilityLib.c > @@ -2,7 +2,7 @@ > Redfish feature utility library implementation >=20 > (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> - Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. > + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -323,7 +323,12 @@ ApplyFeatureSettingsStringType ( > RedfishValue.Value.Buffer =3D FeatureValue; >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > 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", > __FUNCTION__, ConfigureLang, FeatureValue, Status)); > } > } else { > @@ -383,7 +388,12 @@ ApplyFeatureSettingsNumericType ( > RedfishValue.Value.Integer =3D (INT64)FeatureValue; >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > 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", > __FUNCTION__, ConfigureLang, FeatureValue, Status)); > } > } else { > @@ -443,7 +453,12 @@ ApplyFeatureSettingsBooleanType ( > RedfishValue.Value.Boolean =3D FeatureValue; >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > 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", > __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 (S= chema, Version, > 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", > __FUNCTION__, ConfigureKeyLang, CurrentVagueValuePtr->Value- > >DataValue.CharPtr, Status)); > } > } else { > @@ -588,7 +608,12 @@ ApplyFeatureSettingsVagueType ( >=20 > RedfishValue.Value.Boolean =3D (BOOLEAN)*CurrentVagueValuePtr- > >Value->DataValue.BoolPtr; > Status =3D RedfishPlatformConfigSetValue (= Schema, Version, > 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", > __FUNCTION__, ConfigureKeyLang, (*CurrentVagueValuePtr->Value- > >DataValue.BoolPtr ? "True" : "False"), Status)); > } > } else { > @@ -606,7 +631,12 @@ ApplyFeatureSettingsVagueType ( >=20 > RedfishValue.Value.Integer =3D (INT64)*CurrentVagueValuePtr->V= alue- > >DataValue.Int64Ptr; > Status =3D RedfishPlatformConfigSetValue (= Schema, Version, > 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", > __FUNCTION__, ConfigureKeyLang, *CurrentVagueValuePtr->Value- > >DataValue.Int64Ptr, Status)); > } > } else { > @@ -783,7 +813,12 @@ ApplyFeatureSettingsStringArrayType ( > ASSERT (Index <=3D RedfishValue.ArrayCount); >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > 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", > __FUNCTION__, ConfigureLang, Status)); > } > } else { > @@ -876,7 +911,12 @@ ApplyFeatureSettingsNumericArrayType ( > ASSERT (Index <=3D RedfishValue.ArrayCount); >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > 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", > __FUNCTION__, ConfigureLang, Status)); > } > } else { > @@ -969,7 +1009,12 @@ ApplyFeatureSettingsBooleanArrayType ( > ASSERT (Index <=3D RedfishValue.ArrayCount); >=20 > Status =3D RedfishPlatformConfigSetValue (Schema, Version, > 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", > __FUNCTION__, ConfigureLang, Status)); > } > } else { > diff --git > a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > index 0e513b16..5a3a9e4c 100644 > --- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > +++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c > @@ -3,6 +3,7 @@ > for EDK2 Redfish Feature driver registration. >=20 > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserv= ed. >=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -13,13 +14,14 @@ > EFI_EVENT mEdkIIRedfishFeatureDriverStartupEvent; > REDFISH_FEATURE_STARTUP_CONTEXT mFeatureDriverStartupContext; > REDFISH_FEATURE_INTERNAL_DATA *ResourceUriNodeList; > - > -RESOURCE_INFORMATION_EXCHANGE *mInformationExchange; > +RESOURCE_INFORMATION_EXCHANGE *mInformationExchange; >=20 > /** > Setup the information to deliver to child feature/collection driver. > + > @param[in] ThisList REDFISH_FEATURE_INTERNAL_DATA ins= tance. > @param[in] ParentConfgLanguageUri Parent configure language URI. > + > **/ > EFI_STATUS > SetupExchangeInformationInfo ( > @@ -70,7 +72,9 @@ SetupExchangeInformationInfo ( >=20 > /** > Destroy the exchange information. > + > @param[in] ThisList REDFISH_FEATURE_INTERNAL_DATA instance. > + > **/ > EFI_STATUS > DestroryExchangeInformation ( > @@ -239,8 +243,10 @@ RedfishFeatureDriverStartup ( > ) > { > REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; > + UINT16 RebootTimeout; >=20 > StartupContext =3D (REDFISH_FEATURE_STARTUP_CONTEXT *)Context; > + RebootTimeout =3D PcdGet16 (PcdRedfishSystemRebootTimeout); > // > // Invoke EDK2 Redfish feature driver callback to start up > // the Redfish operations. > @@ -258,6 +264,11 @@ RedfishFeatureDriverStartup ( > return; > } >=20 > + // > + // Reset PcdRedfishSystemRebootRequired flag // PcdSetBoolS > + (PcdRedfishSystemRebootRequired, FALSE); > + > // > // Signal event before doing provisioning > // > @@ -272,6 +283,16 @@ RedfishFeatureDriverStartup ( > // Signal event after provisioning finished > // > SignalAfterProvisioningEvent (); > + > + // > + // If system configuration is changed, reboot system. > + // > + if (PcdGetBool (PcdRedfishSystemRebootRequired)) { > + Print (L"System configuration is changed from RESTful interface. Reb= oot > system in %d seconds...\n", RebootTimeout); > + gBS->Stall (RebootTimeout * 1000000U); > + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > + CpuDeadLoop (); > + } > } >=20 > /** > @@ -298,14 +319,14 @@ NewInternalInstance ( > REDFISH_FEATURE_INTERNAL_DATA *NewInternalData; >=20 > if ((PtrToNewInternalData =3D=3D NULL) || (NodeName =3D=3D NULL)) { > - DEBUG ((DEBUG_ERROR, "%a: Inproper given parameters\n", __func__)); > + DEBUG ((DEBUG_ERROR, "%a: Inproper given parameters\n", > + __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } >=20 > *PtrToNewInternalData =3D NULL; > NewInternalData =3D AllocateZeroPool (sizeof > (REDFISH_FEATURE_INTERNAL_DATA)); > if (NewInternalData =3D=3D NULL) { > - DEBUG ((DEBUG_ERROR, "%a: No memory for > REDFISH_FEATURE_INTERNAL_DATA\n", __func__)); > + DEBUG ((DEBUG_ERROR, "%a: No memory for > + REDFISH_FEATURE_INTERNAL_DATA\n", __FUNCTION__)); > return EFI_OUT_OF_RESOURCES; > } >=20 > @@ -334,7 +355,6 @@ NewInternalInstance ( > The returned LIST_ENTRY is the ad= dress of > ChildList link list. > @param[out] MatchNodeEntry The matched node entry. > - > @retval EFI_SUCCESS New entry is inserted successfully. > @retval EFI_INVALID_PARAMETER Improper given parameters. > @retval EFI_OUT_OF_RESOURCES Lack of memory for the internal data > structure. > @@ -357,12 +377,12 @@ InsertRedfishFeatureUriNode ( >=20 > *MatchNodeEntry =3D NULL; > if (NodeName =3D=3D NULL) { > - DEBUG ((DEBUG_ERROR, "%a: Node name is NULL.\n", __func__)); > + DEBUG ((DEBUG_ERROR, "%a: Node name is NULL.\n", __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } >=20 > if (NextNodeEntry =3D=3D NULL) { > - DEBUG ((DEBUG_ERROR, "%a: NextNodeEntry can't be NULL.\n", > __func__)); > + DEBUG ((DEBUG_ERROR, "%a: NextNodeEntry can't be NULL.\n", > + __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } >=20 > @@ -467,7 +487,7 @@ RedfishFeatureRegister ( > BOOLEAN ItsCollection; >=20 > if ((FeatureManagedUri =3D=3D NULL) || (Callback =3D=3D NULL)) { > - DEBUG ((DEBUG_ERROR, "%a: The given parameter is invalid\n", > __func__)); > + DEBUG ((DEBUG_ERROR, "%a: The given parameter is invalid\n", > + __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } >=20 > @@ -483,7 +503,7 @@ RedfishFeatureRegister ( > while ((Index < UriLength)) { > if ((Index - AnchorIndex + 1) >=3D MaxNodeNameLength) { > // Increase one for the NULL terminator > - DEBUG ((DEBUG_ERROR, "%a: the length of node name is >=3D > MaxNodeNameLength\n", __func__)); > + DEBUG ((DEBUG_ERROR, "%a: the length of node name is >=3D > + MaxNodeNameLength\n", __FUNCTION__)); > ASSERT (FALSE); > } >=20 > @@ -548,7 +568,7 @@ RedfishFeatureRegister ( > // > // No URI node was created > // > - DEBUG ((DEBUG_ERROR, "%a: No URI node is added\n", __func__)); > + DEBUG ((DEBUG_ERROR, "%a: No URI node is added\n", > __FUNCTION__)); > return EFI_INVALID_PARAMETER; > } >=20 > -- > 2.17.1