From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id B405C941C25 for ; Wed, 1 Nov 2023 20:17:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6jxxvmItowOxXDNuEksql0UFfCivEZzpC98/mTFo8s8=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1698869868; v=1; b=rKLkaA8G2YkXdz3+UnanKymsrlAx1oR3Mq0WZ9MB0JEiDNbm/qfDVfEqJw6sVHI15wJLLJ7g VpPWMQG5GU9BZi33XRJhiU1rErc7m2yz6m9XEDobmTswCw7g1gbY5si0XMdeURF5nyPyqwnI4A1 Ls/7dL0etZ4jgSG6VGHillyw= X-Received: by 127.0.0.2 with SMTP id OlmHYY7687511xwIBpQU9wEu; Wed, 01 Nov 2023 13:17:48 -0700 X-Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.72]) by mx.groups.io with SMTP id smtpd.web10.44172.1698869867143681267 for ; Wed, 01 Nov 2023 13:17:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=etQJ2g8RKWP7y8/0WyhDi6LdykAzFbtNaIvz39XgRjEl30RErkF0HichCtsa9Th64FHIbRIEmpRWGsGBv1q3fpGq6ejSikti6MlHe77btx7e9V33it4XJnYY99g3P/nInC/McwljJUWYdsEd//9wa/cfGDt0vB2dGVueak4NkuBhZyYuvRXxcKM8hxXj2AgfSKMEVJygRSn9D/xZD/IxlO8GzdebsPAYhr2w6SSfnl+7g/VFoahRRMT5J/c1ouenR0GvsCPSG+2I7qIgPMmUkmnKCTk6tOqY7EF/+Ale2oC1Zw2h4jHnHbT8OCbE+IQtqrkLbnkn90K/VpzotwdUcw== 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=Tg8xTCpyhG7AY3hVd4orBdn3Lfzxr2+ybqMrXd51WHI=; b=bZcP4L5QlixLsthgYLZtzok9o/0OrC3XjIsygfRZ82kV+Iy0/C8yUb4K9i34VcL+nWtdVfJfOSmXDHQbqNgryMolu3MB/PtMEV2GXvlMT8XShaTSz8JoBuSamU3SWIMOtLeU01rFaX2lkqCn556N7BmuLFvAM+fZzuzuLzaiOYOmN7PJ9hY3fH5gCWV/xC5frPBPlA+1ucJnSQxg479GaXbx9Gj8rvCwG3gElxsOVh4OfviPCvO/LFxIBkfLoM/ZGM5hqNGWqBImcZlGaI9Pz3s/coRXKCtDKG53pq5IOMweRU4xIL9W1RsEOpXJBJICninaYHOoT8ZSkxQ0QVAAkg== 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 X-Received: from CH0PR10MB5194.namprd10.prod.outlook.com (2603:10b6:610:d9::14) by LV3PR10MB7769.namprd10.prod.outlook.com (2603:10b6:408:1b7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29; Wed, 1 Nov 2023 20:17:42 +0000 X-Received: from CH0PR10MB5194.namprd10.prod.outlook.com ([fe80::e4f8:45e:7e98:3222]) by CH0PR10MB5194.namprd10.prod.outlook.com ([fe80::e4f8:45e:7e98:3222%5]) with mapi id 15.20.6954.019; Wed, 1 Nov 2023 20:17:42 +0000 From: "Igor Kulchytskyy via groups.io" To: "devel@edk2.groups.io" CC: Abner Chang , Nickle Wang , Mike Maslenkin Subject: [edk2-devel] [PATCH v2] RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed after RestEx Thread-Topic: [PATCH v2] RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed after RestEx Thread-Index: AQHaDQB3wfq9MU8sPUiRl4StxWQjaQ== Date: Wed, 1 Nov 2023 20:17:42 +0000 Message-ID: <20231101201704.1504-1-igork@ami.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH0PR10MB5194:EE_|LV3PR10MB7769:EE_ x-ms-office365-filtering-correlation-id: 4881ca3d-dd25-40ea-8699-08dbdb179a67 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: NbfwILDTs7cYDJyxHDfs8AlqzY3Wkup7kUgYvDTCn0/fxfujDJt90Ri3Kqe/w3ajwuOI3tZuRklgp01IoTPp+JanHCs3SFR8qnaLK5rTRe8iMfdiLkhTD1K+VHJDaMU6J+kTkR+NULXdkejicpGoakpLfYgQfFVitiXWx2o/rTmKR+PgYRRJqRlPbdeBBMnAtn03rXPM0G8qFFZEEEdFFpz+s7tBMSAkH7rutH6+ZMZbpgYG/E81iafwBCrKXaD0tHWY2UKIFGrh3H2HzYennLILjGkBdbfVOco9ct8ZqallDqs0adb4iVwq1PHL2UkKZnF/BX7flZ7iHKLwrDpWecuRM1iYC498NjRIeKW0lP9dmERWrOXEAVolnhP7zzq9eLangXy9YBSgRcS67EzbOUy2vQTrKMS39uDFMKkdRfrjt/fNukTSIjxWqZaku+EZJ8f9YJH6WngyprCf1HJ/73bNd14HbnJAmczrzhvFfgYsyKzDkG2NU+VTo+trRjOh6QEanwIpZNSg0w67hJG4FW75UYVv6G5OtQC95pgJawg6PbyMyHlB5pgODs9sv6CknoTo8skonDoebS8AQIwmfE9eXGQ80AmdCPONLufq14MItrH/MYSqtfuNGt9wanbM x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?mUTViokfuwK2rRRKLvPk17JcrEmCUIG9Y5d9OohMkhLVGxzgcyRgCQ49Zo?= =?iso-8859-1?Q?HpUS0NGW+FKOOUiFc+guPKbFdKuTHL1RaXGywJqsYMKXztkPuppAsAPZZp?= =?iso-8859-1?Q?Z1iAD57ccu67VZ89YzGQ/F/ugTUlc2VefwvBEiwkHc6gq7kIEXmE4IgLf4?= =?iso-8859-1?Q?SpWnq/pnlhWoS/fLCFtzqfQTgBWutY59qPao6yewllcAuKkQB+Kok9nUIn?= =?iso-8859-1?Q?2VOld3xLcqKinE97XU7aJCPiKRf+LNydPM3EBQ/5eBeVPnKUS388DcDE2P?= =?iso-8859-1?Q?BMphjUe2GFl+CH1NdVPLKdS1JmRNhEdcFTu8cOoSP4139m3lvrbW3up0ul?= =?iso-8859-1?Q?5KJ/3KKPY0v9j3gKvPB/nIkiPn+Xcl1uyxPwfFITtGb9s4x4h0VNFWnnUs?= =?iso-8859-1?Q?8hvslVP24Bbu3wkvMvCFvXCpEe+JCcOmYaC2UXfuZV1m+4rHLmuVMD7MYP?= =?iso-8859-1?Q?mU5jDLWAogdyfOasZHN42WduvYSedrzlTDuOUPiQkxJ1q8+nwl51CP6hin?= =?iso-8859-1?Q?lc7BNe1mj1AykRYQaVY/3/kwU0GYWUvcU/C3WtucSqsD3SQ7EQKNFQHojq?= =?iso-8859-1?Q?BfS+h6+QFELFrm9TDyiKaQbrNMYMzaiuHmV3BtvhReid+dV5YwRqH1A/7P?= =?iso-8859-1?Q?YFtrzSxts0UtmY0/RnqP6VofovKp/Ty7sa6k1Ia80JCj2mSCS8kgwvnHKs?= =?iso-8859-1?Q?0WtYquTdCq487HfS6D9rGvtpbygrBxNwnQVpnkiuccPt73J1jAAG65hKga?= =?iso-8859-1?Q?13yYF8Z9WiUqH2O0fcC7eKxpg/lRB2hQ6Isegq3Pjdwo0ivQhbyA9YId7f?= =?iso-8859-1?Q?DS68EiqgE+h9KwNgC/eURS1sJ+Z75jjcXLHVGUNrTj49IVsWCyJL2j3h8V?= =?iso-8859-1?Q?/4I982cfO68WrqVELk/9JZe8FRhEEdoC1Z53hFRF046Mx9nsav/jaBeU9E?= =?iso-8859-1?Q?T8WQD0zNiMMLobxDShMKmQRmuDscL+V5o/vCsO9nhNhagSYSaAx22DTEVT?= =?iso-8859-1?Q?xBSJPzAxcwBXgAfBlYz0mxBNmd6jgU20wKiXrPPqm1PqpbpaVXbV23a+2r?= =?iso-8859-1?Q?Gv7H6ZkmtmV1Y4BWUK5LPyxNJg4McmPR/P+dlqX824Cydb74dQ4MYEBGwu?= =?iso-8859-1?Q?MnPhiU56aCLvBG+2LwglmB82d2jEXD1H/QTg1W9Mk2vZ0L8Uw+eOkgFWqE?= =?iso-8859-1?Q?8JHgikcQiDPL8NszUjvT9zPkTAvnYa61ffKHr+f+Y5zs8N4Eik18WvVG5A?= =?iso-8859-1?Q?wYNcE7DIrc5HD5J8DcIIlhGXexDHm/wCvNc8AnNDi0is6tDddq13Tp4ZzU?= =?iso-8859-1?Q?N4dCcusjKo/KWUlt8+Te2wXxFl9gTiWFcRlhFc7rc6J481aTO3yw4JDZd6?= =?iso-8859-1?Q?sKw3CcVU3Saimibu7olnLtLi3+j7NwmklMiiIwvSg6vcESVQNgOBL0mNwq?= =?iso-8859-1?Q?x8cPgSOpVGBPuumWQp0ipDBF6BgER8tGqP8qdWAanjOWrXjT5FUBjt2YUS?= =?iso-8859-1?Q?914RTdsSp2Lh27HdRnW3X5xqoMMbpA2am6xKd72efcU0F0ktGH0a4VQgBh?= =?iso-8859-1?Q?GEjzZNEJPQxlqyrRbUYYclphgTPGN+saSiDll2UKmQMRJ6WAjcXT0CHN2p?= =?iso-8859-1?Q?eFDBPI6ZmHCfo+y4WG8kLdfuszP6lkGlVZ?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5194.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4881ca3d-dd25-40ea-8699-08dbdb179a67 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2023 20:17:42.4097 (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: S9SKv4kdYoJ2B+TxHXs49juQccW6MgAGGXp2tE98KE6wRO9WvDT+xOc0HSCOUPRg X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR10MB7769 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,igork@ami.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: g9vxajWlFMmoMiAFoUJPi6e0x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=rKLkaA8G; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Supported function of the driver changed to wait for all newtwork interface to be installed. Filer out the network interfaces which are not supported by Redfish Host Interface. Cc: Abner Chang Cc: Nickle Wang Cc: Mike Maslenkin Signed-off-by: Igor Kulchytskyy --- RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c | 131 ++++++++++++++---= --- 1 file changed, 95 insertions(+), 36 deletions(-) diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPk= g/RedfishDiscoverDxe/RedfishDiscoverDxe.c index 23da3b968f..c67b8acf12 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c @@ -322,9 +322,15 @@ GetTargetNetworkInterfaceInternal ( { EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterface; + if (IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) { + return NULL; + } + ThisNetworkInterface =3D (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNA= L *)GetFirstNode (&mEfiRedfishDiscoverNetworkInterface); while (TRUE) { - if (CompareMem ((VOID *)&ThisNetworkInterface->MacAddress, &TargetNetw= orkInterface->MacAddress, ThisNetworkInterface->HwAddressSize) =3D=3D 0) { + if (CompareMem ((VOID *)&ThisNetworkInterface->MacAddress, &TargetNetw= orkInterface->MacAddress, ThisNetworkInterface->HwAddressSize) =3D=3D 0 && + ((TargetNetworkInterface->IsIpv6 && ThisNetworkInterface->NetworkP= rotocolType =3D=3D ProtocolTypeTcp6) || + (!TargetNetworkInterface->IsIpv6 && ThisNetworkInterface->Netw= orkProtocolType =3D=3D ProtocolTypeTcp4))) { return ThisNetworkInterface; } @@ -354,6 +360,10 @@ GetTargetNetworkInterfaceInternalByController ( { EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterface; + if (IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) { + return NULL; + } + ThisNetworkInterface =3D (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNA= L *)GetFirstNode (&mEfiRedfishDiscoverNetworkInterface); while (TRUE) { if (ThisNetworkInterface->OpenDriverControllerHandle =3D=3D Controller= Handle) { @@ -476,6 +486,39 @@ CheckIsIpVersion6 ( return FALSE; } +/** + This function returns the IP type supported by the Host Interface + + @retval IP Type + // Unknown=3D00h, + // Ipv4=3D01h, + // Ipv6=3D02h, + +**/ +STATIC +UINT8 +GetHiIpProtocolType() +{ + EFI_STATUS Status; + REDFISH_OVER_IP_PROTOCOL_DATA *Data; + REDFISH_INTERFACE_DATA *DeviceDescriptor; + + Data =3D NULL; + DeviceDescriptor =3D NULL; + if (mSmbios =3D=3D NULL) { + Status =3D gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID *= *)&mSmbios); + if (EFI_ERROR (Status)) { + return REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN; + } + } + Status =3D RedfishGetHostInterfaceProtocolData (mSmbios, &DeviceDescript= or, &Data); // Search for SMBIOS type 42h + if (!EFI_ERROR (Status) && (Data !=3D NULL) && + (Data->HostIpAssignmentType =3D=3D RedfishHostIpAssignmentStatic)) { + return Data->HostIpAddressFormat; + } + return REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN; +} + /** This function discover Redfish service through SMBIOS host interface. @@ -512,6 +555,15 @@ DiscoverRedfishHostInterface ( Status =3D RedfishGetHostInterfaceProtocolData (mSmbios, &DeviceDescript= or, &Data); // Search for SMBIOS type 42h if (!EFI_ERROR (Status) && (Data !=3D NULL) && (DeviceDescriptor !=3D NU= LL)) { + + if (Instance->NetworkInterface->NetworkProtocolType =3D=3D ProtocolTyp= eTcp4 && Data->HostIpAddressFormat !=3D REDFISH_HOST_INTERFACE_HOST_IP_ADDR= ESS_FORMAT_IP4) { // IPv4 case + DEBUG ((DEBUG_ERROR, "%a: Network Interface is IPv4, but Host Interf= ace requires Ipv6\n", __func__)); + return EFI_UNSUPPORTED; + } + else if (Instance->NetworkInterface->NetworkProtocolType =3D=3D Protoc= olTypeTcp6 && Data->HostIpAddressFormat !=3D REDFISH_HOST_INTERFACE_HOST_IP= _ADDRESS_FORMAT_IP6) { // IPv6 case + DEBUG ((DEBUG_ERROR, "%a: Network Interface is IPv6, but Host Interf= ace requires IPv4\n", __func__)); + return EFI_UNSUPPORTED; + } // // Check if we can reach out Redfish service using this network interf= ace. // Check with MAC address using Device Descriptor Data Device Type 04 = and Type 05. @@ -1102,6 +1154,7 @@ RedfishServiceGetNetworkInterface ( OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE **NetworkIntfInstances ) { + EFI_STATUS Status; EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *ThisNetworkInterfaceIn= tn; EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *ThisNetworkInterface; EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_INTERNAL *RestExInstance; @@ -1141,6 +1194,16 @@ RedfishServiceGetNetworkInterface ( ThisNetworkInterfaceIntn =3D (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INT= ERNAL *)GetFirstNode (&mEfiRedfishDiscoverNetworkInterface); while (TRUE) { + // If Get Subnet Info failed then skip this interface + Status =3D NetworkInterfaceGetSubnetInfo (ThisNetworkInterfaceIntn, Im= ageHandle); // Get subnet info + if (EFI_ERROR(Status)) { + if (IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, &ThisNetworkI= nterfaceIntn->Entry)) { + break; + } + ThisNetworkInterfaceIntn =3D (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE= _INTERNAL *)GetNextNode (&mEfiRedfishDiscoverNetworkInterface, &ThisNetwork= InterfaceIntn->Entry); + continue; + } + ThisNetworkInterface->IsIpv6 =3D FALSE; if (CheckIsIpVersion6 (ThisNetworkInterfaceIntn)) { ThisNetworkInterface->IsIpv6 =3D TRUE; @@ -1230,6 +1293,10 @@ RedfishServiceAcquireService ( if (TargetNetworkInterface !=3D NULL) { TargetNetworkInterfaceInternal =3D GetTargetNetworkInterfaceInternal (= TargetNetworkInterface); + if (TargetNetworkInterfaceInternal =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a:No network interface on platform.\n", __fun= c__)); + return EFI_UNSUPPORTED; + } NumNetworkInterfaces =3D 1; } else { TargetNetworkInterfaceInternal =3D (EFI_REDFISH_DISCOVER_NETWORK_INTER= FACE_INTERNAL *)GetFirstNode (&mEfiRedfishDiscoverNetworkInterface); @@ -1260,7 +1327,12 @@ RedfishServiceAcquireService ( // Get subnet information in case subnet information is not set beca= use // RedfishServiceGetNetworkInterfaces hasn't been called yet. // - NetworkInterfaceGetSubnetInfo (TargetNetworkInterfaceInternal, Image= Handle); + Status1 =3D NetworkInterfaceGetSubnetInfo (TargetNetworkInterfaceInt= ernal, ImageHandle); + if (EFI_ERROR(Status1)) { + DEBUG ((DEBUG_ERROR, "%a: Get subnet information fail.\n", __func_= _)); + FreePool(Instance); + continue; + } NewInstance =3D TRUE; } @@ -1535,7 +1607,7 @@ TestForRequiredProtocols ( UINT32 *Id; UINTN Index; EFI_STATUS Status; - UINTN ListCount; + UINTN ListCount, SuccessfulCount =3D 0; ListCount =3D (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCOVER_REQ= UIRED_PROTOCOL)); for (Index =3D 0; Index < ListCount; Index++) { @@ -1557,13 +1629,14 @@ TestForRequiredProtocols ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); if (EFI_ERROR (Status)) { - if (Index =3D=3D ListCount - 1) { - DEBUG ((DEBUG_INFO, "%a: all required protocols are found on thi= s controller handle: %p.\n", __func__, ControllerHandle)); - return EFI_SUCCESS; - } + SuccessfulCount++; } } } + if (ListCount =3D=3D SuccessfulCount) { + DEBUG ((DEBUG_INFO, "%a: all required protocols are found on this cont= roller handle: %p.\n", __func__, ControllerHandle)); + return EFI_SUCCESS; + } return EFI_UNSUPPORTED; } @@ -1600,10 +1673,23 @@ BuildupNetworkInterface ( EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_INTERNAL *RestExInstance; EFI_TPL OldTpl; BOOLEAN NewNetworkInterfaceInst= alled; + UINT8 IpType; + UINTN ListCount; + ListCount =3D (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCOVER_REQ= UIRED_PROTOCOL)); NewNetworkInterfaceInstalled =3D FALSE; Index =3D 0; - do { + + + // Get IP Type to filter out unnecessary network protocol if possible + IpType =3D GetHiIpProtocolType(); + + for (Index =3D 0; Index < ListCount; Index++) { + // Check IP Type and skip an unnecessary network protocol if does not = match + if ((gRequiredProtocol[Index].ProtocolType =3D=3D ProtocolTypeTcp4 && = IpType =3D=3D REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6) || + (gRequiredProtocol[Index].ProtocolType =3D=3D ProtocolTypeTcp6 && = IpType =3D=3D REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4)) { + continue; + } Status =3D gBS->OpenProtocol ( // Already in list? ControllerHandle, @@ -1614,11 +1700,6 @@ BuildupNetworkInterface ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); if (!EFI_ERROR (Status)) { - Index++; - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCO= VER_REQUIRED_PROTOCOL))) { - break; - } - continue; } @@ -1631,11 +1712,6 @@ BuildupNetworkInterface ( EFI_OPEN_PROTOCOL_GET_PROTOCOL ); if (EFI_ERROR (Status)) { - Index++; - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCO= VER_REQUIRED_PROTOCOL))) { - break; - } - continue; } @@ -1694,11 +1770,6 @@ BuildupNetworkInterface ( ProtocolDiscoverIdPtr ); if (EFI_ERROR (Status)) { - Index++; - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCO= VER_REQUIRED_PROTOCOL))) { - break; - } - continue; } @@ -1755,25 +1826,13 @@ BuildupNetworkInterface ( } } else { DEBUG ((DEBUG_MANAGEABILITY, "%a: Not REST EX, continue with nex= t\n", __func__)); - Index++; - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof (REDFISH_D= ISCOVER_REQUIRED_PROTOCOL))) { - break; - } - continue; } } return Status; - } else { - Index++; - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCO= VER_REQUIRED_PROTOCOL))) { - break; - } - - continue; } - } while (Index < (sizeof (gRequiredProtocol) / sizeof (REDFISH_DISCOVER_= REQUIRED_PROTOCOL))); + } return EFI_DEVICE_ERROR; } -- 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= . -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110490): https://edk2.groups.io/g/devel/message/110490 Mute This Topic: https://groups.io/mt/102328322/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-