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 2967C940F8E for ; Wed, 8 Nov 2023 02:43:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7l60hYImqr1tXlWC+uecd1zrYIimgM9uYDRD/hhLbcw=; 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:References:In-Reply-To:Accept-Language:msip_labels: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; s=20140610; t=1699411432; v=1; b=PAnWP0/ZNQ3209UG2vHgz8zal9P1XmxXyESihG7X46/0EmUonX9tShxI0fQ3j3jHrMaVkits DujrzGyHPScixymG9RB6EeDLEvD81CeEFPXZWZIGpMaQq7SOzFS8j9b5q3LfPRxkaAqUSYnTF2R /NhqL+tPwptXDRwESZN4Qn/4= X-Received: by 127.0.0.2 with SMTP id FkcaYY7687511xWa5nfFFsHr; Tue, 07 Nov 2023 18:43:52 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.89]) by mx.groups.io with SMTP id smtpd.web10.5827.1699411431936359164 for ; Tue, 07 Nov 2023 18:43:52 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F2PhYAL0imYo+jm9S+7Z1dOYIC+tcoVeN6dxoR+gy6AariD8lInGvq33j8j6MCupSw2Px/DuH+VzqYRTrbTqQIEXUuHV4uYlE6sZ4/I1m5PTLpyOlKxV/XjuEjNXK0+ak8uy2DeBs5I1RsoSIr+eM4U5r6+2XLJIB39V0UXZx+Ug/rWjlxTeA4B5SGK/mLsb8lKO59nx/9gq/kmkOoKwI4nr9/j9ZH6RPq/5KfEhI55Qziw0xB2AzZdueIe7tR5IRdPNkZI7a2UwThd4MjwWAuTs7q37b6SnyG7jTmJd2HlwQXaGYggWZ3tOdIecL+S/ZFrwEmGBN8f1e+n9miGOlA== 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=RdIN0a+Z5dZ20fRAoA0I2NC2PmNk2j2uhuifho/3EOw=; b=E219c0NrooXwFQqMNHA/4pJ4F9gLuvzmDRpFh5B0M/krdr5vKaOwnBe6y8FogzYF/s/heCdrQQ/5AWTfzvwowmnQSeEBj/gkukNBGS6lXS43mR3L0aGAe3gSUqHcmJrcNfst42NuCOPbdbGHXEPUA5+FQW42PHyhTUmDU8wGs5ts+/iXH3Je4FqEaLR1CQfQTJMsVa+K6jHQdzCFanEGZHYWNXeUbe91jfUPteIKi6NBR7zE3fG3EwdbOwgJ3p8On7S4QorThwgzvvI8a/dmVAlgwQ6ZQTCwUzWvysDLwRTYgUY0/pieJr08d1qQrdt0iclFSnDVC+N73qEAQCZ+6A== 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 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by CH2PR12MB4085.namprd12.prod.outlook.com (2603:10b6:610:79::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Wed, 8 Nov 2023 02:43:48 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::39a9:72e:53d1:4c6b]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::39a9:72e:53d1:4c6b%4]) with mapi id 15.20.6954.029; Wed, 8 Nov 2023 02:43:48 +0000 From: "Nickle Wang via groups.io" To: Liming Gao , "Kinney, Michael D" , "devel@edk2.groups.io" CC: Igor Kulchytskyy , "Chang, Abner" Subject: Re: [edk2-devel] [PATCH v3] RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed after RestEx Thread-Topic: [edk2-devel] [PATCH v3] RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 installed after RestEx Thread-Index: AQHaEXLNd1r6tWwQW0meqWJLTeUNI7BvjbMQgAAntUA= Date: Wed, 8 Nov 2023 02:43:48 +0000 Message-ID: References: <20231107120605.2035-1-igork@ami.com> In-Reply-To: Accept-Language: en-US X-Mentions: gaoliming@byosoft.com.cn,michael.d.kinney@intel.com X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=84bc7473-341f-4220-b957-0d68c7fdc6a9;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-11-08T00:12:45Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|CH2PR12MB4085:EE_ x-ms-office365-filtering-correlation-id: 660cdb74-5c71-487d-fc59-08dbe00488b8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: rc6CA7wT84pEcoGGWe9zKA5jsZltniREr32LEMlYMoGWViRbps//J8ghjxXXyZXsdl4L362YUfu6rlZyVJcK3zcdRMfQaOITKe952Lazw2xtaQ65LFXQ5th47euwtQjAvn9O5TuNca3WOq43TA9GNyk21PlXsjHStxR1kLzLS8EbfABmBI1yospIiSvJvwch4dYTFND91z2TBu1hj+Zm4rG/PrCMBP6uOUTt4TugYF71dxkML33fAvISYMtM5yTDa4BvH/tnlNNtcMFpHsBsH4laQxwVZuKCh+7AUDINfJgvoC3wDqFgwPtnhTcBh5ovFKT96Sa3xD+oiUfDp9vYBl+c8lSUb+Msgcnw310SLBTlSVsAmL7/FRYAzucGaI73LH7l+YdWOs7MiGyNRPSLl11whVAOVyQ49jOgI/jHZws7Wdp0wNTdsdcP8Mmt7Pb28g+LYzYXQ03HqFFMTEETTjmPD7DwwUzwdg9M+R6C2xRSljJYQw4oP0hFqNI2XueQTvTFKZDuTXRAw3YjlYd3pAUNClQOztE4QFgeQWAUD+8mEujpyfNCinO+kwe2ZpBpJB4Q2xaa8LIyynm7NPuyoVhr26CePKWW8sde5DO5rxh9HBVL8T39/qwKVj4GXiOrfAsDoLaW7OTWqXfTaFhxNw== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ghVoL+6+dzJNzEgezaKWwObm1zhrHha422txnTItL5RC9MSOdvohMlrhs/IW?= =?us-ascii?Q?NdpYZLjYtZE4Uz+jRMgIWLQUgMXpoxymcxEd8vzZKF7nKgjJN7PRxnGKXRuQ?= =?us-ascii?Q?Z9E95Z8v38YNG+uoV41kl+R93AqZXOuuku6ENPkuk+Qk1Gh7B5qus7G5wS01?= =?us-ascii?Q?d7J47azBcVt9p7IitatUt5b760laL+GlSUk+dunpqXbDa4wmUXe6FmPJMjQg?= =?us-ascii?Q?ctWU5VpAs5hl3zRiOtUEJGhZkPz/5o6RmvUHDYtPPi0lWlGB7FgMziPmABfd?= =?us-ascii?Q?OGbC3W69KBKGeuIUojqvWZj76TkHhjylBS09G8bOBpMfjrpJIIbTGhp40gfn?= =?us-ascii?Q?ghGr2R/I1tUWnaiCxtHFYFn4xfCjLfEeuGI/53MNL9Qw5y0iDYYoYusS0xEt?= =?us-ascii?Q?kbSVeGZwhiGqKNGZf/BVKxgM0zg5CMW6jsJ41l5v7yEruP3VJlSpAXrcG08j?= =?us-ascii?Q?aa3wj0xTO7P+ZEjWcgfl0L7AMUvRlmFRL99Z3d/TUSlacSpFvLQjTpz8KF0s?= =?us-ascii?Q?Ex6Lejuw+my4vntMTOrgKVoyklZKMDHAH1tjQOaoZpveyQJxd5OKO6risa67?= =?us-ascii?Q?tzpzoCHDyevfRQFksivtcs2777AlEwxE7a1N9Z425oYYbecSr+KgPVDJSlCV?= =?us-ascii?Q?p4jb00yewYTOijD5Tek3a6NYLpGDmMJCjh+mH40fuZpruZIGVIIbKY2WrXoV?= =?us-ascii?Q?wLhfx8p2kv+AjtvV7WpDrdSN8UtAJQth1hZgm6cXt44EdbLtMvd+rHyGX4wC?= =?us-ascii?Q?Bkp7ajgf6x92O2i4xxXVOIv+7WhlhReULZ0za21euz+8B/ZiiQUbbVOUFdKE?= =?us-ascii?Q?WkvdqiEyCh7dDHWFvC+cUKvmkS3+49E/P0GD6jRhXDiW3YswDeca08aw8dtG?= =?us-ascii?Q?V73p5qMFrEy8L3sE1QFFDwtfUdCNLc51BA+i8ThOTZKRmZyLVH2jLunnc4C9?= =?us-ascii?Q?6NoNU2DUFiVzY1Mh2BQTDQJv9fpnFIPOL4ySZ/KjwexTG5lqeYTfJN2IMjwY?= =?us-ascii?Q?jrsYi6bfVCkbd58ykhintZZz8C35NcxBAaqOwTamteuHhky6H89FlGh8JCJp?= =?us-ascii?Q?9o9PoLGFW9V+ysKnqwViA0+fOOCVdItGC8TMTAhv3/zruBymSHlwo8WTbtM3?= =?us-ascii?Q?LhS/cN53o+2SBvshfmzC605JRPL7cVd0QdG6psTX9+ZOmKxwLHlvO/955H7q?= =?us-ascii?Q?cK2mUa9nzgs3QvoUpVakbV3i7VZ7RBHHbBiKYajX7lWIa6/75OF2Tbl/s81h?= =?us-ascii?Q?Uyqod2SHXn0PBC8p/fb1flkbOnGFP7US+YPXK24KguNZrj39140aUPPGcj8h?= =?us-ascii?Q?Cv6S+gwVtp/lUijTXpIOrt2Ij0bF+GkrO/Y7klKE4hEUfn8HyK6MeNSNF5eH?= =?us-ascii?Q?qR+iNiBari/eYbsiSngo02+bX571EH40YY/UW7nzzWU3V/CjBgXAPMnX4AS7?= =?us-ascii?Q?jnxX2gDyDltdC9JNRNNEr4qqKr2dZS/AenlUuenC7CgtzDBaLzc4CxuI70xQ?= =?us-ascii?Q?+wYaUZlmKEByN7NWanH90UYrdC7kwpdG3PC7j3sa94QEiu1VmGco8kQtg061?= =?us-ascii?Q?dxeJJxMlFxIDXHlpwj4Yht1phnF+mlYKwB8tL1+2?= 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: 660cdb74-5c71-487d-fc59-08dbe00488b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2023 02:43:48.0892 (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: jRGdi7JAx38lGq0AZuYcbC5E+x69MWBLmolWKPDLehpfQvVc8uUcznv5pnEFTUTpzpKaf+MDBqbPeYm4hUGTlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4085 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,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: BCqrcfKFfN7gN1orGkLOUi7ux7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MW4PR12MB7031A8D8DF8E7C63229E53D7D9A8AMW4PR12MB7031namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="PAnWP0/Z"; 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 --_000_MW4PR12MB7031A8D8DF8E7C63229E53D7D9A8AMW4PR12MB7031namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi @Liming Gao, @Kinney, Michael D > If the patch is sent before Soft Feature Freeze, and plans to catch this = stable tag, the patch contributor need reply to his patch and notify edk2 c= ommunity We would like to include this fix to edk2-stable202311 release. Could you p= lease help us to merge this patch? This patch review was started on Novembe= r 1: https://edk2.groups.io/g/devel/message/110440. Anber and I gave review= ed-by to this patch today. We have a pull request ready for merging here: h= ttps://github.com/tianocore/edk2/pull/4994 Thanks, Nickle > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Chang, Abn= er > via groups.io > Sent: Wednesday, November 8, 2023 8:14 AM > To: Igor Kulchytskyy ; devel@edk2.groups.io > Cc: Nickle Wang > Subject: Re: [edk2-devel] [PATCH v3] RedfishPkg: RedfishDiscoverDxe: Fix = issue if > IPv4 installed after RestEx > > External email: Use caution opening links or attachments > > > [AMD Official Use Only - General] > > Reviewed-by: Abner Chang = > > > > -----Original Message----- > > From: Igor Kulchytskyy > > > Sent: Tuesday, November 7, 2023 8:06 PM > > To: devel@edk2.groups.io > > Cc: Chang, Abner >; Nic= kle Wang > > > > > Subject: [PATCH v3] RedfishPkg: RedfishDiscoverDxe: Fix issue if IPv4 > > installed after RestEx > > > > Caution: This message originated from an External Source. Use proper > > caution when opening attachments, clicking links, or responding. > > > > > > 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 > > > Signed-off-by: Igor Kulchytskyy > > > --- > > RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c | 165 > > ++++++++++++++------ > > 1 file changed, 117 insertions(+), 48 deletions(-) > > > > diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > index 23da3b968f..85e47843e4 100644 > > --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > @@ -322,9 +322,16 @@ GetTargetNetworkInterfaceInternal ( { > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > *ThisNetworkInterface; > > > > + if (IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) { > > + return NULL; > > + } > > + > > ThisNetworkInterface =3D > > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode > > (&mEfiRedfishDiscoverNetworkInterface); > > while (TRUE) { > > - if (CompareMem ((VOID *)&ThisNetworkInterface->MacAddress, > > &TargetNetworkInterface->MacAddress, ThisNetworkInterface- > > >HwAddressSize) =3D=3D 0) { > > + if ((CompareMem ((VOID *)&ThisNetworkInterface->MacAddress, > > &TargetNetworkInterface->MacAddress, ThisNetworkInterface- > > >HwAddressSize) =3D=3D 0) && > > + ((TargetNetworkInterface->IsIpv6 && (ThisNetworkInterface- > > >NetworkProtocolType =3D=3D ProtocolTypeTcp6)) || > > + (!TargetNetworkInterface->IsIpv6 && (ThisNetworkInterface- > > >NetworkProtocolType =3D=3D ProtocolTypeTcp4)))) > > + { > > return ThisNetworkInterface; > > } > > > > @@ -354,6 +361,10 @@ GetTargetNetworkInterfaceInternalByController ( > > { > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > *ThisNetworkInterface; > > > > + if (IsListEmpty (&mEfiRedfishDiscoverNetworkInterface)) { > > + return NULL; > > + } > > + > > ThisNetworkInterface =3D > > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode > > (&mEfiRedfishDiscoverNetworkInterface); > > while (TRUE) { > > if (ThisNetworkInterface->OpenDriverControllerHandle =3D=3D > > ControllerHandle) { > > @@ -476,6 +487,42 @@ CheckIsIpVersion6 ( > > return FALSE; > > } > > > > +/** > > + This function returns the IP type supported by the Host Interface. > > + > > + @retval 00h is Unknown > > + 01h is Ipv4 > > + 02h is Ipv6 > > + > > +**/ > > +UINT8 > > +GetHiIpProtocolType ( > > + VOID > > + ) > > +{ > > + 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, > > &DeviceDescriptor, &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 +559,18 @@ DiscoverRedfishHostInterface ( > > > > Status =3D RedfishGetHostInterfaceProtocolData (mSmbios, > > &DeviceDescriptor, &Data); // Search for SMBIOS type 42h > > if (!EFI_ERROR (Status) && (Data !=3D NULL) && (DeviceDescriptor != =3D > > NULL)) { > > + if ((Instance->NetworkInterface->NetworkProtocolType =3D=3D > > ProtocolTypeTcp4) && > > + (Data->HostIpAddressFormat !=3D > > REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4)) // IPv4 case > > + { > > + DEBUG ((DEBUG_ERROR, "%a: Network Interface is IPv4, but Host > > Interface requires Ipv6\n", __func__)); > > + return EFI_UNSUPPORTED; > > + } else if ((Instance->NetworkInterface->NetworkProtocolType =3D=3D > > ProtocolTypeTcp6) && > > + (Data->HostIpAddressFormat !=3D > > REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6)) // IPv6 case > > + { > > + DEBUG ((DEBUG_ERROR, "%a: Network Interface is IPv6, but Host > > Interface requires IPv4\n", __func__)); > > + return EFI_UNSUPPORTED; > > + } > > + > > // > > // Check if we can reach out Redfish service using this network in= terface. > > // Check with MAC address using Device Descriptor Data Device > > Type 04 and Type 05. > > @@ -1102,6 +1161,7 @@ RedfishServiceGetNetworkInterface ( > > OUT EFI_REDFISH_DISCOVER_NETWORK_INTERFACE > > **NetworkIntfInstances > > ) > > { > > + EFI_STATUS Status; > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > *ThisNetworkInterfaceIntn; > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE > > *ThisNetworkInterface; > > EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_INTERNAL *RestExInstance; > > @@ -1141,13 +1201,23 @@ RedfishServiceGetNetworkInterface ( > > > > ThisNetworkInterfaceIntn =3D > > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode > > (&mEfiRedfishDiscoverNetworkInterface); > > while (TRUE) { > > + // If Get Subnet Info failed then skip this interface > > + Status =3D NetworkInterfaceGetSubnetInfo (ThisNetworkInterfaceIntn= , > > ImageHandle); // Get subnet info > > + if (EFI_ERROR (Status)) { > > + if (IsNodeAtEnd (&mEfiRedfishDiscoverNetworkInterface, > > &ThisNetworkInterfaceIntn->Entry)) { > > + break; > > + } > > + > > + ThisNetworkInterfaceIntn =3D > > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetNextNode > > (&mEfiRedfishDiscoverNetworkInterface, > > &ThisNetworkInterfaceIntn->Entry); > > + continue; > > + } > > + > > ThisNetworkInterface->IsIpv6 =3D FALSE; > > if (CheckIsIpVersion6 (ThisNetworkInterfaceIntn)) { > > ThisNetworkInterface->IsIpv6 =3D TRUE; > > } > > > > CopyMem ((VOID *)&ThisNetworkInterface->MacAddress, > > &ThisNetworkInterfaceIntn->MacAddress, ThisNetworkInterfaceIntn- > > >HwAddressSize); > > - NetworkInterfaceGetSubnetInfo (ThisNetworkInterfaceIntn, ImageHand= le); > > // Get subnet info. > > if (!ThisNetworkInterface->IsIpv6) { > > IP4_COPY_ADDRESS (&ThisNetworkInterface->SubnetId.v4, > > &ThisNetworkInterfaceIntn->SubnetAddr.v4); // IPv4 subnet information. > > } else { > > @@ -1230,7 +1300,12 @@ RedfishServiceAcquireService ( > > > > if (TargetNetworkInterface !=3D NULL) { > > TargetNetworkInterfaceInternal =3D > > GetTargetNetworkInterfaceInternal (TargetNetworkInterface); > > - NumNetworkInterfaces =3D 1; > > + if (TargetNetworkInterfaceInternal =3D=3D NULL) { > > + DEBUG ((DEBUG_ERROR, "%a:No network interface on platform.\n", > > __func__)); > > + return EFI_UNSUPPORTED; > > + } > > + > > + NumNetworkInterfaces =3D 1; > > } else { > > TargetNetworkInterfaceInternal =3D > > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL *)GetFirstNode > > (&mEfiRedfishDiscoverNetworkInterface); > > NumNetworkInterfaces =3D NumberOfNetworkInterface (); > > @@ -1260,7 +1335,13 @@ RedfishServiceAcquireService ( > > // Get subnet information in case subnet information is not set = because > > // RedfishServiceGetNetworkInterfaces hasn't been called yet. > > // > > - NetworkInterfaceGetSubnetInfo (TargetNetworkInterfaceInternal, > > ImageHandle); > > + Status1 =3D NetworkInterfaceGetSubnetInfo > > (TargetNetworkInterfaceInternal, ImageHandle); > > + if (EFI_ERROR (Status1)) { > > + DEBUG ((DEBUG_ERROR, "%a: Get subnet information fail.\n", > > __func__)); > > + FreePool (Instance); > > + continue; > > + } > > + > > NewInstance =3D TRUE; > > } > > > > @@ -1547,25 +1628,26 @@ TestForRequiredProtocols ( > > ControllerHandle, > > EFI_OPEN_PROTOCOL_TEST_PROTOCOL > > ); > > + if (EFI_ERROR (Status)) { > > + return EFI_UNSUPPORTED; > > + } > > + > > + Status =3D gBS->OpenProtocol ( > > + ControllerHandle, > > + gRequiredProtocol[Index].DiscoveredProtocolGuid, > > + (VOID **)&Id, > > + This->DriverBindingHandle, > > + ControllerHandle, > > + EFI_OPEN_PROTOCOL_GET_PROTOCOL > > + ); > > if (!EFI_ERROR (Status)) { > > - Status =3D gBS->OpenProtocol ( > > - ControllerHandle, > > - gRequiredProtocol[Index].DiscoveredProtocolGuid, > > - (VOID **)&Id, > > - This->DriverBindingHandle, > > - ControllerHandle, > > - 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= this > > controller handle: %p.\n", __func__, ControllerHandle)); > > - return EFI_SUCCESS; > > - } > > - } > > + // Already installed > > + return EFI_UNSUPPORTED; > > } > > } > > > > - return EFI_UNSUPPORTED; > > + DEBUG ((DEBUG_MANAGEABILITY, "%a: all required protocols are found > > + on > > this controller handle: %p.\n", __func__, ControllerHandle)); > > + return EFI_SUCCESS; > > } > > > > /** > > @@ -1600,10 +1682,24 @@ BuildupNetworkInterface ( > > EFI_REDFISH_DISCOVER_REST_EX_INSTANCE_INTERNAL *RestExInstance; > > EFI_TPL OldTpl; > > BOOLEAN NewNetworkInterface= Installed; > > + UINT8 IpType; > > + UINTN ListCount; > > > > + ListCount =3D (sizeof (gRequiredProtocol) / sizeo= f > > (REDFISH_DISCOVER_REQUIRED_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 ProtocolTypeTcp= 4) > > + && > > (IpType =3D=3D REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6)) || > > + ((gRequiredProtocol[Index].ProtocolType =3D=3D ProtocolTypeTcp= 6) > > + && > > (IpType =3D=3D REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4))) > > + { > > + continue; > > + } > > + > > Status =3D gBS->OpenProtocol ( > > // Already in list? > > ControllerHandle, @@ -1614,11 +1710,6 @@ > > BuildupNetworkInterface ( > > EFI_OPEN_PROTOCOL_GET_PROTOCOL > > ); > > if (!EFI_ERROR (Status)) { > > - Index++; > > - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) { > > - break; > > - } > > - > > continue; > > } > > > > @@ -1631,11 +1722,6 @@ BuildupNetworkInterface ( > > EFI_OPEN_PROTOCOL_GET_PROTOCOL > > ); > > if (EFI_ERROR (Status)) { > > - Index++; > > - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) { > > - break; > > - } > > - > > continue; > > } > > > > @@ -1694,11 +1780,6 @@ BuildupNetworkInterface ( > > ProtocolDiscoverIdPtr > > ); > > if (EFI_ERROR (Status)) { > > - Index++; > > - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) { > > - break; > > - } > > - > > continue; > > } > > > > @@ -1755,25 +1836,13 @@ BuildupNetworkInterface ( > > } > > } else { > > DEBUG ((DEBUG_MANAGEABILITY, "%a: Not REST EX, continue > > with next\n", __func__)); > > - Index++; > > - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) { > > - break; > > - } > > - > > continue; > > } > > } > > > > return Status; > > - } else { > > - Index++; > > - if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_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 > > proprietary 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 designee. If the reader of this message is not > > the intended recipient, you are on notice that any distribution of > > this message, in any form, is strictly prohibited. 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. > > >=20 > -=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 (#110886): https://edk2.groups.io/g/devel/message/110886 Mute This Topic: https://groups.io/mt/102441003/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- --_000_MW4PR12MB7031A8D8DF8E7C63229E53D7D9A8AMW4PR12MB7031namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi @Liming Gao, @Kinney, Michael D

 

> If the patch is sent before Soft Feature Fre= eze, and plans to catch this stable tag, the patch contributor need reply t= o his patch and notify edk2 community

 

We would like to include this fix to edk2-stable2= 02311 release. Could you please help us to merge this patch? This patch rev= iew was started on November 1: https://edk2.grou= ps.io/g/devel/message/110440. Anber and I gave reviewed-by to this patc= h today. We have a pull request ready for merging here: https://github.com/= tianocore/edk2/pull/4994

 

Thanks,

Nickle

 

> -----Original Message-----

> From: devel@edk2.groups.io <devel@edk2.gr= oups.io> On Behalf Of Chang, Abner

> via groups.io

> Sent: Wednesday, November 8, 2023 8:14 AM

> To: Igor Kulchytskyy <igork@ami.com>; = devel@edk2.groups.io

> Cc: Nickle Wang <nicklew@nvidia.com>

> Subject: Re: [edk2-devel] [PATCH v3] Redfish= Pkg: RedfishDiscoverDxe: Fix issue if

> IPv4 installed after RestEx

>

> External email: Use caution opening links or= attachments

>

>

> [AMD Official Use Only - General]

>

> Reviewed-by: Abner Chang <abner.chang@amd.com>

>

> > -----Original Message-----

> > From: Igor Kulchytskyy <= igork@ami.com>

> > Sent: Tuesday, November 7, 2023 8:06 PM=

> > To: devel@edk2.group= s.io

> > Cc: Chang, Abner <= Abner.Chang@amd.com>; Nickle Wang

> > <nicklew@nvidia.com= >

> > Subject: [PATCH v3] RedfishPkg: Redfish= DiscoverDxe: Fix issue if IPv4

> > installed after RestEx

> >

> > Caution: This message originated from a= n External Source. Use proper

> > caution when opening attachments, click= ing links, or responding.

> >

> >

> > Supported function of the driver change= d 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 <a= bner.chang@amd.com>

> > Cc: Nickle Wang <ni= cklew@nvidia.com>

> > Signed-off-by: Igor Kulchytskyy <igork@ami.com>

> > ---

> >  RedfishPkg/RedfishDiscoverDxe/Red= fishDiscoverDxe.c | 165

> > ++++++++++++++------

> >  1 file changed, 117 insertions(+)= , 48 deletions(-)

> >

> > diff --git a/RedfishPkg/RedfishDiscover= Dxe/RedfishDiscoverDxe.c

> > b/RedfishPkg/RedfishDiscoverDxe/Redfish= DiscoverDxe.c

> > index 23da3b968f..85e47843e4 100644

> > --- a/RedfishPkg/RedfishDiscoverDxe/Red= fishDiscoverDxe.c

> > +++ b/RedfishPkg/RedfishDiscoverDxe/Red= fishDiscoverDxe.c

> > @@ -322,9 +322,16 @@ GetTargetNetworkIn= terfaceInternal (  {

> >    EFI_REDFISH_DISCOVER_= NETWORK_INTERFACE_INTERNAL

> > *ThisNetworkInterface;

> >

> > +  if (IsListEmpty (&mEfiRedfi= shDiscoverNetworkInterface)) {

> > +    return NULL;

> > +  }

> > +

> >    ThisNetworkInterface = =3D

> > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE= _INTERNAL *)GetFirstNode

> > (&mEfiRedfishDiscoverNetworkInterfa= ce);

> >    while (TRUE) {

> > -    if (CompareMem ((VO= ID *)&ThisNetworkInterface->MacAddress,

> > &TargetNetworkInterface->MacAddr= ess, ThisNetworkInterface-

> > >HwAddressSize) =3D=3D 0) {

> > +    if ((CompareMem ((V= OID *)&ThisNetworkInterface->MacAddress,

> > &TargetNetworkInterface->MacAddr= ess, ThisNetworkInterface-

> > >HwAddressSize) =3D=3D 0) &&=

> > +      &n= bsp; ((TargetNetworkInterface->IsIpv6 && (ThisNetworkInterface-<= /p>

> > >NetworkProtocolType =3D=3D Protocol= TypeTcp6)) ||

> > +      &n= bsp;  (!TargetNetworkInterface->IsIpv6 && (ThisNetworkInter= face-

> > >NetworkProtocolType =3D=3D Protocol= TypeTcp4))))

> > +    {

> >      &nbs= p; return ThisNetworkInterface;

> >      }

> >

> > @@ -354,6 +361,10 @@ GetTargetNetworkIn= terfaceInternalByController (

> > {

> >    EFI_REDFISH_DISCOVER_= NETWORK_INTERFACE_INTERNAL

> > *ThisNetworkInterface;

> >

> > +  if (IsListEmpty (&mEfiRedfi= shDiscoverNetworkInterface)) {

> > +    return NULL;

> > +  }

> > +

> >    ThisNetworkInterface = =3D

> > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE= _INTERNAL *)GetFirstNode

> > (&mEfiRedfishDiscoverNetworkInterfa= ce);

> >    while (TRUE) {

> >      if (ThisN= etworkInterface->OpenDriverControllerHandle =3D=3D

> > ControllerHandle) {

> > @@ -476,6 +487,42 @@ CheckIsIpVersion6 = (

> >    return FALSE;

> >  }

> >

> > +/**

> > +  This function returns the = IP type supported by the Host Interface.

> > +

> > +  @retval 00h is Unknown

> > +      &n= bsp;   01h is Ipv4

> > +      &n= bsp;   02h is Ipv6

> > +

> > +**/

> > +UINT8

> > +GetHiIpProtocolType (

> > +  VOID

> > +  )

> > +{

> > +  EFI_STATUS   &nb= sp;            =      Status;

> > +  REDFISH_OVER_IP_PROTOCOL_DATA&n= bsp; *Data;

> > +  REDFISH_INTERFACE_DATA &nb= sp;       *DeviceDescriptor;

> > +

> > +  Data    &nb= sp;        =3D NULL;

> > +  DeviceDescriptor =3D NULL;

> > +  if (mSmbios =3D=3D NULL) {

> > +    Status =3D gBS->= LocateProtocol (&gEfiSmbiosProtocolGuid, NULL,

> > + (VOID

> > **)&mSmbios);

> > +    if (EFI_ERROR (Stat= us)) {

> > +      return<= /p>

> > REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_= FORMAT_UNKNOWN;

> > +    }

> > +  }

> > +

> > +  Status =3D RedfishGetHostInterf= aceProtocolData (mSmbios,

> > &DeviceDescriptor, &Data); // S= earch for SMBIOS type 42h

> > +  if (!EFI_ERROR (Status) &&a= mp; (Data !=3D NULL) &&

> > +      (Data-&= gt;HostIpAssignmentType =3D=3D RedfishHostIpAssignmentStatic))

> > + {

> > +    return Data->Hos= tIpAddressFormat;  }

> > +

> > +  return

> > REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_= FORMAT_UNKNOWN;

> > +}

> > +

> >  /**

> >    This function discove= r Redfish service through SMBIOS host interface.

> >

> > @@ -512,6 +559,18 @@ DiscoverRedfishHos= tInterface (

> >

> >    Status =3D RedfishGet= HostInterfaceProtocolData (mSmbios,

> > &DeviceDescriptor, &Data); // S= earch for SMBIOS type 42h

> >    if (!EFI_ERROR (Statu= s) && (Data !=3D NULL) && (DeviceDescriptor !=3D

> > NULL)) {

> > +    if ((Instance->N= etworkInterface->NetworkProtocolType =3D=3D

> > ProtocolTypeTcp4) &&

> > +      &n= bsp; (Data->HostIpAddressFormat !=3D

> > REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_= FORMAT_IP4)) // IPv4 case

> > +    {

> > +      DEBUG (= (DEBUG_ERROR, "%a: Network Interface is IPv4, but Host

> > Interface requires Ipv6\n", __func= __));

> > +      return = EFI_UNSUPPORTED;

> > +    } else if ((Instanc= e->NetworkInterface->NetworkProtocolType =3D=3D

> > ProtocolTypeTcp6) &&

> > +      &n= bsp;        (Data->HostIpAddressForma= t !=3D

> > REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_= FORMAT_IP6)) // IPv6 case

> > +    {

> > +      DEBUG (= (DEBUG_ERROR, "%a: Network Interface is IPv6, but Host

> > Interface requires IPv4\n", __func= __));

> > +      return = EFI_UNSUPPORTED;

> > +    }

> > +

> >      //

> >      // Check = if we can reach out Redfish service using this network interface.

> >      // Check = with MAC address using Device Descriptor Data Device

> > Type 04 and Type 05.

> > @@ -1102,6 +1161,7 @@ RedfishServiceGet= NetworkInterface (

> >    OUT EFI_REDFISH_DISCO= VER_NETWORK_INTERFACE

> > **NetworkIntfInstances

> >    )

> >  {

> > +  EFI_STATUS   &nb= sp;            =             &nb= sp;          Status;

> >    EFI_REDFISH_DISCOVER_= NETWORK_INTERFACE_INTERNAL

> > *ThisNetworkInterfaceIntn;

> >    EFI_REDFISH_DISCOVER_= NETWORK_INTERFACE

> > *ThisNetworkInterface;

> >    EFI_REDFISH_DISCOVER_= REST_EX_INSTANCE_INTERNAL   *RestExInstance;

> > @@ -1141,13 +1201,23 @@ RedfishServiceG= etNetworkInterface (

> >

> >    ThisNetworkInterfaceI= ntn =3D

> > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE= _INTERNAL *)GetFirstNode

> > (&mEfiRedfishDiscoverNetworkInterfa= ce);

> >    while (TRUE) {

> > +    // If Get Subnet In= fo failed then skip this interface

> > +    Status =3D NetworkI= nterfaceGetSubnetInfo (ThisNetworkInterfaceIntn,

> > ImageHandle); // Get subnet info

> > +    if (EFI_ERROR (Stat= us)) {

> > +      if (IsN= odeAtEnd (&mEfiRedfishDiscoverNetworkInterface,

> > &ThisNetworkInterfaceIntn->Entry= )) {

> > +      &n= bsp; break;

> > +      }

> > +

> > +      ThisNet= workInterfaceIntn =3D

> > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE= _INTERNAL *)GetNextNode

> > (&mEfiRedfishDiscoverNetworkInterfa= ce,

> > &ThisNetworkInterfaceIntn->Entry= );

> > +      continu= e;

> > +    }

> > +

> >      ThisNetwo= rkInterface->IsIpv6 =3D FALSE;

> >      if (Check= IsIpVersion6 (ThisNetworkInterfaceIntn)) {

> >      &nbs= p; ThisNetworkInterface->IsIpv6 =3D TRUE;

> >      }

> >

> >      CopyMem (= (VOID *)&ThisNetworkInterface->MacAddress,

> > &ThisNetworkInterfaceIntn->MacAd= dress, ThisNetworkInterfaceIntn-

> > >HwAddressSize);

> > -    NetworkInterfaceGet= SubnetInfo (ThisNetworkInterfaceIntn, ImageHandle);

> > // Get subnet info.

> >      if (!This= NetworkInterface->IsIpv6) {

> >      &nbs= p; IP4_COPY_ADDRESS (&ThisNetworkInterface->SubnetId.v4,

> > &ThisNetworkInterfaceIntn->Subne= tAddr.v4); // IPv4 subnet information.

> >      } else {<= /p>

> > @@ -1230,7 +1300,12 @@ RedfishServiceAc= quireService (

> >

> >    if (TargetNetworkInte= rface !=3D NULL) {

> >      TargetNet= workInterfaceInternal =3D

> > GetTargetNetworkInterfaceInternal (Targ= etNetworkInterface);

> > -    NumNetworkInterface= s           =3D 1;

> > +    if (TargetNetworkIn= terfaceInternal =3D=3D NULL) {

> > +      DEBUG (= (DEBUG_ERROR, "%a:No network interface on platform.\n",

> > __func__));

> > +      return = EFI_UNSUPPORTED;

> > +    }

> > +

> > +    NumNetworkInterface= s =3D 1;

> >    } else {

> >      TargetNet= workInterfaceInternal =3D

> > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE= _INTERNAL *)GetFirstNode

> > (&mEfiRedfishDiscoverNetworkInterfa= ce);

> >      NumNetwor= kInterfaces           =3D= NumberOfNetworkInterface ();

> > @@ -1260,7 +1335,13 @@ RedfishServiceAc= quireService (

> >      &nbs= p; // Get subnet information in case subnet information is not set because<= /p>

> >      &nbs= p; // RedfishServiceGetNetworkInterfaces hasn't been called yet.

> >      &nbs= p; //

> > -      Network= InterfaceGetSubnetInfo (TargetNetworkInterfaceInternal,

> > ImageHandle);

> > +      Status1= =3D NetworkInterfaceGetSubnetInfo

> > (TargetNetworkInterfaceInternal, ImageH= andle);

> > +      if (EFI= _ERROR (Status1)) {

> > +      &n= bsp; DEBUG ((DEBUG_ERROR, "%a: Get subnet information fail.\n",

> > __func__));

> > +      &n= bsp; FreePool (Instance);

> > +      &n= bsp; continue;

> > +      }

> > +

> >      &nbs= p; NewInstance =3D TRUE;

> >      }

> >

> > @@ -1547,25 +1628,26 @@ TestForRequired= Protocols (

> >      &nbs= p;            &= nbsp;  ControllerHandle,

> >      &nbs= p;            &= nbsp;  EFI_OPEN_PROTOCOL_TEST_PROTOCOL

> >      &nbs= p;            &= nbsp;  );

> > +    if (EFI_ERROR (Stat= us)) {

> > +      return = EFI_UNSUPPORTED;

> > +    }

> > +

> > +    Status =3D gBS->= OpenProtocol (

> > +      &n= bsp;            = ; ControllerHandle,

> > +      &n= bsp;            = ; gRequiredProtocol[Index].DiscoveredProtocolGuid,

> > +      &n= bsp;            = ; (VOID **)&Id,

> > +      &n= bsp;            = ; This->DriverBindingHandle,

> > +      &n= bsp;            = ; ControllerHandle,

> > +      &n= bsp;            = ; EFI_OPEN_PROTOCOL_GET_PROTOCOL

> > +      &n= bsp;            = ; );

> >      if (!EFI_= ERROR (Status)) {

> > -      Status = =3D gBS->OpenProtocol (

> > -      &n= bsp;            = ;   ControllerHandle,

> > -      &n= bsp;            = ;   gRequiredProtocol[Index].DiscoveredProtocolGuid,

> > -      &n= bsp;            = ;   (VOID **)&Id,

> > -      &n= bsp;            = ;   This->DriverBindingHandle,

> > -      &n= bsp;            = ;   ControllerHandle,

> > -      &n= bsp;            = ;   EFI_OPEN_PROTOCOL_GET_PROTOCOL

> > -      &n= bsp;            = ;   );

> > -      if (EFI= _ERROR (Status)) {

> > -      &n= bsp; if (Index =3D=3D ListCount - 1) {

> > -      &n= bsp;   DEBUG ((DEBUG_INFO, "%a: all required protocols are f= ound on this

> > controller handle: %p.\n", __func_= _, ControllerHandle));

> > -      &n= bsp;   return EFI_SUCCESS;

> > -      &n= bsp; }

> > -      }

> > +      // Alre= ady installed

> > +      return = EFI_UNSUPPORTED;

> >      }

> >    }

> >

> > -  return EFI_UNSUPPORTED;

> > +  DEBUG ((DEBUG_MANAGEABILITY, &q= uot;%a: all required protocols are found

> > + on

> > this controller handle: %p.\n", __= func__, ControllerHandle));

> > +  return EFI_SUCCESS;

> >  }

> >

> >  /**

> > @@ -1600,10 +1682,24 @@ BuildupNetworkI= nterface (

> >    EFI_REDFISH_DISCOVER_= REST_EX_INSTANCE_INTERNAL   *RestExInstance;

> >    EFI_TPL  &n= bsp;            = ;            &n= bsp;            = ;  OldTpl;

> >    BOOLEAN  &n= bsp;            = ;            &n= bsp;            = ;  NewNetworkInterfaceInstalled;

> > +  UINT8    &n= bsp;            = ;            &n= bsp;            = ;  IpType;

> > +  UINTN    &n= bsp;            = ;            &n= bsp;            = ;  ListCount;

> >

> > +  ListCount   &nbs= p;            &= nbsp;   =3D (sizeof (gRequiredProtocol) / sizeof

> > (REDFISH_DISCOVER_REQUIRED_PROTOCOL));<= /p>

> >    NewNetworkInterfaceIn= stalled =3D FALSE;

> >    Index  &nbs= p;            &= nbsp;        =3D 0;

> > -  do {

> > +

> > +  // Get IP Type to filter out un= necessary network protocol if

> > + possible  IpType =3D GetHiIpProt= ocolType ();

> > +

> > +  for (Index =3D 0; Index < Li= stCount; Index++) {

> > +    // Check IP Type an= d skip an unnecessary network protocol if does

> > + not

> > match

> > +    if (((gRequiredProt= ocol[Index].ProtocolType =3D=3D ProtocolTypeTcp4)

> > + &&

> > (IpType =3D=3D REDFISH_HOST_INTERFACE_H= OST_IP_ADDRESS_FORMAT_IP6)) ||

> > +      &n= bsp; ((gRequiredProtocol[Index].ProtocolType =3D=3D ProtocolTypeTcp6)

> > + &&

> > (IpType =3D=3D REDFISH_HOST_INTERFACE_H= OST_IP_ADDRESS_FORMAT_IP4)))

> > +    {

> > +      continu= e;

> > +    }

> > +

> >      Status = =3D gBS->OpenProtocol (

> >      &nbs= p;            &= nbsp;  // Already in list?

> >      &nbs= p;            &= nbsp;  ControllerHandle, @@ -1614,11 +1710,6 @@

> > BuildupNetworkInterface (

> >      &nbs= p;            &= nbsp;  EFI_OPEN_PROTOCOL_GET_PROTOCOL

> >      &nbs= p;            &= nbsp;  );

> >      if (!EFI_= ERROR (Status)) {

> > -      Index++= ;

> > -      if (Ind= ex =3D=3D (sizeof (gRequiredProtocol) / sizeof

> > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) = {

> > -      &n= bsp; break;

> > -      }

> > -

> >      &nbs= p; continue;

> >      }

> >

> > @@ -1631,11 +1722,6 @@ BuildupNetworkIn= terface (

> >      &nbs= p;            &= nbsp;  EFI_OPEN_PROTOCOL_GET_PROTOCOL

> >      &nbs= p;            &= nbsp;  );

> >      if (EFI_E= RROR (Status)) {

> > -      Index++= ;

> > -      if (Ind= ex =3D=3D (sizeof (gRequiredProtocol) / sizeof

> > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) = {

> > -      &n= bsp; break;

> > -      }

> > -

> >      &nbs= p; continue;

> >      }

> >

> > @@ -1694,11 +1780,6 @@ BuildupNetworkIn= terface (

> >      &nbs= p;            &= nbsp;  ProtocolDiscoverIdPtr

> >      &nbs= p;            &= nbsp;  );

> >      if (EFI_E= RROR (Status)) {

> > -      Index++= ;

> > -      if (Ind= ex =3D=3D (sizeof (gRequiredProtocol) / sizeof

> > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) = {

> > -      &n= bsp; break;

> > -      }

> > -

> >      &nbs= p; continue;

> >      }

> >

> > @@ -1755,25 +1836,13 @@ BuildupNetworkI= nterface (

> >      &nbs= p;     }

> >      &nbs= p;   } else {

> >      &nbs= p;     DEBUG ((DEBUG_MANAGEABILITY, "%a: Not REST = EX, continue

> > with next\n", __func__));

> > -      &n= bsp;   Index++;

> > -      &n= bsp;   if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof

> > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) = {

> > -      &n= bsp;     break;

> > -      &n= bsp;   }

> > -

> >      &nbs= p;     continue;

> >      &nbs= p;   }

> >      &nbs= p; }

> >

> >      &nbs= p; return Status;

> > -    } else {

> > -      Index++= ;

> > -      if (Ind= ex =3D=3D (sizeof (gRequiredProtocol) / sizeof

> > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) = {

> > -      &n= bsp; break;

> > -      }

> > -

> > -      continu= e;

> >      }

> > -  } while (Index < (sizeof (gR= equiredProtocol) / sizeof

> > (REDFISH_DISCOVER_REQUIRED_PROTOCOL)));=

> > +  }

> >

> >    return EFI_DEVICE_ERR= OR;

> >  }

> > --

> > 2.37.1.windows.1

> > -The information contained in this mess= age may be confidential and

> > proprietary to American Megatrends (AMI= ). This communication is

> > intended to be read only by the individ= ual or entity to whom it is

> > addressed or by their designee. If the = reader of this message is not

> > the intended recipient, you are on noti= ce that any distribution of

> > this message, in any form, is strictly = prohibited. 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 transmis= sion.

>

>

>

>

 

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#110886) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MW4PR12MB7031A8D8DF8E7C63229E53D7D9A8AMW4PR12MB7031namp_--