From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.85]) by mx.groups.io with SMTP id smtpd.web11.53865.1671552023684159414 for ; Tue, 20 Dec 2022 08:00:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=Fu0QULar; spf=pass (domain: ami.com, ip: 40.107.92.85, mailfrom: igork@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WVVIk5NrsrBatTPVUaOz8SyRQbkdE3sZ8ss/aJnneZX5dypeORjoc7eXDygAwzEMoD3dtq9wsoVNcwCUzfOHigcd2tHTiiX1WUzgBJ+5Mm+fyz9+nvyUyEfoYqXouBm0isxaW/hWPfqiJGULDToa3ZYeG8BGf/0QrWijttlFRntoVK2m3wrVx7midpHMndC/cL6wEtLjIGTaG8g8ZSC+cSotQTksECan6wNXjqBc80wAIjXQNYJgGqCu6567huyokkiulNvA95s7NXBCydDcrmT0Jyg4MUZsIsfaY99pTtkapcVHzz8SgDSJYRfTb21kGCQODk0EVfIoZkPUbHocmQ== 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=tzEEsNH0YcA/pk6FX5wwbJUAQHGMjL9rvUt2O/jaYZU=; b=I8VUtqun4DX2C4enFvDfirPJG5lebxh9Fqi/MSiTG7qzq9VfxsKjsgoGehIk9YzlhOx9AmUk6xWNA3Ldj9IiZWdfKxWoyGEd/iuFYgAVWrz5gr6NRUxjbNNsW5BJvb6z1u1qpar+7L5QfXlhsbi6kw0EDTPnrbqYaiaAxaxGTOS9I9P156lAmeXDyCi+afO97TSPx/Z9/CiGVHgPp7dN1BZStnIlSXYOwIOJuNjaBWnkimcQ/4uwteDPG5XhnPKzKGiSQOm1nV70/EdkdUms64VYFhDRLV0j/DNDKRlqfnHTi1bo+aLQcFIIoVjbpR1y9+Tbw2HiGPX93omM8b26Ig== 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=tzEEsNH0YcA/pk6FX5wwbJUAQHGMjL9rvUt2O/jaYZU=; b=Fu0QULartfIY8cJfn59xbE8seMGjEMxGOdpmTFfqdFqlrjiY6VmCZT33vJOmMcrtFfJkrOvw8wZAn1Rr9yzQtBKoUwf0rq87aX+xhlbmlhPudEddei2oZRIjJiCuI2iy8CrofBcUqXkbKKqrPEv1w7DG8CypuHTTfx6El2CXlKU= Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by IA1PR10MB7537.namprd10.prod.outlook.com (2603:10b6:208:457::15) 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:00:21 +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:00:21 +0000 From: "Igor Kulchytskyy" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Nickle Wang Subject: Re: [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Topic: [EXTERNAL] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Index: AQHZE7lpO9Gk5XKPkE2403Jlzy0mha528NtA Date: Tue, 20 Dec 2022 16:00:21 +0000 Message-ID: References: <20221219145115.1163-1-abner.chang@amd.com> In-Reply-To: <20221219145115.1163-1-abner.chang@amd.com> 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_|IA1PR10MB7537:EE_ x-ms-office365-filtering-correlation-id: 16484166-43ac-4041-ad48-08dae2a34c99 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7FzTz3nwiDja+qlecfDJvm6dhDRS9oac1hR0YB5xavX5r8gFddkFgooRb0J8EXEmmVBB2NYqwScI/GMpKHFsPCuo9yILUMce0L+fCKRsJ/HxM7BDLgnMWLwP0GarkUVKLirG3UwOpG/5DztwmIwiOVHVVrrJBYRhM2ivnUF2u6ps2KKy6dlmFXaLwdPbh+pg5aI05xYOYnZElVvFsVY6Q3QkC2ODAJkICV/WhPevJ59X2pmWSRY1z9RyacoWt7RL+/BdZYyzpAiGHLcV8OnRfgr7kcKMqcolCB754thUFl5FgHIxWKXAxCFAmAb3aWyRTgi04xl7jpnGBv61MvlA/Boy8tw5MSgY9Q7zsKKhEkfC8ed4X18TtsPRmBK2HwZiwV4Spwd6ROyZ3Ho8ploAOedqvg37djAP34fuCqZKfpQfyL48eAxz/ksCOP6hilJ6WAnRrPtJ6xfYxBDthfJ5YcDpiqIfmNIrdrWxN9yX4Yc2I/r5yhhWuiid8un8MqHQrCC8zqYU6DVdFofeg19+12Nac/79xk5cQpLyFt+VH24hbLZDcHCTdvXMmjARxskbVDo/0xGoRPjGuJ2xe4wle7e26kIAmXRUl+kfAUSKQcBRWCfWV5HYo6t3ByC7hK7KANRr0Mz1uP+mSqlfUVBl+YOlxd5/rJEkAu0FoLdKHsIF/SaLRC3lMIVJQrPd1kmtki7Y334KtwjM37oyMzcESg== 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)(136003)(346002)(376002)(396003)(39850400004)(366004)(451199015)(26005)(76116006)(41300700001)(66556008)(83380400001)(66476007)(66946007)(64756008)(4326008)(66446008)(186003)(8676002)(40140700001)(9686003)(71200400001)(478600001)(6506007)(19627235002)(316002)(7696005)(110136005)(33656002)(86362001)(53546011)(2906002)(55016003)(15650500001)(38070700005)(8936002)(5660300002)(52536014)(122000001)(38100700002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?GHK/UceGwHaEnvOJ1YO/hh/wwVkd8mqih4x3wsYwACd2qYo5ojO8TIAiQGmJ?= =?us-ascii?Q?d54XKyb8Md/4BDgiynJGT8Y4eNa/kgBYJaMN4PxGkMV5NoVpdNS/bNTFnP74?= =?us-ascii?Q?5w0+s5hVaYHcS0YZSRzo0O1kZ+wQWXPqjXzPp9tA7xdLBibyv2Xm9Fkw24i/?= =?us-ascii?Q?IVALrfCw4UWQ/+8+1+YaV4xFa2UIJBPrA13DS0qlec4Wa/HMZ0YXZWFjGzWn?= =?us-ascii?Q?6hPh9XBqP9JtAWopRXBXBgTaKVCIt80J7JLZSKBS3zviWf/9oIuEnSaoFDia?= =?us-ascii?Q?gFv8CO6FuaXZ1gEfYYDPUiKEs7XQ8J0t8kspcArRcuj0bs57pdk8fuV6Vvri?= =?us-ascii?Q?sHe7u5iGtSgoR4vMrZsY1febhQ2EUVWs5wsWAAT5Y4O18Xed8nMMIO40w3Uj?= =?us-ascii?Q?tM6Rno7g7BRyFpcumlKVOS0ppzSp++31w/VcAUnP5XvTaCJ+PnmrtFr201VC?= =?us-ascii?Q?k+W4feK1D0yG+HphENNvVNvDNjx9Q6DPTnW+8hEoGrL+/Aqql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mp9TjUOI3wcBXgQKxWAt7laewIaj?= =?us-ascii?Q?/7rBLMK9B74Srq6ZbFIq9jMsITyIW7yuOQyYMg8jVEhMemUU2Q54DKoNKRPT?= =?us-ascii?Q?Cl9wKiptx2bw1nYRqopXx2KN4ldW8bOEa/+Xs79OQof7lK/QSExrLG52rRxu?= =?us-ascii?Q?He0r/wfDTMe2nCTD1fI=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: 16484166-43ac-4041-ad48-08dae2a34c99 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2022 16:00:21.8876 (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: gnwBopomAIcOxGrzi4vLomQjQ1MN0aZUpiWh8djCLFTJEwLBeYRRwMq9OC2wqY/p X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7537 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Igor Kulchytskyy -----Original Message----- From: abner.chang@amd.com Sent: Monday, December 19, 2022 9:51 AM To: devel@edk2.groups.io Cc: Nickle Wang ; Igor Kulchytskyy Subject: [EXTERNAL] [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platfor= m 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.** 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 --- .../Include/Library/RedfishHostInterfaceLib.h | 27 ++++++- .../PlatformHostInterfaceLibNull.c | 26 ++++++- .../RedfishHostInterfaceDxe.c | 71 ++++++++++++++++++- 3 files changed, 118 insertions(+), 6 deletions(-) diff --git a/RedfishPkg/Include/Library/RedfishHostInterfaceLib.h b/Redfish= Pkg/Include/Library/RedfishHostInterfaceLib.h index 8d8389b9647..fa9f2d64eea 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,24 @@ 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..f83f5418d47 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..621b89fb847 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,50 @@ 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 || EFI_ALREADY_STARTED) { + 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= .