From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.46]) by mx.groups.io with SMTP id smtpd.web10.11631.1662036712877719397 for ; Thu, 01 Sep 2022 05:51:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=BML8Qsq/; spf=pass (domain: ami.com, ip: 40.107.94.46, mailfrom: igork@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFJ1kFLUufXwYQMjo870McdXeKHiEcmSPcDa8FV2Wx8LXgYtSVWsnP18MskZ3WR69xFcWPIz/UOwjwQDa1e2N1XlVfjA5RGBXcV3bmRjsaTWSB/J/opwE8s+ht3MeAR7qe1yBTH5icB3tcLXF5w5vllZ15BnAoIYGEeMQBpa/pgLvN5g6DURlZahqja7uQ41UK47J13cfoUYJwippRuOoDfp48nbXYZf+oFRCTPA3m0ADW5fzuEQxRgrslWHMoghMnIMGes2s6hgkaZkGUnHDi9BZw5JoZUTjb9nPAbpJUIzawB2vTOnxghvOHjYYdss2YxgEgvvZMz0V5UXGt4YJA== 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=wO/2VBwEo7fa5a+5WKea8ZEYI6IOvQc1hNOD8kdy/Q4=; b=GDiua9FsMgijwN9aIPuFdY8XFzYJzyzslu7Cf4dxaoxvDA5g7tzisPa2t/MHSGc7iGKRQ1haMXOw33x6VREoDEPe5SW+zghYEA8U3eEaz2RKNYwy2/zcgJGKQQN37pXxCXTduKmxi2R5al/erUKUgcYJHzJrQmKTs7zklG0kvyyNJ+fW/2nKZnAf+3mTcnzAEEgPSV3ayc2OfTojFqFiEBru0gkb98gNdy5ZMvyvo5+fs+ppSiIMa5qX9ZAD9c9LCa87cxMLG54zkmILPXh79NttCz2+f+XuHmvuGKuUM+k+l7PE4enpEtbpVb+uvLCpdb6l3GVx3T6VR2Uxw7ps9A== 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=wO/2VBwEo7fa5a+5WKea8ZEYI6IOvQc1hNOD8kdy/Q4=; b=BML8Qsq/FCyGpAxQx0Tn8SsvhwvrpkxImi2uWA9Ct5KwOc2RvDvUIo1NXDWbmX1YYBLNxxVNMBGiP73F7+VdP/ZEnpNccPoNWc596MVTqbKvKwE69t7FzXHp2EbEC0O8pWSFro18CoZgfY6PR+FwbM9owoTLMP12nNBaRuHkMyE= Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by CO1PR10MB4705.namprd10.prod.outlook.com (2603:10b6:303:96::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.10; Thu, 1 Sep 2022 12:51:51 +0000 Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::4c78:8ce8:957e:3fed]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::4c78:8ce8:957e:3fed%3]) with mapi id 15.20.5588.010; Thu, 1 Sep 2022 12:51:50 +0000 From: "Igor Kulchytskyy" To: "abner.chang@amd.com" , "devel@edk2.groups.io" CC: Nickle Wang Subject: Re: [PATCH V2] RedfishPkg/RedfishDiscoverDxe: Install EFI_DISCOVER_PROTOCOL on each network interface Thread-Topic: [EXTERNAL] [PATCH V2] RedfishPkg/RedfishDiscoverDxe: Install EFI_DISCOVER_PROTOCOL on each network interface Thread-Index: AQHYvbexYJgxVH9D+06IrZ1BByCrMK3Kh5ug Date: Thu, 1 Sep 2022 12:51:50 +0000 Message-ID: References: <20220901040222.1472-1-abner.chang@amd.com> In-Reply-To: <20220901040222.1472-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-office365-filtering-correlation-id: 01deb3be-11d4-4c0b-c6d0-08da8c18bd49 x-ms-traffictypediagnostic: CO1PR10MB4705:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XqN/20cW1WHNOF7DP0Ny4vjWIpMWYrz0K3DvAH1kL0s4ajzmjXzh7HRxkUZ2DHun+Ox7SFbf40CM37BgeMwvIe0Gu8wcItgrxpa+lIVCjeKagnWCXXNfHFSaRWnpSZRkj/wQnOfJ7cKEY2ttCXcYqN+8TTTqUh+StjVgORCLZYJr0bFKhF2k5STzXTG6lP8wcdbUuDOgXZg34jSkCtMxov2qSmF7Dehq4vGuI17bZKVZU8JmdWWc4gLhelt0WKrD00tacFSV5S5WOCLphc4yYX1aj+SWEw4PQXhdk60RfOEzlhzrAVboLUlPepkgS/mg1UUZa/6p2+aQgg4Iz+HochDkwHZcWZR5I+P9KPctwxDh5U1gMooHbVsgFgQG8dcrTVuP9pXKV6Km8kNOIt3ug9YJ5FGHiH71Kh319LBCQjPmDqAjv4kXtZBE6dH7fv5h5a4eqAWJdb31rU5FltW0HkzMtHQDGUBbIkVNnC7kwj7U3kqK5S6AsbUWqgniKftoNUsx8HI54Cq6wPGL+yuBXn0Hs3peQezA7CrhbgOKI1Ymw5u7QbsYuV9QnylGtucyEcKW5xkrOTSxmAGOm9PuqCahkPDGkt7FlhfPzD6JwIwdEGtsb4Nd1eBlhrPJII3gXyspMkULZZPCYkpyxdUFFDdGODGTlt45bgqSUMq/XrL7Y2RxagKmQdpu187Hq1ywRUZS8okbAosVx4ijbd7cn0okketk8iEvgyiVlFQoRLDtXueg2OFLXcRAOhr80eCCoVR2CPMpxIMvBlFu8Nq6WPcTDfBMYcAW0o2C6YvYlVA= 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:(13230016)(4636009)(136003)(376002)(346002)(366004)(39850400004)(396003)(40140700001)(53546011)(86362001)(33656002)(122000001)(38100700002)(186003)(41300700001)(83380400001)(9686003)(26005)(6506007)(7696005)(19627235002)(76116006)(110136005)(478600001)(55016003)(64756008)(66476007)(8676002)(71200400001)(66556008)(66446008)(316002)(66946007)(38070700005)(5660300002)(4326008)(2906002)(52536014)(8936002)(44824005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5IenA7ZFrqQsp5rowIbjDkw16DO2o6ePXS26+4BSqXvFtsO2e7DgdYaNBftH?= =?us-ascii?Q?RYwJj5dnfSVG7+/Q7iu9A0vXcB20fhod3jcI1nCIsUCjVQHGanzXElCUCfuf?= =?us-ascii?Q?wiN+tMy5ZKG8eVQ52o4isd1iQK5NvZOMP1bgu7yHjQ/p0MV+tOAU+HC64gK5?= =?us-ascii?Q?hPd8/yVUy5tEXCP8vk6GXYpEjAdu9jHhDQ/V21Zht0XhC+ETLxL6t1rx2W5m?= =?us-ascii?Q?so2ApDowXYz5Srd1ZlcrofxSNF4Yp6Dv8kjEANPHIcJYJ6q+yVSh0U9H5VM1?= =?us-ascii?Q?R4D+bv+LL0pb/J7nmGlouB8kNcKJOKmn4lkYgiynkqhaPr9O4WWD1gbWApL2?= =?us-ascii?Q?eGnJb5+X/0xcKUisZANKxSulituUfh56ngigAvqlN/IvQYjjnF29NOn5DO7y?= =?us-ascii?Q?m/nwXzOUZtt8RstME/yOk5IEMu5zTROHYoNUl30+asrogzgMM1+0n4IY4vC2?= =?us-ascii?Q?QwfrbhC5dOZ/OI5epZ0mebUw8lRZBVpJoRd8ZkmT4OddY8GYJDzHcOiGVspB?= =?us-ascii?Q?uXwZWzXvrKsTZo+0ekCOP57aOazE/uzhWEJMNGHhi20PcGrjPsPoGHIrRV+L?= =?us-ascii?Q?kk9o5bO0xnXrLF8+vqV3rzxyE4u5cptw0usABBuyKayx6Ee0zfOY6xtmgCY+?= =?us-ascii?Q?KPk4FnqblbHKK8LZwWEU8QX6nmaZaKbZdyfyhWAHvL2uRvidO507+moEWICl?= =?us-ascii?Q?7KhH+JfOwWIazyaq+yR/i5Ke7xI0EQ6qwvZ15+hiiMpcnDk0YTuh59A4rVHd?= =?us-ascii?Q?Fo51Ro0Pmdr0UvdfpPNhVccadfMUSKvPpqd0kH20J1AYmzO8PFO+K/+nzq9z?= =?us-ascii?Q?et/begXQ7+0UOXgfg/FwpEnG5Wf2VyvWsFpS0YSHAGNRMq+dj9p5FgxWHfLt?= =?us-ascii?Q?J3lNsgjsAwyXIPTjOghyRBlk1PqjG/llDCupcHnHaRhc2NkZJN04nLaPBd3I?= =?us-ascii?Q?dD07BTi778OlCvBl0+I4XixL95LkULIcKLRQxRc3DkcuvUEXEnj8lDoadS1i?= =?us-ascii?Q?iP4LLErs8e+O6lTwfl2b8bleOSdTIiRm6+50YU/FlNVmPuLhodv8kEik8s+H?= =?us-ascii?Q?0UNrUrLVWCa1SM/tNQVlykDS6UxkiQ2lYbscnZc+u61Qdxvv1fahjEowLFyt?= =?us-ascii?Q?PFBMSae7KoWZEcRE08zCxjKgCk28A7y7GJMufzD2wY7sBajwtGxNxt7dL3sr?= =?us-ascii?Q?D89YhUuZRcDBFxWlWXqh4fSGx3cwxxR8y/xTdkyGQQPiYNYhYJFuIoboVB34?= =?us-ascii?Q?eFmyA+khoAD3pY5zDIP5RNPtxlUU7ic0zyBZaqUi+xLkjcl+t5e3mZroBBPp?= =?us-ascii?Q?f9v2EIG9qVaH7keL+KLk8IqKK++nuNSZc4Ykd+e5xHmiJkBTXycUPd60apnY?= =?us-ascii?Q?/9aI/zatqhqnGiHoAUH1o6QKNCtWTbj2NCJuMv414Jj24RUT/dtb5JT5yghx?= =?us-ascii?Q?T9NW2i856pkJcOCJL+A6jzvdM33TfokethFV/r5Sm5napfoocuQx/DTaJMZ7?= =?us-ascii?Q?NZb9XecSCTz7hH7G88JQr9C188b2dkUbJVc+347OVWFdfiOc7YUNywLAcSWH?= =?us-ascii?Q?62zE9VTCYUFjA2YpGLQ=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: 01deb3be-11d4-4c0b-c6d0-08da8c18bd49 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Sep 2022 12:51:50.8866 (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: 3VJl2kx5LTZi9KjBzbQ519a1KKgFjWeu7cbGN+EMvUoThX27Nt+r8J13w4qnmKAO X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4705 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Igor Kulchytskyy Thank you, Igor -----Original Message----- From: abner.chang@amd.com Sent: Thursday, September 01, 2022 12:02 AM To: devel@edk2.groups.io Cc: Nickle Wang ; Igor Kulchytskyy Subject: [EXTERNAL] [PATCH V2] RedfishPkg/RedfishDiscoverDxe: Install EFI_D= ISCOVER_PROTOCOL on each network interface **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 BZ 4037: Install EFI_DISCOVER_PROTOCOL on each network interface. This fixes the issue that causes the high-level Redfish driver on the netwo= rk interface is stopped when: 1. EFI_DISCOVER_PROTOCOL is reinstalled on a new-found network interface, or 2. EFI_DISCOVER_PROTOCOL is stopped on the network interface other than the one which is used to communicate with Redfish service. Cc: Nickle Wang Cc: Igor Kulchytskyy Signed-off-by: Abner Chang --- .../RedfishDiscoverInternal.h | 7 + .../RedfishDiscoverDxe/RedfishDiscoverDxe.c | 140 ++++++++++-------- 2 files changed, 88 insertions(+), 59 deletions(-) diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h b/Redf= ishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h index 4d1319b2641..04fa09e1cc2 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h @@ -2,6 +2,7 @@ This file defines the EFI Redfish Discover Protocol interface. (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -107,6 +108,12 @@ typedef struct { = ///< NETWORK_INTERFACE_PROTOCOL_TYPE. REDFISH_DISCOVER_NETWORK_INTERFACE_PROTOCOL NetworkInterfaceProtocolI= nfo; ///< Network interface protocol information. EFI_HANDLE RestExHandle; = ///< REST EX handle associated with this network interface. + // + // EFI_REDFISH_DISCOVER_PROTOCOL instance installed // on this + network interface. + // + EFI_HANDLE EfiRedfishDiscoverProtoco= lHandle; ///< EFI_REDFISH_DISCOVER_PROTOTOCOL instance installed + = ///< on this network interface. } EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL; // diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPk= g/RedfishDiscoverDxe/RedfishDiscoverDxe.c index bf50c78c928..a271f6e942d 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c @@ -3,6 +3,7 @@ The implementation of EFI Redfidh Discover Protocol. (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2022, AMD Incorporated. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -23,8 +24,6 @@ EFI_GUID mRedfishDiscoverTcp4InstanceGuid =3D EFI_REDF= ISH_DISCOVER_TCP4_INSTANC EFI_GUID mRedfishDiscoverTcp6InstanceGuid =3D EFI_REDFISH_DISCOVER_TCP6= _INSTANCE_GUID; EFI_GUID mRedfishDiscoverRestExInstanceGuid =3D EFI_REDFISH_DISCOVER_REST= _EX_INSTANCE_GUID; -EFI_HANDLE EfiRedfishDiscoverProtocolHandle =3D NULL; - EFI_STATUS EFIAPI Tcp4GetSubnetInfo ( @@ -325,6 +324,38 @@ GetTargetNetworkInterfaceInternal ( return NULL; } +/** + This function searches +EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL + instance with the given Controller handle. + + @param[in] ControllerHandle The controller handle associated with netwo= rk interface. + + @retval Non-NULL EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL is ret= urned. + @retval NULL Non of EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL= instance is returned. +**/ +EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL * +GetTargetNetworkInterfaceInternalByController ( + IN EFI_HANDLE ControllerHandle + ) +{ + EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL +*ThisNetworkInterface; + + ThisNetworkInterface =3D + (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode + (&mEfiRedfishDiscoverNetworkInterface); + while (TRUE) { + if (ThisNetworkInterface->OpenDriverControllerHandle =3D=3D Controller= Handle) { + return ThisNetworkInterface; + } + + if (IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInt= erface->Entry)) { + return NULL; + } + + ThisNetworkInterface =3D + (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetNextNode + (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkInterface->Entry); + } + + return NULL; +} + /** This function validate if target network interface is ready for discover= ing Redfish service. @@ -1619,29 +1650,30 @@ BuildupNetworkInterface ( EFI_OPEN_PROTOCOL_BY_DRIVER ); if (!EFI_ERROR (Status)) { - if ((EfiRedfishDiscoverProtocolHandle =3D=3D NULL) && - (gRequiredProtocol[Index].ProtocolType =3D=3D ProtocolTypeRest= Ex) && - !IsListEmpty (&mEfiRedfishDiscoverNetworkInterface) - ) - { - // Install the fisrt Redfish Discover Protocol when EFI REST EX = protcol is discovered. - // This ensures EFI REST EX is ready while EFI_REDFISH_DISCOVER_= PROTOCOL consumer acquires - // Redfish serivce over network interface. - - Status =3D gBS->InstallProtocolInterface ( - &EfiRedfishDiscoverProtocolHandle, - &gEfiRedfishDiscoverProtocolGuid, - EFI_NATIVE_INTERFACE, - (VOID *)&mRedfishDiscover - ); - } else if ((EfiRedfishDiscoverProtocolHandle !=3D NULL) && NewNetw= orkInterfaceInstalled) { - Status =3D gBS->ReinstallProtocolInterface ( - EfiRedfishDiscoverProtocolHandle, - &gEfiRedfishDiscoverProtocolGuid, - (VOID *)&mRedfishDiscover, - (VOID *)&mRedfishDiscover - ); - NewNetworkInterfaceInstalled =3D FALSE; + if ((gRequiredProtocol[Index].ProtocolType =3D=3D ProtocolTypeRest= Ex)) { + // Install Redfish Discover Protocol when EFI REST EX protcol is= discovered. + // This ensures EFI REST EX is ready while the consumer of EFI_R= EDFISH_DISCOVER_PROTOCOL + // acquires Redfish serivce over network interface. + + if (!NewNetworkInterfaceInstalled) { + NetworkInterface =3D GetTargetNetworkInterfaceInternalByContro= ller (ControllerHandle); + if (NetworkInterface =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Can't find network interface by Co= ntrollerHandle\n", __FUNCTION__)); + return Status; + } + } + + NewNetworkInterfaceInstalled =3D FALSE; + NetworkInterface->EfiRedfishDiscoverProtocolHandle =3D NULL; + Status =3D gBS->Inst= allProtocolInterface ( + &Net= workInterface->EfiRedfishDiscoverProtocolHandle, + &gEf= iRedfishDiscoverProtocolGuid, + EFI_= NATIVE_INTERFACE, + (VOI= D *)&mRedfishDiscover + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to install EFI_REDFISH_DISCOVER= _PROTOCOL\n", __FUNCTION__)); + } } } @@ -1724,6 +1756,7 @@ StopServiceOnNetworkInterface ( EFI_STATUS Status; VOID *Interface; EFI_TPL OldTpl; + EFI_HANDLE DiscoverProtocolHandle; EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterface; EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_INTERNAL *RestExInstance; @@ -1743,30 +1776,34 @@ StopServiceOnNetworkInterface ( ThisNetworkInterface =3D (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_I= NTERNAL *)GetFirstNode (&mEfiRedfishDiscoverNetworkInterface); while (TRUE) { if (ThisNetworkInterface->NetworkInterfaceProtocolInfo.ProtocolC= ontrollerHandle =3D=3D ControllerHandle) { - Status =3D CloseProtocolService ( - // Close protocol and destroy service. - ThisBindingProtocol, - ControllerHandle, - &gRequiredProtocol[Index], - ThisNetworkInterface->OpenDriverAgentHandle, - ThisNetworkInterface->OpenDriverControllerHandle - ); + DiscoverProtocolHandle =3D ThisNetworkInterface->EfiRedfishDis= coverProtocolHandle; + // + // Close protocol and destroy service. + // + Status =3D CloseProtocolService ( + ThisBindingProtocol, + ControllerHandle, + &gRequiredProtocol[Index], + ThisNetworkInterface->OpenDriverAge= ntHandle, + ThisNetworkInterface->OpenDriverCon= trollerHandle + ); if (!EFI_ERROR (Status)) { Status =3D DestroyRedfishNetwrokInterface (ThisNetworkInterf= ace); } gBS->RestoreTPL (OldTpl); - // Reinstall Redfish Discover protocol to notify network - // interface change. - - Status =3D gBS->ReinstallProtocolInterface ( - EfiRedfishDiscoverProtocolHandle, - &gEfiRedfishDiscoverProtocolGuid, - (VOID *)&mRedfishDiscover, - (VOID *)&mRedfishDiscover - ); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: Reinstall gEfiRedfishDiscoverProto= colGuid fail.", __FUNCTION__)); + + // + // Disconnect EFI Redfish discover driver controller to notify= the + // clinet which uses .EFI Redfish discover protocol. + // + if (DiscoverProtocolHandle !=3D NULL) { + gBS->DisconnectController (DiscoverProtocolHandle, NULL, NUL= L); + Status =3D gBS->UninstallProtocolInterface ( + DiscoverProtocolHandle, + &gEfiRedfishDiscoverProtocolGuid, + (VOID *)&mRedfishDiscover + ); } return Status; @@ -2032,20 +2069,5 @@ RedfishDiscoverUnload ( StopServiceOnNetworkInterface (&gRedfishDiscoverDriverBinding, ThisNet= workInterface->NetworkInterfaceProtocolInfo.ProtocolControllerHandle); } - // Disconnect EFI Redfish discover driver controller to notify the - // clinet which uses .EFI Redfish discover protocol. - - if (EfiRedfishDiscoverProtocolHandle !=3D NULL) { - // - // Notify user EFI_REDFISH_DISCOVER_PROTOCOL is unloaded. - // - gBS->DisconnectController (EfiRedfishDiscoverProtocolHandle, NULL, NUL= L); - Status =3D gBS->UninstallProtocolInterface ( - EfiRedfishDiscoverProtocolHandle, - &gEfiRedfishDiscoverProtocolGuid, - (VOID *)&mRedfishDiscover - ); - } - 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= .