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.68]) by mx.groups.io with SMTP id smtpd.web11.15141.1680056704318144390 for ; Tue, 28 Mar 2023 19:25:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=hLs3vy+0; 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.94.68, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n9QbfgeLggLdrzdzitHb6T2+7E5dLEfPkEduISiy+njQSJgIoSoq251wxmOAs0GPHw3C86rvBXe9T4+pHfHe4l72Vd35pXhID0XnF3kr0FWapLh2rjURmjpvEbbdw/Kfg6/p04cOu94zG6Gt0WKnZ+DbXBap4UvIFEnbH4fiZofJrQ+hm3H2sw/IsCK7Iu0T/07UmeF44YM4GpeHmtexYU/H5hu1L3Tfo5HXgeX9Ywy+E7NtiS4cgXzdk8JAKLtS5ELbj4E5WYch5oILV8puZvrmp+qePXDO+tIF2JsjjnsfbCFHqQ95h9EaI5HAy+80quUtAVHJ8PJElSNZHgWl9Q== 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=atpnY5ocQhsz9kLoASMcCpnDTRAho7MpzGUeQws9TM0=; b=cynrjv8PUn/94nA1CN05KAoXW1mNwzjQYI6YQZUQiyZYALmy2e/Q6exCATpljRrQTTp4fk69nlnCPGPv8FnSDTjvwdDqMtPlHt4O9/r9xCHbJBBNirqdo13E8c61DljWZWwne5+fFBJs89NGfJS6d0UgnDW2bIvItQkcgN5W8OIOItjllEPnRTMeG5+zW8yIEZ2Hcrz/5Z28Xgq7/6e3Bpq3uqL+iEbQ77PUnZXzZ5+Yvpad5CxtSyS4Fq1Jmtc2ud6PmkoiGyNkWiDtd5hLWiy+dyOVqE/wFVmhL9toa14exz2G8BRmIRhsSpIKlm5xVb52tSIY6IYOJ6DNQLY/hA== 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=atpnY5ocQhsz9kLoASMcCpnDTRAho7MpzGUeQws9TM0=; b=hLs3vy+09TtLmJ/u8M1N1xTFFzmO3IgTgGll4IhCl32DT3QbXBehZ6SeuFuJOuLXwZBIgY0mZkB2L4aDVMU1lSW0Hwq4pWu6iIiaNK1ZDMUyL1huf2hnV725cVIbFOSz9pwHB81Q8/QlWYgv8S5xZnfLUc9RxdUdOQ7P1D0bLQ4bKvNr4KJGiMNRm188UaaFpHj2ohObS4/r3FE1RXNm6ieZQY3scereHcJWZSwlOSXHbBHqQr1VwiSkQd3oktWV5hrudr40Pjssm9yq0he9iTN6DOyW08SwDS4USiJBHN1A5NF6jK+g2QY8WvW8YZ21xhoR2ZsAwvacW65xRzUN3A== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by CH3PR12MB8509.namprd12.prod.outlook.com (2603:10b6:610:157::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.29; Wed, 29 Mar 2023 02:25:01 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::c27a:fa4b:66ea:d266]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::c27a:fa4b:66ea:d266%6]) with mapi id 15.20.6178.041; Wed, 29 Mar 2023 02:25:00 +0000 From: "Nickle Wang" To: "Chang, Abner" , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [PATCH 2/3] RedfishPkg: Redfish discover driver improvement Thread-Topic: [PATCH 2/3] RedfishPkg: Redfish discover driver improvement Thread-Index: AQHZYTp2F7L+lZNxm0qBj64vv0Jz3q8RBKMQgAAEGrA= Date: Wed, 29 Mar 2023 02:25:00 +0000 Message-ID: References: <20230328055911.221-1-nicklew@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-03-29T02:12:25Z; 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_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=4cf34c1e-195b-4171-8cbf-99f0e737de77; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 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_|CH3PR12MB8509:EE_ x-ms-office365-filtering-correlation-id: 1889027f-ffae-4339-bd51-08db2ffccc41 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tG0GgMIM5ES2ca3mbBLo4brZ/d34ABdjSHvm0VYePmkJu87CiVOgZxmt8FM56o+JEJXn86Jid+ptCaY2s6hSUKTKZxtfoHkvl6dDjLuuGET5+yd3YuqcKlUqb33RnHp68ODiTalbn9sX2fvN2xiYV4cxkbrS5YxztLduwXrMrms4Y/OmFMoaXz5nTseUeOIZVaMoP4/Rh8/vEUjpW9R7N58TDswhI9Gpzq/YStpzP9/+lBr58tQG5c323JkSv2LcaOmE14aoxrf+tdpvVnrAGhjDrwaTbcuyIyTggQnT3NxIzQI6cOMLQcTjWuQoUdXGAz+pvD/1uJ7/hO9Z5SvClzvF8IEuXQZfGbVgxjKwd0lwujVFigJG54Ie63dCdAzpYAWZMnYS9rGiFL+yMvR8UjAfxp6a76rKO65z/Y2wXUAylSva25N27GJN0H56ufqJB4X/cmCjP6f59RJ5a2bjo8O5GsbytcE+jA0OJo3vGNNj5sml+2eBDxgJPfc4yxT07zfqext0zB8rLQCrQoIqu7TcXIJteGVg6LIsv4oBE/uoJ4MogjVfmmZtxby5fZ97t/NloH9Qby8z63T4G6j4SzU74sYN1s57Lvgg6za9ODlVinORkfIeWJ6XpOZGbUDacIWA4HDR9u5s/2IuNdPFIA== 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:(13230028)(4636009)(376002)(136003)(366004)(39860400002)(396003)(346002)(451199021)(2906002)(83380400001)(64756008)(66556008)(8676002)(66946007)(4326008)(66476007)(478600001)(7696005)(54906003)(76116006)(71200400001)(38070700005)(110136005)(9686003)(26005)(316002)(53546011)(30864003)(107886003)(6506007)(55016003)(186003)(19627235002)(86362001)(52536014)(38100700002)(41300700001)(122000001)(5660300002)(33656002)(66446008)(8936002)(341764005)(559001)(579004);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?v8nkY6i3YRqcg69o6LDRHKmCjxr0pEOIFf/eM4y7WWGwrEuMowE1N9YmrtAq?= =?us-ascii?Q?aa5g5anfXjC/ZXxJ1lFuqO6j2f6B1/P02x/rNgBjdZ/U2wR2aGnqWLRe2eC6?= =?us-ascii?Q?pwE08jKIRlpMoNM6pKi/3izl8RSst4ejg/pSnxkcHCCwuVi+mpm8mfhwWdeh?= =?us-ascii?Q?rnD7Ydlge2sznSEi0K4z85uWI8tX3jr501I4sqMlQ7L0eACv7F8m3ev1lBmA?= =?us-ascii?Q?BLz6XpYicbOfbo9FYovtVxs+wRlSDZHlKTJfb58IB0tpRZtKPrvZdBm+DyUx?= =?us-ascii?Q?FAKkQ+vEWy/bt5ZkOCEP3cMJZwHrzmod4v6tJnLOZ/Ud5CTV4nnCv64cQ2KD?= =?us-ascii?Q?WapIoOEhOJbI6bxovnC2dpqeHlb2iyBaWVB4aelUXEST79qQLkivw+2TZwdB?= =?us-ascii?Q?oF7mDUU6kW8qQctfmxNsN3Fd6i5p0TE+dAE25dIbgUR2iBse5fdR/DZo0uiO?= =?us-ascii?Q?TScrI9FfRPmQZGNj3Q6ZngaDWgkIHgqNcRv76una7atUSZc2NeLQNKGKo4QR?= =?us-ascii?Q?U+pakcn38jQfyg/eqwPH3tsBslgNkKNHM00fprbt2tp9c677ph9Wp/a0IOst?= =?us-ascii?Q?r0b+VnLyWQpYc4J9jCX/JoRpnrxmEmyyXreNPnPHfcY1hJciFK65WMKqY3Q3?= =?us-ascii?Q?YFD9aNMscqtjAKEZXPIb2/IInZKgrpTHsKkRQs03EQa3NwihGq0PoMNZOMTo?= =?us-ascii?Q?nMRhgc1+NZHII8Gs8M97oAEXoXTZhrb1EfbaeEfe1tpGAfc7OkeGn6i0E64g?= =?us-ascii?Q?Q7XES2yikr7waeSxws9rQ/2HmCEYxzyC24/LkP1afdiNpJpQFF35oR6zW2u1?= =?us-ascii?Q?/a0Z4nSE7yber9h5/QAk3wa11msdh9Ss98HQu96LWhV01ovNcNamn2fuhmgo?= =?us-ascii?Q?MUbhoMesPVq4O9wMzPYS9aIg7put1bh9NZg+fhgHcrqB5v+p31tmj2rYW4d9?= =?us-ascii?Q?webxtXP+Qsimk63EXvreBup1QvQ3FXL2I+Ah2UZqg5ldT22t+SotIA1I5/An?= =?us-ascii?Q?+WmPMFk1W+HEtRFFftaqyTEHiWmiHQOoSjLvkHD+M+6lehw9sDT11ooZD8hX?= =?us-ascii?Q?2G9j+6jwbF0tLDeRCx8AoczIkaX7pZYuIm5kNQUukoXd5TLr0YrG0SCa547f?= =?us-ascii?Q?xvYZ69t0K/+zSx4eVZHanaowOjlcjetSN9ukKtK1TNTgti6XMmL8XQaK7tRI?= =?us-ascii?Q?j5koZ1/wAUq4KTk2vWmf/ofd4ul7JdFm/wJZ5V8051jNLcvxNVmcejm9ElRD?= =?us-ascii?Q?RQDh+zvh/rXA4ommVxz/qsU1BVT7+/qnVuaCq2f43pEWGx9nnXdPufx1uwKh?= =?us-ascii?Q?OBNBEyYpX+ifRAmbhwsOVQ5kuXbawagRlnA128ZBroZgLp4DGoh1F8XCwys5?= =?us-ascii?Q?3h+6A0AZZBAuFDlzFYJQ8iSNyBT3qD/QiINEhGoBP2pYepQ9X7WcuelyT248?= =?us-ascii?Q?OO00f5BMPA0ZRsRp6a0u4K6ZhAVSnn4mIsKiGIp3qvcclgqbj3YzpsF+4WK6?= =?us-ascii?Q?JrXPNG16y3uSxrrTc+USZx0xSaIy62dg8y75RYb0qA/kfgBvkE12u/DZmVw1?= =?us-ascii?Q?cONpcH0fO8ZK/z42Bxw=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: 1889027f-ffae-4339-bd51-08db2ffccc41 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2023 02:25:00.7712 (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: JZ1pfhmd37v6To09/e3B1mBfz8NE+9mzuMG8vcYqhE5lRVrmi6kOjq/0eSYgGD/m+WjH0u4z3zmuv30YK4VjwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8509 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes, let me handle this in version 2 patch. Thanks! Regards, Nickle > -----Original Message----- > From: Chang, Abner > Sent: Wednesday, March 29, 2023 10:12 AM > To: Nickle Wang ; devel@edk2.groups.io > Cc: Igor Kulchytskyy ; Nick Ramirez > Subject: RE: [PATCH 2/3] RedfishPkg: Redfish discover driver improvement >=20 > External email: Use caution opening links or attachments >=20 >=20 > [AMD Official Use Only - General] >=20 > Hi Nickle, > I found that we had defined the Host IP address format in > Redfish\Incluode\IndustryStandard\RedfishHostInterface.h >=20 > #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_UNKNOWN > 0x00 > #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP4 0x01 > #define REDFISH_HOST_INTERFACE_HOST_IP_ADDRESS_FORMAT_IP6 0x02 >=20 > Could you please help to update the references of HostIpAddressFormat to = use > above macros? > Thanks > Abner >=20 > > -----Original Message----- > > From: Nickle Wang > > Sent: Tuesday, March 28, 2023 1:59 PM > > To: devel@edk2.groups.io > > Cc: Chang, Abner ; Igor Kulchytskyy > > ; Nick Ramirez > > Subject: [PATCH 2/3] RedfishPkg: Redfish discover driver improvement > > > > Caution: This message originated from an External Source. Use proper > > caution when opening attachments, clicking links, or responding. > > > > > > Bug fix: > > - function stack fault > > - properly handle "SubnetAddrInfoIPv6" when there is no IPv6 support > > - copy-n-paste error in RedfishGetHostInterfaceProtocolData() > > - fix typo > > Enhancement: > > - Redfish discover driver now can configure host IP address based on > > the information from SMBIOS type 42 record. This saves the effort of > > configuring host IP address in setup menu. > > - Performance improvement to driver binding process. Redfish discover > > driver will wait until all required drivers are ready and do driver > > binding start(). > > - Use CopyGuid() to copy GUID instead of intrinsic function. > > - Error handling when SMBIOS data is corrupted. > > > > Signed-off-by: Nickle Wang > > Cc: Abner Chang > > Cc: Igor Kulchytskyy > > Cc: Nick Ramirez > > --- > > .../RedfishDiscoverInternal.h | 20 ++- > > .../RedfishDiscoverDxe/RedfishDiscoverDxe.c | 142 ++++++++++++------ > > .../RedfishSmbiosHostInterface.c | 13 +- > > 3 files changed, 119 insertions(+), 56 deletions(-) > > > > diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h > > b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h > > index 04fa09e1cc..2704cd955d 100644 > > --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h > > +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h > > @@ -3,6 +3,7 @@ > > > > (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> > Copyright (c) 2022, AMD Incorporated. All rights reserved. > > + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights rese= rved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -102,7 +103,7 @@ typedef struct { > > UINT32 SubnetAddrInfoIPv6Num= ber; ///< IPv6 > > address info number. > > EFI_IP6_ADDRESS_INFO *SubnetAddrInfoIPv6; = ///< IPv6 > > address info. > > // > > - // Network interface protocol and REST EX infor. > > + // Network interface protocol and REST EX info. > > // > > UINT32 NetworkProtocolType; = ///< Network > > protocol type. Refer to > > > > ///< NETWORK_INTERFACE_PROTOCOL_TYPE. > > @@ -112,7 +113,7 @@ typedef struct { > > // EFI_REDFISH_DISCOVER_PROTOCOL instance installed > > // on this network interface. > > // > > - EFI_HANDLE EfiRedfishDiscoverPro= tocolHandle; ///< > > EFI_REDFISH_DISCOVER_PROTOTOCOL instance installed > > + EFI_HANDLE EfiRedfishDiscoverPro= tocolHandle; ///< > > EFI_REDFISH_DISCOVER_PROTOCOL instance installed > > = ///< on this network interface. > > } EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL; > > > > @@ -123,7 +124,7 @@ typedef struct { > > LIST_ENTRY Entry; ///< Link list e= ntry. > > EFI_HANDLE OpenDriverAgentHandle; ///< The agent t= o open > > network protocol. > > EFI_HANDLE OpenDriverControllerHandle; ///< The control= ler handle > > to open network protocol. > > - EFI_HANDLE RestExChildHandle; ///< The child h= andle created > > throught REST EX Service Protocol. > > + EFI_HANDLE RestExChildHandle; ///< The child h= andle created > > through REST EX Service Protocol. > > EFI_HANDLE RestExControllerHandle; ///< The control= ler handle > > which provide REST EX protocol. > > EFI_REST_EX_PROTOCOL *RestExProtocolInterface; ///< Pointer to > > EFI_REST_EX_PROTOCOL. > > UINT32 RestExId; ///< The identif= ier installed on REST EX > > controller handle. > > @@ -178,15 +179,18 @@ typedef struct { > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > *NetworkInterface; ///< > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > > > ///< instance used to discover Redfish service. > > // > > - // Below for Host insterface discovery. > > + // Below for Host interface discovery. > > // > > BOOLEAN HostIntfValidatio= n; ///< Indicates whether > > to validate Redfish Host interface. > > EFI_IP_ADDRESS TargetIpAddress; = ///< Target IP > > address reported in Redfish Host interface. > > + UINT8 HostAddrFormat; = ///< Unknown=3D00h, > > Ipv4=3D01h, Ipv6=3D02h. > > + EFI_IP_ADDRESS HostIpAddress; = ///< Host IP address > > reported in Redfish Host interface. > > + EFI_IP_ADDRESS HostSubnetMask; = ///< Host subnet > > mask address reported in Redfish Host interface. > > } EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE; > > > > /** > > - The function adds a new foudn Redfish service to internal list and > > - notify clinet. > > + The function adds a new found Redfish service to internal list and > > + notify client. > > > > It simply frees the packet. > > > > @@ -197,7 +201,7 @@ typedef struct { > > @param[in] Os OS string. > > @param[in] OsVer OS version string. > > @param[in] Product Product string. > > - @param[in] ProductVer Product verison string. > > + @param[in] ProductVer Product version string. > > @param[in] UseHttps Redfish service requires secured c= onnection. > > @retval EFI_SUCCESS Redfish service is added to list s= uccessfully. > > > > @@ -224,7 +228,7 @@ AddAndSignalNewRedfishService ( > > @param[out] DeviceDescriptor Pointer to REDFISH_INTERFACE_DATA. > > @param[out] ProtocolData Pointer to > > REDFISH_OVER_IP_PROTOCOL_DATA. > > > > - @retval EFI_SUCCESS Get host interface succesfully. > > + @retval EFI_SUCCESS Get host interface successfully. > > @retval Otherwise Fail to tet host interface. > > > > **/ > > diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > index 042d6d5fd5..ba42c8a5de 100644 > > --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c > > @@ -1,9 +1,10 @@ > > /** @file > > > > - The implementation of EFI Redfidh Discover Protocol. > > + The implementation of EFI Redfish Discover Protocol. > > > > (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> > Copyright (c) 2022, AMD Incorporated. All rights reserved. > > + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights rese= rved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -270,10 +271,13 @@ Tcp6GetSubnetInfo ( > > > > if (IpModedata.AddressCount =3D=3D 0) { > > DEBUG ((DEBUG_INFO, "%a: No IPv6 address configured.\n", > > __FUNCTION__)); > > + Instance->SubnetAddrInfoIPv6Number =3D 0; > > + return EFI_SUCCESS; > > } > > > > if (Instance->SubnetAddrInfoIPv6 !=3D NULL) { > > FreePool (Instance->SubnetAddrInfoIPv6); > > + Instance->SubnetAddrInfoIPv6 =3D NULL; > > } > > > > Instance->SubnetAddrInfoIPv6 =3D AllocateZeroPool > > (IpModedata.AddressCount * sizeof (EFI_IP6_ADDRESS_INFO)); @@ -447,7 > > +451,7 @@ NumberOfNetworkInterface ( > > > > /** > > This function checks the IP version supported on this > > - netwoek interface. > > + network interface. > > > > @param[in] ThisNetworkInterface > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > > > @@ -472,7 +476,7 @@ CheckIsIpVersion6 ( > > @param[in] Instance EFI_REDFISH_DISCOVERED_INTERNAL_INSTANCE > > > > @retval EFI_SUCCESS Redfish service is discovered through SMB= IOS > > Host interface. > > - @retval Others Fail to discover Redfish service throught= SMBIOS host > > interface > > + @retval Others Fail to discover Redfish service through = SMBIOS host > > interface > > > > **/ > > EFI_STATUS > > @@ -487,7 +491,7 @@ DiscoverRedfishHostInterface ( > > CHAR16 Ipv6Str[sizeof "ffff:ffff:ffff:ffff:f= fff:ffff:ffff:ffff" + 1]; > > CHAR8 RedfishServiceLocateStr[sizeof > > "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" + 1]; > > UINTN StrSize; > > - UINTN MacCompareStstus; > > + UINTN MacCompareStatus; > > BOOLEAN IsHttps; > > > > Data =3D NULL; > > @@ -503,24 +507,52 @@ DiscoverRedfishHostInterface ( > > Status =3D RedfishGetHostInterfaceProtocolData (mSmbios, > > &DeviceDescriptor, &Data); // Search for SMBIOS type 42h > > if (!EFI_ERROR (Status) && (Data !=3D NULL) && (DeviceDescriptor != =3D NULL)) { > > // > > - // Chceck if we can reach out Redfish service using this network i= nterface. > > - // Check with MAC address using Device Descroptor Data Device Type= 04 > > and Type 05. > > + // 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. > > // Those two types of Redfish host interface device has MAC inform= ation. > > // > > if (DeviceDescriptor->DeviceType =3D=3D > > REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) { > > - MacCompareStstus =3D CompareMem (&Instance->NetworkInterface- > > >MacAddress, &DeviceDescriptor- > > >DeviceDescriptor.PciPcieDeviceV2.MacAddress, 6); > > + MacCompareStatus =3D CompareMem > > + (&Instance->NetworkInterface->MacAddress, > > + &DeviceDescriptor->DeviceDescriptor.PciPcieDeviceV2.MacAddress, 6); > > } else if (DeviceDescriptor->DeviceType =3D=3D > > REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2) { > > - MacCompareStstus =3D CompareMem (&Instance->NetworkInterface- > > >MacAddress, &DeviceDescriptor- > > >DeviceDescriptor.UsbDeviceV2.MacAddress, 6); > > + MacCompareStatus =3D CompareMem > > + (&Instance->NetworkInterface->MacAddress, > > + &DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress, 6); > > } else { > > return EFI_UNSUPPORTED; > > } > > > > - if (MacCompareStstus !=3D 0) { > > + if (MacCompareStatus !=3D 0) { > > return EFI_UNSUPPORTED; > > } > > > > + Instance->HostAddrFormat =3D Data->HostIpAddressFormat; > > + if (Data->HostIpAddressFormat =3D=3D 1) { > > + IP4_COPY_ADDRESS ((VOID *)&Instance->HostIpAddress.v4, (VOID > > *)Data->HostIpAddress); > > + IP4_COPY_ADDRESS ((VOID *)&Instance->HostSubnetMask.v4, (VOID > > + *)Data->HostIpMask); > > + > > + if (EFI_IP4_EQUAL (&Instance->HostIpAddress.v4, &mZeroIp4Addr)) = { > > + DEBUG ((DEBUG_ERROR, "%a: invalid host IP address: zero > > + address\n", > > __FUNCTION__)); > > + // > > + // Invalid IP address detected. Change address format to > > + Unknown and > > use system default address. > > + // > > + Instance->HostAddrFormat =3D 0x00; > > + } > > + > > + if (!IP4_IS_VALID_NETMASK (EFI_IP4 > > + (Instance->HostSubnetMask.v4))) > > { > > + DEBUG ((DEBUG_ERROR, "%a: invalid subnet mask address\n", > > __FUNCTION__)); > > + // > > + // Invalid subnet mast address detected. Change address > > + format to > > Unknown and use system default address. > > + // > > + Instance->HostAddrFormat =3D 0x00; > > + } > > + } else if (Data->HostIpAddressFormat =3D=3D 2) { > > + IP6_COPY_ADDRESS ((VOID *)&Instance->HostIpAddress.v6, (VOID > > *)Data->HostIpAddress); > > + } > > + > > if (Data->RedfishServiceIpAddressFormat =3D=3D 1) { > > IP4_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v4, (VOID > > *)Data->RedfishServiceIpAddress); > > + > > + if (EFI_IP4_EQUAL (&Instance->TargetIpAddress.v4, &mZeroIp4Addr)= ) { > > + DEBUG ((DEBUG_ERROR, "%a: invalid service IP address: zero > > address\n", __FUNCTION__)); > > + } > > } else { > > IP6_COPY_ADDRESS ((VOID *)&Instance->TargetIpAddress.v6, (VOID > > *)Data->RedfishServiceIpAddress); > > } > > @@ -530,7 +562,7 @@ DiscoverRedfishHostInterface ( > > Status =3D EFI_UNSUPPORTED; > > } else { > > // > > - // Add this istance to list without detial information of Redfis= h > > + // Add this instance to list without detail information of > > + Redfish > > // service. > > // > > IsHttps =3D FALSE; > > @@ -614,7 +646,7 @@ DiscoverRedfishHostInterface ( > > @param[in] Os OS string. > > @param[in] OsVer OS version string. > > @param[in] Product Product string. > > - @param[in] ProductVer Product verison string. > > + @param[in] ProductVer Product version string. > > @param[in] UseHttps Redfish service requires secured c= onnection. > > @retval EFI_SUCCESS Redfish service is added to list s= uccessfully. > > > > @@ -671,7 +703,7 @@ AddAndSignalNewRedfishService ( > > do { > > if ((Char16Uuid =3D=3D NULL) || > > (DiscoveredList->Instance->Information.Uuid > > =3D=3D NULL)) { > > // > > - // Check if this Redfish instance already found using IP addrr= ess. > > + // Check if this Redfish instance already found using IP addre= ss. > > // > > if (!CheckIsIpVersion6 (NetworkInterface)) { > > if (CompareMem ( > > @@ -849,6 +881,10 @@ AddAndSignalNewRedfishService ( > > Status =3D EFI_OUT_OF_RESOURCES; > > goto EXIT_FREE_CONFIG_DATA; > > } > > + > > + if (Instance->HostAddrFormat =3D=3D 2) { > > + IP6_COPY_ADDRESS (&RestExHttpConfigData- > > >HttpConfigData.AccessPoint.IPv6Node->LocalAddress, &Instance- > > >HostIpAddress.v6); > > + } > > } else { > > RestExHttpConfigData->HttpConfigData.AccessPoint.IPv4Node =3D > > AllocateZeroPool (sizeof (EFI_HTTPv4_ACCESS_POINT)); > > if (RestExHttpConfigData->HttpConfigData.AccessPoint.IPv4Node > > =3D=3D > > NULL) { @@ -856,7 +892,13 @@ AddAndSignalNewRedfishService ( > > goto EXIT_FREE_CONFIG_DATA; > > } > > > > - RestExHttpConfigData->HttpConfigData.AccessPoint.IPv4Node- > > >UseDefaultAddress =3D TRUE; > > + if (Instance->HostAddrFormat =3D=3D 1) { > > + RestExHttpConfigData->HttpConfigData.AccessPoint.IPv4Node- > > >UseDefaultAddress =3D FALSE; > > + IP4_COPY_ADDRESS (&RestExHttpConfigData- > > >HttpConfigData.AccessPoint.IPv4Node->LocalAddress, &Instance- > > >HostIpAddress.v4); > > + IP4_COPY_ADDRESS (&RestExHttpConfigData- > > >HttpConfigData.AccessPoint.IPv4Node->LocalSubnet, &Instance- > > >HostSubnetMask.v4); > > + } else { > > + RestExHttpConfigData->HttpConfigData.AccessPoint.IPv4Node- > > >UseDefaultAddress =3D TRUE; > > + } > > } > > > > Status =3D RestEx->Configure ( > > @@ -955,7 +997,7 @@ NetworkInterfaceGetSubnetInfo ( > > Instance > > ); > > if (EFI_ERROR (Status)) { > > - DEBUG ((DEBUG_ERROR, "%a:Faile to get Subnet infomation.\n", > > __FUNCTION__)); > > + DEBUG ((DEBUG_ERROR, "%a:Failed to get Subnet infomation.\n", > > + __FUNCTION__)); > > return Status; > > } else { > > DEBUG ((DEBUG_INFO, "%a:MAC address: %s\n", __FUNCTION__, > > Instance->StrMacAddr)); @@ -982,7 +1024,7 @@ > > NetworkInterfaceGetSubnetInfo ( > > ThisSubnetAddrInfoIPv6++; > > for (IPv6InfoIndex =3D 0; IPv6InfoIndex < Instance- > > >SubnetAddrInfoIPv6Number - 1; IPv6InfoIndex++) { > > // > > - // Build up addtional > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instances. > > + // Build up additional > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instances. > > // > > NewNetworkInterface =3D > > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > *)AllocateZeroPool (sizeof > > (EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL)); > > if (NewNetworkInterface !=3D NULL) { @@ -1103,9 +1145,9 @@ > > RedfishServiceGetNetworkInterface ( > > /** > > This function acquires Redfish services by discovering static Redfis= h setting > > according to Redfish Host Interface or through SSDP. Returns a list > > of EFI > > - handles in EFI_REDFISH_DISCOVERED_LIST. Each of EFI handle has > > cooresponding > > - EFI REST EX instance installed on it. Each REST EX isntance is a > > child instance which > > - created through EFI REST EX serivce protoocl for communicating with > > specific > > + handles in EFI_REDFISH_DISCOVERED_LIST. Each of EFI handle has > > + corresponding EFI REST EX instance installed on it. Each REST EX > > + instance is a child instance which created through EFI REST EX > > + service protocol for communicating with specific > > Redfish service. > > > > @param[in] This EFI_REDFISH_DISCOVER_PROTOCOL = instance. > > @@ -1255,7 +1297,7 @@ RedfishServiceAbortAcquire ( > > ) > > { > > // This function is used to abort Redfish service discovery through > > SSDP > > - // on the network interface. SSDP is optionally supprted by > > EFI_REDFISH_DISCOVER_PROTOCOL, > > + // on the network interface. SSDP is optionally suppoted by > > + EFI_REDFISH_DISCOVER_PROTOCOL, > > // we dont have implementation for SSDP now. > > > > return EFI_UNSUPPORTED; > > @@ -1425,7 +1467,7 @@ CreateRedfishDiscoverNetworkInterface ( } > > > > /** > > - This function destory network interface > > + This function destroy network interface > > > > > > @param[in] ThisNetworkInterface > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL instance. > > @@ -1433,7 +1475,7 @@ CreateRedfishDiscoverNetworkInterface ( > > @retval EFI_STATUS > > **/ > > EFI_STATUS > > -DestroyRedfishNetwrokInterface ( > > +DestroyRedfishNetworkInterface ( > > IN EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > *ThisNetworkInterface > > ) > > { > > @@ -1467,11 +1509,13 @@ TestForRequiredProtocols ( > > IN EFI_HANDLE ControllerHandle > > ) > > { > > - UINT32 Id; > > + UINT32 *Id; > > UINTN Index; > > EFI_STATUS Status; > > + UINTN ListCount; > > > > - for (Index =3D 0; Index < (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_REQUIRED_PROTOCOL)); Index++) { > > + ListCount =3D (sizeof (gRequiredProtocol) / sizeof > > + (REDFISH_DISCOVER_REQUIRED_PROTOCOL)); > > + for (Index =3D 0; Index < ListCount; Index++) { > > Status =3D gBS->OpenProtocol ( > > ControllerHandle, > > > > gRequiredProtocol[Index].RequiredServiceBindingProtocolGuid, > > @@ -1490,8 +1534,10 @@ TestForRequiredProtocols ( > > EFI_OPEN_PROTOCOL_GET_PROTOCOL > > ); > > if (EFI_ERROR (Status)) { > > - DEBUG ((DEBUG_ERROR, "%a: %s is found on this controller handl= e.\n", > > __FUNCTION__, gRequiredProtocol[Index].ProtocolName)); > > - return EFI_SUCCESS; > > + if (Index =3D=3D ListCount - 1) { > > + DEBUG ((DEBUG_ERROR, "%a: all required protocols are found > > + on this > > controller handle: %p.\n", __FUNCTION__, ControllerHandle)); > > + return EFI_SUCCESS; > > + } > > } > > } > > } > > @@ -1517,7 +1563,7 @@ BuildupNetworkInterface ( > > IN EFI_HANDLE ControllerHandle > > ) > > { > > - UINT32 Id; > > + UINT32 *Id; > > UINT32 Index; > > EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > *NetworkInterface; > > BOOLEAN IsNew; > > @@ -1578,13 +1624,11 @@ BuildupNetworkInterface ( > > return Status; > > } > > > > - NetworkInterface->NetworkProtocolType =3D > > gRequiredProtocol[Index].ProtocolType; > > - NetworkInterface->OpenDriverAgentHandle =3D = This- > > >DriverBindingHandle; > > - NetworkInterface->OpenDriverControllerHandle =3D > > ControllerHandle; > > - NetworkInterface->NetworkInterfaceProtocolInfo.ProtocolGuid =3D = \ > > - *gRequiredProtocol[Index].RequiredProtocolGuid; > > - NetworkInterface->NetworkInterfaceProtocolInfo.ProtocolServiceGu= id > > =3D \ > > - *gRequiredProtocol[Index].RequiredServiceBindingProtocolGuid; > > + NetworkInterface->NetworkProtocolType =3D > > gRequiredProtocol[Index].ProtocolType; > > + NetworkInterface->OpenDriverAgentHandle =3D This- > > >DriverBindingHandle; > > + NetworkInterface->OpenDriverControllerHandle =3D ControllerHandl= e; > > + CopyGuid (&NetworkInterface- > > >NetworkInterfaceProtocolInfo.ProtocolGuid, > > gRequiredProtocol[Index].RequiredProtocolGuid); > > + CopyGuid > > + (&NetworkInterface->NetworkInterfaceProtocolInfo.ProtocolServiceGuid > > + , gRequiredProtocol[Index].RequiredServiceBindingProtocolGuid); > > ProtocolDiscoverIdPtr =3D &NetworkInterface- > > >NetworkInterfaceProtocolInfo.ProtocolDiscoverId; > > OpenDriverAgentHandle =3D NetworkInterface- > > >OpenDriverAgentHandle; > > OpenDriverControllerHandle =3D NetworkInterface- > > >OpenDriverControllerHandle; > > @@ -1598,7 +1642,7 @@ BuildupNetworkInterface ( > > > > gBS->RestoreTPL (OldTpl); > > } else { > > - // Record REST_EX instance. REST_EX is created when clinet asks = for > > Redfish service discovery. > > + // Record REST_EX instance. REST_EX is created when client asks > > + for > > Redfish service discovery. > > // Redfish Service Discover protocol will match REST EX to the > > corresponding EFI_REDFISH_DISCOVER_NETWORK_INTERFACE_INTERNAL > > // when discovery. > > > > @@ -1655,9 +1699,9 @@ BuildupNetworkInterface ( > > ); > > if (!EFI_ERROR (Status)) { > > if ((gRequiredProtocol[Index].ProtocolType =3D=3D ProtocolType= RestEx)) { > > - // Install Redfish Discover Protocol when EFI REST EX protco= l is > > discovered. > > + // Install Redfish Discover Protocol when EFI REST EX > > + protocol is > > discovered. > > // This ensures EFI REST EX is ready while the consumer of > > EFI_REDFISH_DISCOVER_PROTOCOL > > - // acquires Redfish serivce over network interface. > > + // acquires Redfish service over network interface. > > > > if (!NewNetworkInterfaceInstalled) { > > NetworkInterface =3D > > GetTargetNetworkInterfaceInternalByController > > (ControllerHandle); @@ -1678,6 +1722,14 @@ BuildupNetworkInterface ( > > if (EFI_ERROR (Status)) { > > DEBUG ((DEBUG_ERROR, "%a: Fail to install > > EFI_REDFISH_DISCOVER_PROTOCOL\n", __FUNCTION__)); > > } > > + } else { > > + DEBUG ((DEBUG_INFO, "%a: Not REST EX, continue with > > + next\n", > > __FUNCTION__)); > > + Index++; > > + if (Index =3D=3D (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))) { > > + break; > > + } > > + > > + continue; > > } > > } > > > > @@ -1692,11 +1744,11 @@ BuildupNetworkInterface ( > > } > > } while (Index < (sizeof (gRequiredProtocol) / sizeof > > (REDFISH_DISCOVER_REQUIRED_PROTOCOL))); > > > > - return EFI_UNSUPPORTED; > > + return EFI_DEVICE_ERROR; > > } > > > > /** > > - Close the protocol opened for Redfish discovery. This function also > > destories > > + Close the protocol opened for Redfish discovery. This function also > > + destroy > > the network services. > > > > @param[in] ThisBindingProtocol A pointer to the > > EFI_DRIVER_BINDING_PROTOCOL instance. > > @@ -1707,8 +1759,8 @@ BuildupNetworkInterface ( > > @param[in] DriverAgentHandle Driver agent handle which used to= open > > protocol earlier. > > @param[in] DriverControllerHandle Driver controller handle which > > used to open protocol earlier. > > > > - @retval EFI_SUCCESS Prorocol is closed successfully. > > - @retval Others Prorocol is closed unsuccessfully= . > > + @retval EFI_SUCCESS Protocol is closed successfully. > > + @retval Others Protocol is closed unsuccessfully= . > > > > **/ > > EFI_STATUS > > @@ -1748,7 +1800,7 @@ CloseProtocolService ( > > must support a protocol interface t= hat supplies > > an I/O abstraction to the driver. > > @retval EFI_SUCCESS One of required protocol is found. > > - @retval Others Faile to stop the services on netwo= rk interface. > > + @retval Others Failed to stop the services on netw= ork interface. > > **/ > > EFI_STATUS > > StopServiceOnNetworkInterface ( > > @@ -1792,14 +1844,14 @@ StopServiceOnNetworkInterface ( > > ThisNetworkInterface->OpenDriverControllerHandl= e > > ); > > if (!EFI_ERROR (Status)) { > > - Status =3D DestroyRedfishNetwrokInterface (ThisNetworkIn= terface); > > + Status =3D DestroyRedfishNetworkInterface > > + (ThisNetworkInterface); > > } > > > > gBS->RestoreTPL (OldTpl); > > > > // > > // Disconnect EFI Redfish discover driver controller to no= tify the > > - // clinet which uses .EFI Redfish discover protocol. > > + // client which uses .EFI Redfish discover protocol. > > // > > if (DiscoverProtocolHandle !=3D NULL) { > > gBS->DisconnectController (DiscoverProtocolHandle, > > NULL, NULL); @@ -1945,7 +1997,7 @@ > RedfishDiscoverDriverBindingSupported ( > > @retval EFI_SUCCESS The device was started. > > @retval EFI_DEVICE_ERROR The device could not be started due= to a > > device error.Currently not implemented. > > @retval EFI_OUT_OF_RESOURCES The request could not be completed > > due to a lack of resources. > > - @retval Others The driver failded to start the dev= ice. > > + @retval Others The driver failed to start the devi= ce. > > > > **/ > > EFI_STATUS > > @@ -2030,7 +2082,7 @@ RedfishDiscoverEntryPoint ( > > InitializeListHead (&mEfiRedfishDiscoverNetworkInterface); > > InitializeListHead (&mEfiRedfishDiscoverRestExInstance); > > // > > - // Install binding protoocl to obtain UDP and REST EX protocol. > > + // Install binding protocol to obtain UDP and REST EX protocol. > > // > > Status =3D EfiLibInstallDriverBindingComponentName2 ( > > ImageHandle, > > diff --git > > a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c > > b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c > > index 88cec1f416..0d6edc7dc3 100644 > > --- a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c > > +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c > > @@ -4,6 +4,7 @@ > > Discover Redfish SMBIOS Host Interface. > > > > (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> > + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights rese= rved. > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -22,7 +23,7 @@ SMBIOS_TABLE_TYPE42 *mType42Record; > > @param[out] DeviceDescriptor Pointer to REDFISH_INTERFACE_DATA. > > @param[out] ProtocolData Pointer to > > REDFISH_OVER_IP_PROTOCOL_DATA. > > > > - @retval EFI_SUCCESS Get host interface succesfully. > > + @retval EFI_SUCCESS Get host interface successfully. > > @retval Otherwise Fail to tet host interface. > > > > **/ > > @@ -69,9 +70,15 @@ RedfishGetHostInterfaceProtocolData ( > > // > > if ((*RecordTmp =3D=3D > > REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) || (*RecordTmp =3D=3D > > REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2)) { > > if (*RecordTmp =3D=3D > > REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE_V2) { > > - ASSERT (SpecificDataLen =3D=3D sizeof > > (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1); > > + if (SpecificDataLen !=3D sizeof > > (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1) { > > + ASSERT (SpecificDataLen =3D=3D sizeof > > (PCI_OR_PCIE_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1); > > + return EFI_VOLUME_CORRUPTED; > > + } > > } else { > > - ASSERT (SpecificDataLen > sizeof > > (REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2) + 1); > > + if (SpecificDataLen !=3D sizeof > > (USB_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1) { > > + ASSERT (SpecificDataLen =3D=3D sizeof > > (USB_INTERFACE_DEVICE_DESCRIPTOR_V2) + 1); > > + return EFI_VOLUME_CORRUPTED; > > + } > > } > > > > *DeviceDescriptor =3D (REDFISH_INTERFACE_DATA *)RecordTmp; > > -- > > 2.40.0.windows.1