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.web10.24251.1671462669352019783 for ; Mon, 19 Dec 2022 07:11:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=cT34ZfQy; 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.236.40, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GLDJu/ygChWf/odZnN1wV220FBlbv4I2XZ/R6gvCXwbEq8eoBtuwNwURaX7KT5eZxecbty9mym5MxamrdbAgHBJlx8cC/gwUIf4c1NAoiZ++XaHkC5p6FrKBLmLAcfenkQ1mL9AwGjk5yQ2k/UXK/Xk8RlWeFpYTYApeQtKJ/v10rCYDzPPe8g5uogBOVpUhBkv+rBt2X6Cg7jNc5Ei0LqSBgrlh7lMr+rNEa+QSY3oL5MlvK611ZnO/gd7uKqWcReZQGYjqOpfRefzfzRGe62qC5j1oeVRcCZ+JHsGCKzeiQSpd7Q3AujKPgmETpZr9E3doo4P5fB0Jl03TrsoO1g== 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=3l2WNRbQnVch6HdOPc0gAmwRY8T85J8lFlLJbm1xZC8=; b=aVGQ9N9aeBdZjMSd0d7uUPACfNLNWKpTfN2WkA4lOgfuqnWxGJRbtEVf1DnBTdj4NmJV2NTkjGCWGaxz9a6du9IxpUsKRXO9R9evYzYXirFMT+8kk9BRaxR9yCXpkU85uklNepOQCiM8pk91qOBy8Sg8CQAVbCHS+jfpVgm46LpBtqs+iNN/hwqZRE7D1/foWT8ovkThtMFXsrrMtpECD0pXkllSjzsZ+kz927HWfY5maCD3dBF/d04tEBPAStHlzC3bqcsiXSQNWMg4Y0kmuLDIKShXe2iHw3nQZyCFwV0wwgOh20wFI4jBiaSWOkgCBnCz7liHj9dWYadsFpcqYQ== 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=3l2WNRbQnVch6HdOPc0gAmwRY8T85J8lFlLJbm1xZC8=; b=cT34ZfQye2xfLv6QgCxglgXgft8vFtqihvl2ne2stR1lL419nE7dx7pFGzCEbKtF4u/5yzsiT0fOXMHDpHZlW1DKTU1PYbKNG0nMvOGGvqyfqtjIruMrxFa6WBN6SkglsTXKsM1MgrHJbQeLZWjqi1fdZrg9h4xJtSpcKlMoobSQ58lotDtfvpvJFSOe+CvPUMedh6+yXYU+CsUr9t18msuUrwjFsj3ICbNoMzJ842coNKkSsctzFNAto2OJ24XmiFUQMxo2uz8P0VJUfbfszw/btsqbyWMkRE5HDL4/hHlhJp/QU9I7PIDiDOEgCTNdGDFKHJsgwTyQzf6mcn2Jhg== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by DM6PR12MB4370.namprd12.prod.outlook.com (2603:10b6:5:2aa::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Mon, 19 Dec 2022 15:11:07 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::6b34:f6ce:b778:4075]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::6b34:f6ce:b778:4075%6]) with mapi id 15.20.5924.016; Mon, 19 Dec 2022 15:11:06 +0000 From: "Nickle Wang" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Topic: [PATCH V2 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Index: AQHZE7lq3my/tTPYBE+eZYZGBg5Yha51ULyA Date: Mon, 19 Dec 2022 15:11:06 +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=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|DM6PR12MB4370:EE_ x-ms-office365-filtering-correlation-id: 10ec454c-cf15-44e5-12af-08dae1d340e1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EsF7WFSht4bWZNYraYQ1mAz3pNqYCNvdKYvSA8k0aN38+u8pd0DhTXc4l+Qd/b9XqWsEVUQJXA9hohxm8M6lDCRx78obhAsHpBC9ldrwIIee1o5ILh3UfQittxHcB7f34Znh4irfC9pcDjciO0cBMykRbGaoHDahwgdpj1pPMdkenqokyYVEChyz7Kjl3jvpKt+ZO4K06L1lZW7Ffx2IYrJPEVQAdPun1Wdd9YGyaYcflk2xm4M9LemGGCBOUn13Gnk+nOXNbfLn2+S2qdoyxayVHHgl+rYPOWwRfzlluTA12gbcneNbLI1tLyQzdsGmxIEJUzm93xCo0ofGsSHu+4o/jmEOkTkIcKA2Gh6F3NSKh19qB1CXVmFz5JaCHx88IeUY2i5BI2f+JxpfIBTrV1gs8DGosNh040RZHr+n4kP1Uv+C7aLdqfCmZXSlM6ukvpvLGJexgp5Jz5Cn+MtZsvBL4KO5h7gLwJg9aLF/UiOEFwZE8GT/ZBV8busi6EffeYUaZXZGDlbaTYFm1TCGmILR/MdhHQu+c4BjgR5Qyq1K6HxJ+8umlLKOBm8FZS7cN5sYas1X/8rcI9jU29KGFaGnCmreQGg15+dG1Sicey3uK7lKBr69WbcT9uFX0wG4SrW8byEXYIB9MSi9CmOFk9WQ4i0yEIGKe6JavT9UPvvhYBgo1Ju22gVXwYKdPLXFGydP0rU4PXfCHFI34BZYCQ== 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:(13230022)(4636009)(366004)(136003)(39860400002)(376002)(396003)(346002)(451199015)(19627235002)(38070700005)(53546011)(7696005)(6506007)(316002)(478600001)(38100700002)(4326008)(110136005)(8676002)(76116006)(66556008)(66946007)(86362001)(66446008)(71200400001)(64756008)(122000001)(66476007)(5660300002)(83380400001)(52536014)(33656002)(8936002)(15650500001)(9686003)(2906002)(186003)(55016003)(26005)(41300700001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PkilgnS4FFLlYgZNq+f2VVWrnEclpZ7lwJQj3qp+ZXXy42r4MHi+EOS61gg+?= =?us-ascii?Q?vHzWK8fnHtltwsf0jhIO2NzOr4xbgROIzWUGLBCLth545ZQjxRYuB7nyFEKT?= =?us-ascii?Q?miDCWkAcNwvBxV6+byE9iDaomnZke66oclSR5UtkUiJ6Ntw7fFDzNchXSJyx?= =?us-ascii?Q?Eu3BlxYqhmnhQNRZXQC9nJBpJUko+hF54GK2iErKvzp0pC5rAiIQcsshc9Pb?= =?us-ascii?Q?1S9pb/yuCbz/RTKFkYc3cE/g1wywUrEQwoVplvTDUJpBlVkYUMxOYgFi/lg+?= =?us-ascii?Q?92mAAKAnAE2OsLfyEKLDWLFgsjBPI0p6MYO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hI6b18/HxnMjv1p0QPI1FnG9H54fTlCrKR8mwLXcKZI7nZGWPjgOjCe?= =?us-ascii?Q?jb0Fqbn0or+98urz+UsZEKLt5jIyuvxD891l+FpBdfQOFcXgucX5PxZxDnku?= =?us-ascii?Q?VHZhJM6MwRlIpulrGt/IAcfGeXkPgO4b3dv99RJOEEps6tEUu4a2ian6twu7?= =?us-ascii?Q?rl0EZbWQ8QoQw+BI/y4NKvfZqHMHinEhMYpSCKE2ZZystlSbveZVFcXl4hSb?= =?us-ascii?Q?Z4dY3knZgF1I1z8FazZPSbuGXeN8oqgT9QgbALn91r7bj0xwIMifEXcQtqXV?= =?us-ascii?Q?Vu8hnFuuCaNRUMhRQt+6atBWGKBxb0EMyA/hHQSVYqJEsCKn5kXe35DzGWWL?= =?us-ascii?Q?g9f1O/1tYwI4LegoV90=3D?= 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: 10ec454c-cf15-44e5-12af-08dae1d340e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Dec 2022 15:11:06.8719 (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: WrCmXAwlwJw6XFSaammp6rTjCpXMdwsZTrv0fIT4VuSteN8QP05dGy4qwjqRoBHmlGfVbEEEaaxNS4uWOVGMTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4370 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for addressing my comment. Reviewed-by: Nickle Wang Regards, Nickle -----Original Message----- From: abner.chang@amd.com =20 Sent: Monday, December 19, 2022 10:51 PM To: devel@edk2.groups.io Cc: Nickle Wang ; Igor Kulchytskyy Subject: [PATCH V2 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 --- .../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=20 + 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=20 + 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=20 + reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -21,6 +22,9 @@ #include #include +static EFI_EVENT mPlatformHostInterfaceReadylEvent =3D NULL; static VOID=20 +*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=20 +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=20 + protocol installation. // - return RedfishCreateSmbiosTable42 (); + Status =3D RedfishPlatformHostInterfaceNotification (&ReadyGuid); if=20 + (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