From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (NAM02-SN1-obe.outbound.protection.outlook.com [40.107.96.85]) by mx.groups.io with SMTP id smtpd.web10.9100.1676552135139850781 for ; Thu, 16 Feb 2023 04:55:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=SF80RCGx; 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.96.85, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Isrer7s9ggxfMJcNtMsB0nNZQrjGYUj22xZyF9Jc8eLsuiSA4JLigG+KtNKVTIGt2i/4ibtr7Cyj2Phwlk/GsfCSjm3bCNY+n2n9Tllf1yTctLy/57pNRkjk2T6rnXCXHMa5EV0ccAsV8rlUJIJZZKGdUNT5NEgF8NIGJSqZvDYWUI2IAz9elFR5JqFQQO9trW/7LEzwF7mZfNBX9u0aZnvq10E6XzsOsU3R0PoyNGcaf468SkBLYyH/e/F25hmXAesKpF6RbVWhGzjRXIJwuGkmIKvffZ9c48e6M8v7tnkX/qJ7bOQ0xqdUIE70JEYLPjeUGpiwyWeOCln312cw/w== 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=RDURZ/fNLV/Lc7grRZJs1j5cgBKqvwXuaVqJ7RSj7vM=; b=jo3vcEdzqFC09TBznzS5/S35HtlB1CrkWElDbohMqE8WRzMwy4JvVAkyENSpWykFDpqDvh2FNg+yQBhAfblMQEUrX6xESiRmOc3+CeaRgedPJo7Tdg6AvAH+vG0Imd34Rjv0LbABizho8x3exR52aayXunniU3mkXGmQlywuFD2G35OJPdXCsG0OYk1MU/oaINqdSTd0khVnfy63QYU0eEtOApHo4J6pMA4AJWDU9FRkmYN/0VVlbOtv/umas0vyNM3NWATJMujNm2HbeZXVCpJq/Ivcaqz4gOWEHOlwb31BdogRuftEuNNnwAf8/nX0yg97NaYLjyF617hhv0mQ+w== 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=RDURZ/fNLV/Lc7grRZJs1j5cgBKqvwXuaVqJ7RSj7vM=; b=SF80RCGxi3sNXmY3z8UmlWZruzPUNWQKc/WZpEc42uk7n9LeTRNOIBTGDoX+e8KbIr87q804ep8erBet72gFozGa4/4x3wL3N88CUoQcu0baN1+9zxPMZ62ep2IbFM8PdpiQL2KLZmuCD2Vcs5KKnXywF1TvSXuCfsTLAKmLyc4= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by CH0PR12MB5090.namprd12.prod.outlook.com (2603:10b6:610:bd::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.13; Thu, 16 Feb 2023 12:55:32 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::d606:ab63:cf3:5d36]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::d606:ab63:cf3:5d36%5]) with mapi id 15.20.6086.024; Thu, 16 Feb 2023 12:55:32 +0000 From: "Chang, Abner" To: Nickle Wang , "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: AQHZQHHa2gdXckYNckylMk5iKdjV367RiVxw Date: Thu, 16 Feb 2023 12:55:32 +0000 Message-ID: References: <20230214124236.145-1-nicklew@nvidia.com> In-Reply-To: <20230214124236.145-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-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=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|CH0PR12MB5090:EE_ x-ms-office365-filtering-correlation-id: b39c8108-fc16-48de-aad0-08db101d16ce x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 2lPGa+n14O+Y/R8RBRH6T9uBqvLsgWTzvfsY2p6ExG7Aewj4eyJ1uCmcLMfTWNcX7M7awYvqeYRyTrsEea/VCCm6K/iT/R3yOg2E/NblY5VgetYDlWMdn3o1FQ9YVDJwgV7Lf3PY2nEX96ljY/T+GLYLUP0bJp1XjfqFGFtyVRVzxMg32sFH2LEYcJgh9SVxnmm+1BkMHBJhzw32D6jFAsms7z1b2/eIO8f2r6M6UUvVICjk2w12ue3T0t6Hg1olFdyNzmQkSxpDyPsc+p0sv1n7x+/B5iqK4g/XL+at2uphKFlgz3/r7Fhb7jyYQ8pG4FmImJo0J2bQPPiYuB13sVEQtIEzx2eOJfNlGWqtZjcSemq1KbxFOg3kjYzbe6X1hF0KgFYUe260Dr4Gw4AunD5UdcY0niiy8JcFIi8lcEbjQBXRTw3oIEOfoqtNwrzue5CmWzOwQhHfo/LFYOX7m81AjxaBGJasty3o7DqGAfMm7DMqB3fp00MlauUgRYKE6n+GRAeJQbD3qe+zC8/NVi7ejAgvPp9FdteQ0J3JCtRXYVuiRGfRGyYQeIL4Drux1Sp3i27UsK4Qdneswio0ileoTojG3OkHRB1q+PR10Vch1bRf985MvMmqOE7ujIAAWvPAI55AghDUl1YT02gx4KV4LDtUTZ2TZXuZnygr1aYKZxEZ7GliNS+05I1RiKhxfZKedBuM3NnpxjkW7vBACA== 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:(13230025)(4636009)(366004)(346002)(376002)(136003)(39860400002)(396003)(451199018)(5660300002)(52536014)(33656002)(8936002)(30864003)(54906003)(110136005)(2906002)(4326008)(55016003)(71200400001)(64756008)(41300700001)(8676002)(66446008)(478600001)(66476007)(66556008)(66946007)(316002)(7696005)(76116006)(122000001)(83380400001)(38100700002)(86362001)(26005)(186003)(38070700005)(6506007)(53546011)(9686003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ICreKEVU0VzrNqMM16AY9ZEfSH7tOqJ8kiPmJ8iZclwUTxJQcX0ogVpqo5Pp?= =?us-ascii?Q?JAcA4pvNTMyErMij5MSvpDAyEVlPc22O917awh02a8c0Wry+UXqww31q+OFf?= =?us-ascii?Q?4ZTkYolBUVYXKcH/NdDAv/zxL/VFUap2q8Mu/U+DyDvcXuTZpZTElsYyv6B4?= =?us-ascii?Q?9rqBcLVBvgDJZV918my4+YbvjGE5cXWeP13Ls3Bm2dwrV84vu6c/+XCiGxGy?= =?us-ascii?Q?lsbOO8hrAvfLfYtwt5yt9oRsCqn5KA4OqMhqbHKQgy4p7ntvvcelCupk86pY?= =?us-ascii?Q?6PvUS2MwbD3cWEnaDFsY/OwtMUteKrThaQkw9Y3G1VRSXF6qQZGx7dPr8j5O?= =?us-ascii?Q?K1JgZp5yKz9u7Gh/NPQkh5belBW5Ed/4DyY6ovYWxG5xP34erv9bBWP3wqNe?= =?us-ascii?Q?UQJ8EX2ZLDwwTf9B9WQQFRglKxd+6cECk4VEDxPPKZyFsjOnByIKyHCVRTVt?= =?us-ascii?Q?azZreUHjhBDAXbfzh7OF70q2z/Hymh+V0FLbXnP6WC15BImd9UEyf/UwJIWK?= =?us-ascii?Q?F+Ck460aMc9UkU3koVPwgWj9zrfjUG9wma5lh2SM6Yzii+Le6Bk4K6Fms9vz?= =?us-ascii?Q?Luv0Fkb2rnOjaI9ha2Xsm/FWJqqZsbHoWEhDhkizRX6Hq6xWAIcfEc/LlfFp?= =?us-ascii?Q?58t78vhVuAAVm/L1Hxl2GKDrLvSevAMsWcZkUFDKWkxHIVpKHQEiHB6f6O+e?= =?us-ascii?Q?NR19e4zCKmfobpMMX2d1+EAIJneKW5KVyQ0OivDD0VH0N+fZ+KvMwZ3ni5rT?= =?us-ascii?Q?/k2x0VrhubRkls4gpw3iVGrC+WuIGnLP5Nsq20P/0rv1UQv3CMP5gAKCR0ev?= =?us-ascii?Q?0frzUQGZ/fJqoMVeOl70BgLf6emA7vVzsiczy6F+6EOm3zeK4hi298y6Q3Yj?= =?us-ascii?Q?AZn5/m7DZEYRc6Xad+MNQSU3ApKuG1jGjsPJFBFumJkvEOyElkUeRAYF1e+E?= =?us-ascii?Q?OL9/EmutGgNUJjtacsYVfi6cc58CRoQ02WQ4QrkuxJvrSti+U+24EtFCO32Q?= =?us-ascii?Q?2VF5vNOyJ1cqB7Q1NPHzHWVTVEsLtF/3BHZd+9HM5oZtCuRf4kJgOaJ6SnHv?= =?us-ascii?Q?/fFKvGQIhK1AQt9+eOkTBEoEVOFpBbSsmXomdT9FkhufDjjdqOy4zuZguHpF?= =?us-ascii?Q?F7aKV/ak8BgverdOny6UTE4sKUigskqgQPsAhBPwamebfObCf0/I9LCsO6iN?= =?us-ascii?Q?huYe5NwU4dXgkNQHwEbzOOm0JSC2HMuLJmIwgdk4HJMUBM475qpgynQ1+wx/?= =?us-ascii?Q?T4TvKSvdKydJjuXI/hLoGFjlenv15IeP1cIGIBJWs4y2qsH8a7/WOQj0HT25?= =?us-ascii?Q?k/8KTKOQEVO3TeSe68DS63J65sQUAxweb0J0zHiuxz8sDe/QuLZS4tHdROHR?= =?us-ascii?Q?RG1qIKBfj9QaaopVClhHr+69DVIbrW7LajVM3VvJAdi86dNJ1e+Av0/4cQRA?= =?us-ascii?Q?Wmv9sCYQSD5j2mQx8iFT9NiaVKcwk5LjT84u98i2Xazt56KB1WlsmupwdEx0?= =?us-ascii?Q?ZTu+W9/yb7kc0dA/EWLdNFA/jJ9iNoFVb0EnxQ4LKdY1syX9/qFpNW7kMsyv?= =?us-ascii?Q?PA6ypsMLupqdPDVtqtk=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: b39c8108-fc16-48de-aad0-08db101d16ce X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2023 12:55:32.5483 (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: Pn0Vw9CkKR+v/g7kRgumbBlmmSOVvsm1ckHuCEnvdVYxqm/+7HbXwi6yKvvrN8KfFAmhWjS/8jQyctRmeK/kPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5090 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [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 > ; Nick Ramirez > Subject: [edk2-staging][PATCH] 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 > 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(-) >=20 > diff --git 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. >=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(PcdSystemRebootRequired, TRUE) > + > // > // Definition of REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG > // > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .c > index bfd6fff2a7..9883a4d919 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 > @@ -324,7 +324,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 { > @@ -385,7 +390,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 { > @@ -446,7 +456,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 (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 %a to %a failed: %r\n", > __FUNCTION__, ConfigureKeyLang, CurrentVagueValuePtr->Value- > >DataValue.CharPtr, Status)); > } > } else { > @@ -585,7 +605,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 { > @@ -603,7 +628,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 { > @@ -775,7 +805,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 { > @@ -869,7 +904,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 { > @@ -963,7 +1003,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/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > index 84f338e680..d556990b63 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib > .inf > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt > +++ ilityLib.inf > @@ -1,6 +1,7 @@ > ## @file > # > # (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 +50,7 @@ > gEdkIIRedfishConfigLangMapProtocolGuid ## CONSUMED ## >=20 > [Pcd] > + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootRequired >=20 > [Guids] >=20 > 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 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.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.=20 > + > +[PcdsDynamicEx] > + ## The flag used to indicate that system reboot is required due to > +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. >=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 > @@ -230,8 +231,10 @@ RedfishFeatureDriverStartup( > ) > { > REDFISH_FEATURE_STARTUP_CONTEXT *StartupContext; > + UINT16 RebootTimeout; >=20 > 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; > } >=20 > + // > + // Reset PcdSystemRebootRequired flag // PcdSetBoolS > + (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. Reb= oot > system in %d seconds...\n", RebootTimeout); > + gBS->Stall (RebootTimeout * 1000000U); > + gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL); > + CpuDeadLoop (); > + } > } >=20 > /** > 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 >=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 > @@ -17,6 +18,8 @@ > #include > #include #include > > +#include > +#include > #include > #include >=20 > 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 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.PcdSystemRebootRequired > + gEfiRedfishClientPkgTokenSpaceGuid.PcdSystemRebootTimeout >=20 > [Depex] > TRUE > -- > 2.39.1.windows.1