From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.75]) by mx.groups.io with SMTP id smtpd.web11.44827.1671518721675897045 for ; Mon, 19 Dec 2022 22:45:21 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=hW84CznC; 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.93.75, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J6Gc6znCRSArry3l7PtcGKrZ1+MXhWpW3ZiedKp9SKUxIc64y6O11jEE3JRs+p9sHqqBP16zS4LzTRPPEvOEPrONBESY3B5b+2qU1diKo5ew3AHIgywGBY//OLOxCFtfhGc9/E7DZuk5iL68qxz845ODVLvA0k2BAU1g8JFCHPBt+l+sJanxOMve+G8RboCEBZpjJkKKUETKMW8wPByHnUDgGmfNs81qC+vaR1r80zdqoYjF8w6nYkhbl1atJ9VzN2UaY7juS1qxJ30+Zh9pbtelHa1mnoDWgicHA1ucZIGMCQZf0hdx/GC2yLEqZQrluJPP8pNIWNI7Q5Nr81G02w== 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=IHfUbGV7rg0VTGuGamJ0W/ARkYIFn62nvWhKtsBLUKs=; b=HolGLiDQZ4UcVs6pGQuR28+4DMYaI3Wax5HwmtEkXYp4tw98DaKET5O8VwraPfNyYgJ/CiPWhJAyX2g+4Idw+2+N1O/eedMG/m3P0pbUJHpJV7qD0t4T+lHs0tm/3tL4XmpaV3ZqjPy67OwSMgU9o/5ZtxtRAL69G8V/bGOS/o7s2kZ/Zo0TrGiKN62ziMVFRAwoMNqVTA7Vm22WdvFALsERR/47COhn7xWzbwXJjZ2Qhtydj8J09BYLaVOC4L0kOGde2ytlITRdTkxsDSyMIomeHhlZxtKL4kO9yZRtYfDmdyt/P//h8jqzzOk9AKosN6ZGwsmko0UVpUjaIDZB5A== 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=IHfUbGV7rg0VTGuGamJ0W/ARkYIFn62nvWhKtsBLUKs=; b=hW84CznCuep0PnhbgYneZLoiZy/f4JL93tuZKjlfnTZWY5MWeBu68UW6p1c0OC/7Ng5/U8F9G6hHGIIW/23GxBgwRWeLSOFuxyaUD1A/YHx1AY8h77xbs75Podsqo8MSTKFy4j6yProftDIA2Sdn3y/ZzQeOh+Gnuxe6GpMAWpxxSlJ/USM98bcCGBOMOAZDPPTGd6RuVvOg+z7CspgC0d4fq5l/yMJjXUkLoTSZDMx4fz7LpMLxLUlcxJLteMTbXU4Emy/tiD6wwysIaerj2yE2GEbeaZEgTde9PQHECebmCY2prJ9FzBwmVv7RsDLGVMK+yUpX6ycUBpdEoh/icQ== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by DM6PR12MB4435.namprd12.prod.outlook.com (2603:10b6:5:2a6::23) 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 06:45:19 +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; Tue, 20 Dec 2022 06:45:19 +0000 From: "Nickle Wang" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [PATCH V3 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Topic: [PATCH V3 1/2] RedfishPkg/RedfishHostInterface: Platform Redfish HI notification Thread-Index: AQHZFD4vz80m9IyqSk2tmgv/gP/gdK52VLjw Date: Tue, 20 Dec 2022 06:45:18 +0000 Message-ID: References: <20221220064123.352-1-abner.chang@amd.com> In-Reply-To: <20221220064123.352-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_|DM6PR12MB4435:EE_ x-ms-office365-filtering-correlation-id: bf8f789e-6237-4cf0-e5eb-08dae255c287 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bNpXTeSG93iQMH/arhiqAfPmtWEa/Dtrw6RLWSrlavv0fUbxX89q9lOL4cYSN2ux7XceA9w/JCUM/Q6wg/cpRPJGNEWbn4+E607CuP1GXp+H1lQANrPjXsDWHNem0vi5q8eW+CadmseWLoRExGZmp9kfdQAApkfJ4soJMU8KQ7f7k1ex7pX3ifBRiqhfH641uOceD8vJHUV4rSMZSe51I4QN3lJ/k4TAJNYvFpNtT10j9/5flFzUSh+1bW3X87mloye47ux8jI+ldS9BnjFNL7swnhHWBgbtfUDs3xIHyvXTZjwZrVQIvrljAaKxTZRSVt/whrmabaFk0jKmp11XrSExNNC6waZyLnYBoxdIsSYM3fQBn44qnoe59i24j3jfHqnmLtSXdE8d8I7PqvwNzvw5INFaxoyJXWZ6JmzKu58zlTp7LIuXV5HsOZmHmHavZbQPWoUUWYYbIx91yQqoJEnR7ktKDfIRylR49ESfpJdL5Jn6L6X5SQ8zvMjTOx6u75yti3HF6PkviVIWLvSbxOW0GnC1JP2Rfls1v1hLlLIO/ipp5pfo2XjNBt2MPDqhDiUCAeZVQhA538GqDiaA+jmAyxK3h/4iWc254gWlkVJ2PaGCmDPkq4V2pk5+Ilj7ukoLLWi6itsdun4BU+ODxJC7EKkVPy/6p2YYVyEyA44ktHDFtfWjOJVE2sHA2G3rjvPszkUozucTUSxi+Rq65Q== 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)(39860400002)(346002)(136003)(366004)(396003)(376002)(451199015)(19627235002)(38070700005)(8936002)(5660300002)(110136005)(52536014)(66946007)(66446008)(66556008)(76116006)(66476007)(55016003)(316002)(41300700001)(7696005)(9686003)(26005)(53546011)(4326008)(6506007)(186003)(86362001)(64756008)(71200400001)(83380400001)(33656002)(478600001)(2906002)(8676002)(15650500001)(38100700002)(122000001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lp4JQJe+zhmC/T5bsI5ax1bLkoJatuMq5ISPzQsu8Vv68zaEG2Xl1qnPxjYG?= =?us-ascii?Q?OmEfEsomRMxRRYzLTs/Xa9y9L61tCoSJ8t3m36QmUJ3PW7hBGfT035dZa5Ba?= =?us-ascii?Q?ecrWKRwG+nN+J311AStwuYyxRMYtfWezWUokCTV/nbNgNyvpLEkMt4nGMJbe?= =?us-ascii?Q?0zkfH/Sa2+n+WPnzwYEfhaM2WPO5mdJch5J15qRk6uBqSHcgpNsh0Cvs6TY+?= =?us-ascii?Q?AqT7qBybJ4B9cExkSmjlYdwOIdY0KKS/wWsrDHm3i4Ip1kEckmiZDeRPmEb1?= =?us-ascii?Q?+UaMEg+Caylut9OAWgmGBtkn+41JnAzDtWYlrVvfxWjQer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JlHA7InMKabSp7AH9R2QelKOP3TsXrPUohPVEBwV?= =?us-ascii?Q?nJ/qwKmaNcEcrx5cB6Gt4cqrq5z+JNT8nbNimskqJC3iRbxwy8Da1TQYHbZb?= =?us-ascii?Q?DhLoARdKpn2TovATLKOb99Qn2uDX2KUJIlcroxA1aAecojfitIf6T3NQ9nNt?= =?us-ascii?Q?V+Fv06STYwK0J+flZHWpd16rh+fzdF1cyeLJGGnvEL45rstCJpJIw+cxJvzj?= =?us-ascii?Q?GPhgbMppVyBSN2UTQVs2KVNGb2RbhwRCjVFlqAjuMIKPjjHBNEKpoSX1cYWS?= =?us-ascii?Q?rMHJK27itW7NMJUfiw4k5RS7UUce2mcSeo06ysE6PjKKBre9Tt2KUoqcT7RG?= =?us-ascii?Q?QxBChzurTBRXOLdvgKQ=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: bf8f789e-6237-4cf0-e5eb-08dae255c287 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Dec 2022 06:45:18.9817 (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: p79nP9Jgawt0kqYAPV2yh9iBlesWMwx3sYziCArqqMbl/t+uhzThR5jFOt8/eNtPDJZkWUf030Ow+9dbLz3mLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4435 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nickle Wang Thanks, Nickle -----Original Message----- From: abner.chang@amd.com =20 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=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,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=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..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=20 + 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=20 +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=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) || (Status =3D=3D EFI_ALREADY_STARTE= D)) { + Status =3D RedfishCreateSmbiosTable42 (); } + + // Return other erros. + return Status; } -- 2.37.1.windows.1