From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web11.54865.1671554050091384770 for ; Tue, 20 Dec 2022 08:34:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=jLZAF9ZT; spf=pass (domain: ami.com, ip: 40.107.236.40, mailfrom: igork@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J1qxd3ocbxUn3W+HKpRP098Davl8Y9i/AAzJ8LMza7re6jbE2vLLq2NFyivkNrSMl1z7Ltyqq2boj3ppzzNV5XQfrpwGXeiqE8GTAFXOYjPNK/rLJUMzFdkZAbt8UT7V7l5O9S5tW1xgSFlfm0uE2h+Dqip85m6HDrj5P606eyXYDl4J8uMOc483e2mCelQQNWJnRRH14FkzPLvqgbrBgLrjeN/Al5snHIAmWNb/LjYzo0je1S05D5BXe1Dh920FhDudIwt499J36oJZNyCg2N8NvRPSRNdUmF4rP/jUU7gkYXaVEmJzf/FG6kfFX7Ej+Gdzu+fG5jJRmJIf8UPIiw== 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=h+v0/zkzKdgf8k7mH2FRKrIN8OPWrK3OX37un0tluno=; b=mJ3N5EH5NuXd/gwicvTVvbQib2XuQek+0mMjK2Czo/cKCY+Hj9KIiiVCbpD5WFDxGRsh3QIq2tIKZHiqHMnl2IkKRkdjp09jNST30qoz31HCxBSiUHzbAT3WJ7rNUSMXaV6Cl/H0YhmC3LYif5rR2S1/bvn8RxK1p3+DP11dZHC5o5OV+IVuEc7ExSr7tV30VzWUbSasnDBUZOf2ihGCl0e4LpAIHbc/kYPpy1jZUvQub0+uVxtmkb5qT61vuwP9DukECjKdw8WsfpICYpzUelvanwoERM1sVxb9v2/tQDxguv5e7LKxHzZOkUW99C5/QGlcXv2PebsCYBucivo2rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ami.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h+v0/zkzKdgf8k7mH2FRKrIN8OPWrK3OX37un0tluno=; b=jLZAF9ZTKCSxZLfuyndDTBewNbiIh0ekXikvLyb84Ig/ZWTXSe6UAepGm+kbu3WfhiyRSzup7q6U+7/aA9S/FrO2iFnWqOkmqnSwRNjhjJPZrVdObpVoxap2jWkcORTFc4MEPocuS1H/68n+GfOtoGIJwswLwLCYVz73PmZAMZk= Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by SA1PR10MB6341.namprd10.prod.outlook.com (2603:10b6:806:254::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 16:34:06 +0000 Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::f1ea:b179:62e1:8cb8]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::f1ea:b179:62e1:8cb8%7]) with mapi id 15.20.5924.016; Tue, 20 Dec 2022 16:34:06 +0000 From: "Igor Kulchytskyy" To: Nickle Wang , "abner.chang@amd.com" , "devel@edk2.groups.io" Subject: Re: [PATCH V3 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Topic: [EXTERNAL] RE: [PATCH V3 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Index: AQHZFD6jHV64CPjraUiUCizcTG0uEq52+PJw Date: Tue, 20 Dec 2022 16:34:06 +0000 Message-ID: References: <20221220064123.352-1-abner.chang@amd.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ami.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5185:EE_|SA1PR10MB6341:EE_ x-ms-office365-filtering-correlation-id: f810f37d-3591-44fa-52f9-08dae2a8036f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WBwuJhKClIdbE/rc0ofVrbFVaCWPH1dxqMJ2PDPL2k0FFtqVml3YDm/7HQloP9dQXCbuCaZ7HZn3n97FCFL9B+Im8yd7bHTv3y0tvC1OaUqM/gnnfA8gOcL+Rw47uZKrYcBn01Pps9bVAyyDmjHvKkJc8KZVf80MmC7EeJYE0b89oE4TJARLWEWmrCi+h6PC1dNBqiVMcrcNcorp/PWmaDY8Oo9MdZJBuu4z6xfGEfGqh+aQWUglBxdGxl4l/1mwmFcl75twG88eLlRpCxBPOMw9Z+TO4PG6tmHTzBLBUtkk7WVVpdadi1i3U+b4J2+3JoIK4iXW//C3hncIQEJ3fyUPI9WSMx71/xoK6gAKZvssP/0gUYQBl/DG7AIGHF9KM/Gy5zA2Ooy6hY1AS4AVVT2vA1YXeBJgdyXakvdL87DIAZWsHHjs7IUzc7fDC7hEvTSzg77h2wOS8XWFZjRypYTsf4Xeol9cVfB/eH4EnI8vqHBCddegsfmESZ33tLBtNq7xM0cWrSwlUoKqxET+RW4W8ZSxUy/1EFZcqO5VMmP8pH0uLBY/2NESe9ZZFHeePFgw1AVdnO6zAxqsa0LISBP18atIEnos8Rc7JPHRS7r12y6ENBwJqhEC9RKZSEWA8NKDrPKODMTjy4CvkxSF7wEt1KM3tx4J9O7MOCcIN64gNOhLqLbIoakm4kEZpYtT77BCVlEaaPGuqja7PXSIFg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5185.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(136003)(396003)(346002)(376002)(39850400004)(451199015)(110136005)(316002)(19627235002)(86362001)(38070700005)(53546011)(7696005)(66476007)(66446008)(38100700002)(122000001)(8676002)(6506007)(64756008)(66946007)(76116006)(71200400001)(478600001)(66556008)(5660300002)(83380400001)(52536014)(8936002)(33656002)(2906002)(9686003)(40140700001)(15650500001)(41300700001)(26005)(186003)(55016003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5I7RR5rtr7V3jY1q7Tl7B+izjbyOyQPJyqHj4O09OzZ6TqhMKWTflPDtNxIG?= =?us-ascii?Q?OjMymXILy4IQ279OGGkUNFhzRGBRz6vxhGTNFYecDSaMZGiSAezG7fxiukEa?= =?us-ascii?Q?srdW41BJQXJhhdcrmIA5XvqSb/VnI+DV/KTaL/K6dS7b0uykiLJvCVZa4crU?= =?us-ascii?Q?gqkyBCCq2PDZz+Cj2YWs1sxzzzDllbeIgLEZnjexYiaWXtjoCorLu8CJLY2I?= =?us-ascii?Q?r9v4ukJlHTM94mAxzzDJgStoNxeTiA92s7qBABHnpusj+4wuBG9fz4o92aN+?= =?us-ascii?Q?7/nyr1BGKZO7OGQqJfQTyrsRp2GvKPrWXRwWaVZb8XqubiM1WRwArNAN2W1r?= =?us-ascii?Q?abgCkPjJQPptA96u+GBCgAorqlT4bYHc+/3qPuF3+/uoO05lmmur7SeiVFyI?= =?us-ascii?Q?CBILV6GIrQAU3rXraTNGs7LAezcvORHWzyrGkubPjlwwouzFI910f3qGFkSO?= =?us-ascii?Q?DgEY3ixD9zrV6BHPCb8YG+sHrKlNg/ULB9MEm6igPaATdyQSvejVWcHpLtv4?= =?us-ascii?Q?+B/Y8ffD0+zUn0aHTEok7vjN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?us-ascii?Q?lwQE4BB/+usPQ/gmFKhDyb7uQEWFHvNtMOitIjixr2Fx4NaBjU1+GjFMI40B?= =?us-ascii?Q?0dljmKEFt+jxoFNVeMVkRjR/zykLIi3YBLQp2y4WQe1W3HBVGZthCl9fvWp9?= =?us-ascii?Q?T+86VPBq4mM6P8NmP10=3D?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5185.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f810f37d-3591-44fa-52f9-08dae2a8036f X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2022 16:34:06.5732 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SOuAIm0ENYs7u4OA19CYNU73sE+G1+41VTOojww1mKyDBgUOIfYUE/wT852/mcts X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB6341 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Igor Kulchytskyy -----Original Message----- From: Nickle Wang Sent: Tuesday, December 20, 2022 1:45 AM To: abner.chang@amd.com; devel@edk2.groups.io Cc: Igor Kulchytskyy Subject: [EXTERNAL] RE: [PATCH V3 1/2] RedfishPkg/RedfishHostInterface: Pla= tform Redfish HI notification **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** Reviewed-by: Nickle Wang Thanks, Nickle -----Original Message----- From: abner.chang@amd.com Sent: Tuesday, December 20, 2022 2:41 PM To: devel@edk2.groups.io Cc: Nickle Wang ; Igor Kulchytskyy Subject: [PATCH V3 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish H= I notification External email: Use caution opening links or attachments From: Abner Chang For some use cases, Redfish host interface table relies on the certain EFI = protocols installation at the driver connection. Redfish host interface DXE driver is not able to build the SMBIOS type 42h = record at driver entry point. This patch adds the mechanism in Redfish host= interface DXE driver to listen to EFI protocol installed by platform libra= ry that indicates the necessary information is ready for building SMBIOS 42= h record. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Reviewed-by: Nickle Wang --- .../Include/Library/RedfishHostInterfaceLib.h | 28 ++++++- .../PlatformHostInterfaceLibNull.c | 26 ++++++- .../RedfishHostInterfaceDxe.c | 73 ++++++++++++++++++- 3 files changed, 121 insertions(+), 6 deletions(-) diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h b/Redfish= Pkg/Include/Library/RedfishHostInterfaceLib.h index 8d8389b9647..22a8f9283cb 100644 --- a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h +++ b/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h @@ -2,6 +2,7 @@ Definitinos of RedfishHostInterfaceDxe driver. (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights + reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -19,7 +20,7 @@ /** Get platform Redfish host interface device descriptor. - @param[in] DeviceType Pointer to retrieve device type. + @param[out] DeviceType Pointer to retrieve device type. @param[out] DeviceDescriptor Pointer to retrieve REDFISH_INTERFACE_DATA= , caller has to free this memory using FreePool(). @retval EFI_SUCCESS Device descriptor is returned successfully in De= viceDescriptor. @@ -28,7 +29,7 @@ **/ EFI_STATUS RedfishPlatformHostInterfaceDeviceDescriptor ( - IN UINT8 *DeviceType, + OUT UINT8 *DeviceType, OUT REDFISH_INTERFACE_DATA **DeviceDescriptor ); @@ -40,7 +41,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor ( @param[in, out] ProtocolRecord Pointer to retrieve the first or the nex= t protocol record. caller has to free the new protocol reco= rd returned from this function using FreePool(). - param[in] IndexOfProtocolData The index of protocol data. + @param[in] IndexOfProtocolData The index of protocol data. @retval EFI_SUCCESS Protocol records are all returned. @retval EFI_NOT_FOUND No more protocol records. @@ -52,4 +53,25 @@ RedfishPlatformHostInterfaceProtocolData ( IN UINT8 IndexOfProtocolData ); +/** + Get the EFI protocol GUID installed by platform library which + indicates the necessary information is ready for building + SMBIOS 42h record. + + @param[out] InformationReadinessGuid Pointer to retrive the protocol + GUID. + + @retval EFI_SUCCESS Notification is required for building up + SMBIOS type 42h record. + @retval EFI_UNSUPPORTED Notification is not required for building u= p + SMBIOS type 42h record. + @retval EFI_ALREADY_STARTED Platform host information is already ready. + @retval Others Other errors. +**/ + +EFI_STATUS +RedfishPlatformHostInterfaceNotification ( + OUT EFI_GUID **InformationReadinessGuid + ); + #endif diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostIn= terfaceLibNull.c b/RedfishPkg/Library/PlatformHostInterfaceLibNull/Platform= HostInterfaceLibNull.c index b30f9e37a4d..40642469c9a 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterface= LibNull.c +++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterf +++ aceLibNull.c @@ -2,6 +2,7 @@ NULL instace of RedfishPlatformHostInterfaceLib (C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights + reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -23,7 +24,7 @@ **/ EFI_STATUS RedfishPlatformHostInterfaceDeviceDescriptor ( - IN UINT8 *DeviceType, + OUT UINT8 *DeviceType, OUT REDFISH_INTERFACE_DATA **DeviceDescriptor ) { @@ -51,3 +52,26 @@ RedfishPlatformHostInterfaceProtocolData ( { return EFI_NOT_FOUND; } + +/** + Get the EFI protocol GUID installed by platform library which + indicates the necessary information is ready for building + SMBIOS 42h record. + + @param[out] InformationReadinessGuid Pointer to retrive the protocol + GUID. + + @retval EFI_SUCCESS Notification is required for building up + SMBIOS type 42h record. + @retval EFI_UNSUPPORTED Notification is not required for building u= p + SMBIOS type 42h record. + @retval EFI_ALREADY_STARTED Platform host information is already ready. + @retval Others Other errors. +**/ +EFI_STATUS +RedfishPlatformHostInterfaceNotification ( + OUT EFI_GUID **InformationReadinessGuid + ) +{ + return EFI_UNSUPPORTED; +} diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b= /RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c index 623350bc261..3e12e0c8b9a 100644 --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c @@ -6,6 +6,7 @@ Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights + reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -21,6 +22,9 @@ #include #include +static EFI_EVENT mPlatformHostInterfaceReadylEvent =3D NULL; +static VOID *mPlatformHostInterfaceReadyRegistration =3D NULL; + /** Create SMBIOS type 42 record for Redfish host interface. @@ -238,6 +242,27 @@ ON_EXIT: return Status; } +/** + Notification event of platform Redfish Host Interface readiness. + + @param[in] Event Event whose notification function is being invoked= . + @param[in] Context The pointer to the notification function's context= , + which is implementation-dependent. + +**/ +VOID +EFIAPI +PlatformHostInterfaceInformationReady ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion +is ready\n", __FUNCTION__)); + + RedfishCreateSmbiosTable42 (); + return; +} + /** Main entry for this driver. @@ -254,8 +279,52 @@ RedfishHostInterfaceDxeEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ) { + EFI_STATUS Status; + EFI_GUID *ReadyGuid; + + DEBUG ((DEBUG_INFO, "%a: Entry\n.", __FUNCTION__)); + // - // Create SMBIOS type 42 record. + // Check if the Redfish Host Interface depends on // the specific + protocol installation. // - return RedfishCreateSmbiosTable42 (); + Status =3D RedfishPlatformHostInterfaceNotification (&ReadyGuid); if + (Status =3D=3D EFI_SUCCESS) { + DEBUG ((DEBUG_INFO, " Create protocol install notification to know = the installation of platform Redfish host interface readiness\n")); + DEBUG ((DEBUG_INFO, " Protocol GUID: %g\n", ReadyGuid)); + // + // Register event for ReadyGuid protocol installed by + // platform Redfish host interface library. + // + Status =3D gBS->CreateEvent ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + PlatformHostInterfaceInformationReady, + NULL, + &mPlatformHostInterfaceReadylEvent + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, " Fail to create event for the installation = of platform Redfish host interface readiness.\n")); + return Status; + } + + Status =3D gBS->RegisterProtocolNotify ( + ReadyGuid, + mPlatformHostInterfaceReadylEvent, + &mPlatformHostInterfaceReadyRegistration + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, " Fail to register event for the installatio= n of platform Redfish host interface readiness.\n")); + return Status; + } + + return EFI_SUCCESS; + } + + if ((Status =3D=3D EFI_UNSUPPORTED) || (Status =3D=3D EFI_ALREADY_STARTE= D)) { + Status =3D RedfishCreateSmbiosTable42 (); } + + // Return other erros. + return Status; } -- 2.37.1.windows.1 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= .