From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111656+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700722060511124.49886904589255; Wed, 22 Nov 2023 22:47:40 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=wa4E8REGmoVowfBmWo+PtUdA8yCdY4KYW5R6uTRBUhM=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722060; v=1; b=GrHE5NGiWPUv5FFyJyaB9OzixZbwo5lPI5o7ky8dcC92ihyt5qxOBx+DyPUQkbZ9q/DNrY4/ uUKp09kz+NpoHcyarE1H9Qb4Q4aYaknmJqx4Lyw80NyH7JR7Phv2w43yl7suX/MTShunRWxLwpi qfjHeurMsFwCDEMDBCZ05HxI= X-Received: by 127.0.0.2 with SMTP id CKQWYY1788612x1IaYh2vNkD; Wed, 22 Nov 2023 22:47:40 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.47]) by mx.groups.io with SMTP id smtpd.web11.86145.1700722059465980903 for ; Wed, 22 Nov 2023 22:47:39 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=We6/an1GY0bFLK6rYW77m5/iI1lt6aOYCdVu7I2Ax5VLj5fz1knVaWFWy4ICPCpdwwumitNspDfcjDjcSTigHHrJsJmPPdx5bmXxTDNfi+GtPLmXAx08cH92iXsW0E1WxwuL7riveGfKGvvv0r6pz9MtgI0PmCGnG6SwFFF0IFx17pf/bGYKkpZpJivc3Kx7I8YYecInoOxCAi8D9+Ynx1RFIuRBd63fWxSCt4iH+utKXvFgZ8HmdHmIr1OBmwz8yBtvSbflvSjbkmIcVkdGkAbbBViZna7vIgwoI3sizLPGja2y2baweTaCbcSq8YXXQRIqmW7gghuybb9I6MREOw== 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=e5CR7BB1pw+ZeX/uyHxk8/d7n6oTQvk1PXEQPAjepqM=; b=n5wJR1vvi9gn7PMseiospO6y0jo93zG2g7mjsfU3UOQTO9B9Us+TCkX1ZQhAZs+QHoJWfgTmjdC0D2LC+zdApOC2EF5xTRb/IejBmH5ttmCj2hdyKFmpjj/YIMHGh1eF5DtdG1DuB4n4ZBs6YNVv4FReZ/UAbQUPRBvEd3K8Lwd0ILaJGgq8MsVbtHPJmtLjyRipbA+2f1SysX55n0hCyJ2r5u8s573XVU7xnRHrxYqoLGflHnYbMtbFCki4ZiVYk0A5/FW69ropJWTle7etjFP+kEdLnCKCBXndQwPLwdoJu2A6PtuvaT5+LajGbhEL61GQBSp/dQLXiZ9JPTDpYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from DS7PR03CA0154.namprd03.prod.outlook.com (2603:10b6:5:3b2::9) by MN0PR12MB6246.namprd12.prod.outlook.com (2603:10b6:208:3c2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 06:47:35 +0000 X-Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:5:3b2:cafe::9d) by DS7PR03CA0154.outlook.office365.com (2603:10b6:5:3b2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20 via Frontend Transport; Thu, 23 Nov 2023 06:47:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111656+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:47:35 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:47:33 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 1/8] RedfishPkg/BmcUsbNicLib: Update BMC USB NIC searching algorithm Date: Thu, 23 Nov 2023 14:47:11 +0800 Message-ID: <20231123064719.1248-2-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017093:EE_|MN0PR12MB6246:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fc9ea21-7b79-45a0-8bc7-08dbebf013a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: OzSG5XwhpGANKhgl3D624b2eB6p7m4bLyuzI5wuIVsZAghzTgNgddWhMCT/fueGJqpjHE1q0y0lIllwgN+fjRNEIxntDmIQN+0dh458kVG1gCLqdumHurKfaDBIyoOypRWYxV6cAOpInKDbQPiiQeoh3punaCqqZij528/Mddy4TBdrUX1yLP6f/ubAFBWZk/kTNbeiGFEA78xx6Qpm3mgtnxQy/SvZb9rYNgFAuv6/1GDHa0/DCFRG4SlVU2TgtwqPDBW1ajpab40+uOXwBS8sRHrKBd+mrq2WG3Gl9byx5vr+suVbPPuSD4XwyV28KkmHpmiYg6A2YbEEKXNAGwdgWiCsllz9u+5zj8Q5mTi38ntWViHSbhOyW3FTiL/T3DK5JfaSoia3C7lKCcTcQUkr8eGtENzZDUrg5SwZYQq5oZF/Y5a7YEm31MeiB/PzCt7gEjZ4XHl8i7TtUzsCTuJWt3DrqsES86HK1b+zyJ5Vvt2G2B6zpOpMIncNcRxp0uSeDbNHLtKNd6rMC/5UoQhakkGdLlGNvh/aA3Ys0FAMohvJFF5fa2+zUqLblemYy/kY9BA4aRr+2H3BX/AOpuLQJzGDAtAk6XDRzb/CFXYngmzP6k7WO8yfdN57QlYS9ZE3G/b83taO4oLjxBwb7+KktxoMPQYoAYlkFKvtTlAmLnYiRsrQYAlOnzSOYRlzN/WHua1zbJllvlGyrF2hMM3NdglAowqt+dBtbV/OFqWHlOAdBZTJkq26eTsqqTaJdzPmiSIQBve77Lvh3qnv1AQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:47:35.4942 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fc9ea21-7b79-45a0-8bc7-08dbebf013a4 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6246 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 6zTPBJMcOSSEGRQIytJVT09Gx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722061363100007 Content-Type: text/plain; charset="utf-8" From: Abner Chang Update BMC USB NIC searching algorithm for IPv4 only. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../PlatformHostInterfaceBmcUsbNicLib.c | 188 ++++++++++++------ 1 file changed, 128 insertions(+), 60 deletions(-) diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformH= ostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsb= NicLib/PlatformHostInterfaceBmcUsbNicLib.c index 95900579118..e5bf70cfd58 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c @@ -368,7 +368,9 @@ RetrievedBmcUsbNicInfo ( )); CopyMem ((VOID *)&ThisInstance->RedfishIpAddressIpv4, (VOID *)&DestI= pAddress->IpAddress, sizeof (DestIpAddress->IpAddress)); // - // According to UEFI spec, the IP address at BMC USB NIC host end is= the IP address at BMC end minus 1. + // According to the design spec: + // https://github.com/tianocore/edk2/tree/master/RedfishPkg#platform= -with-bmc-and-the-bmc-exposed-usb-network-device + // The IP address at BMC USB NIC host end is the IP address at BMC e= nd minus 1. // CopyMem ((VOID *)&ThisInstance->HostIpAddressIpv4, (VOID *)&DestIpAd= dress->IpAddress, sizeof (DestIpAddress->IpAddress)); ThisInstance->HostIpAddressIpv4[sizeof (ThisInstance->HostIpAddressI= pv4) - 1] -=3D 1; @@ -729,8 +731,10 @@ HostInterfaceIpmiCheckMacAddress ( =20 // // According to design spec in Readme file under RedfishPkg. - // Compare the first five MAC address and - // the 6th MAC address. + // https://github.com/tianocore/edk2/tree/master/RedfishPkg#platform= -with-bmc-and-the-bmc-exposed-usb-network-device + // Compare the first five elements of MAC address and the 6th elemen= t of MAC address. + // The 6th element of MAC address must be the 6th element of + // IPMI channel MAC address minus 1. // if ((IpmiLanMacAddressSize !=3D UsbNicInfo->MacAddressSize) || (CompareMem ( @@ -738,8 +742,8 @@ HostInterfaceIpmiCheckMacAddress ( (VOID *)&IpmiLanChannelMacAddress.Addr, IpmiLanMacAddressSize - 1 ) !=3D 0) || - (IpmiLanChannelMacAddress.Addr[IpmiLanMacAddressSize - 1] !=3D - *(UsbNicInfo->MacAddress + IpmiLanMacAddressSize - 1) - 1) + ((IpmiLanChannelMacAddress.Addr[IpmiLanMacAddressSize - 1] - 1) = !=3D + *(UsbNicInfo->MacAddress + IpmiLanMacAddressSize - 1)) ) { DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " MAC address is not matc= hed.\n")); @@ -962,6 +966,49 @@ UsbNicSearchUsbIo ( return EFI_NOT_FOUND; } =20 +/** + This function identifies if the USB NIC has MAC address and internet + protocol device path installed. (Only support IPv4) + + @param[in] UsbDevicePath USB device path. + + @retval EFI_SUCCESS Yes, this is IPv4 SNP handle + @retval EFI_NOT_FOUND No, this is not IPv4 SNP handle + +**/ +EFI_STATUS +IdentifyNetworkMessageDevicePath ( + IN EFI_DEVICE_PATH_PROTOCOL *UsbDevicePath + ) +{ + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + + DevicePath =3D UsbDevicePath; + while (TRUE) { + DevicePath =3D NextDevicePathNode (DevicePath); + if (IsDevicePathEnd (DevicePath)) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "MAC address device path is no= t found on this handle.\n")); + break; + } + + if ((DevicePath->Type =3D=3D MESSAGING_DEVICE_PATH) && (DevicePath->Su= bType =3D=3D MSG_MAC_ADDR_DP)) { + DevicePath =3D NextDevicePathNode (DevicePath); // Advance to next d= evice path protocol. + if (IsDevicePathEnd (DevicePath)) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "IPv4 device path is not fou= nd on this handle.\n")); + break; + } + + if ((DevicePath->Type =3D=3D MESSAGING_DEVICE_PATH) && (DevicePath->= SubType =3D=3D MSG_IPv4_DP)) { + return EFI_SUCCESS; + } + + break; + } + } + + return EFI_NOT_FOUND; +} + /** This function identifies if the USB NIC is exposed by BMC as the host-BMC channel. @@ -1025,7 +1072,7 @@ IdentifyUsbNicBmcChannel ( (VOID *)&Snp->Mode->CurrentAddress, BmcUsbNic->MacAddressSize ); - DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " MAC address (in size %d) for = this SNP instance:\n ", BmcUsbNic->MacAddressSize)); + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " MAC address (in size %d) for = this SNP instance:\n", BmcUsbNic->MacAddressSize)); for (Index =3D 0; Index < BmcUsbNic->MacAddressSize; Index++) { DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "%02x ", *(BmcUsbNic->MacAddress= + Index))); } @@ -1068,7 +1115,8 @@ CheckBmcUsbNicOnHandles ( UINTN Index; EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; - BOOLEAN GotOneUsbNIc; + BOOLEAN GotBmcUsbNic; + CHAR16 *DevicePathStr; =20 if ((HandleNumer =3D=3D 0) || (HandleBuffer =3D=3D NULL)) { return EFI_INVALID_PARAMETER; @@ -1076,26 +1124,37 @@ CheckBmcUsbNicOnHandles ( =20 DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry, #%d SNP handle\n", __func__, Ha= ndleNumer)); =20 - GotOneUsbNIc =3D FALSE; + GotBmcUsbNic =3D FALSE; for (Index =3D 0; Index < HandleNumer; Index++) { + DEBUG ((DEBUG_MANAGEABILITY, " Locate device path on handle 0x%08x\= n", *(HandleBuffer + Index))); Status =3D gBS->HandleProtocol ( *(HandleBuffer + Index), &gEfiDevicePathProtocolGuid, (VOID **)&DevicePath ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, " Failed to locate SNP on %d handle.\n", Ind= ex)); + DEBUG ((DEBUG_ERROR, " Failed to locate device path on %d handle.= \n", __func__, Index)); continue; } =20 + DevicePathStr =3D ConvertDevicePathToText (DevicePath, FALSE, FALSE); + if (DevicePathStr !=3D NULL) { + DEBUG ((DEBUG_MANAGEABILITY, " Device path: %s\n", DevicePathStr)= ); + FreePool (DevicePathStr); + } + // Check if this is an BMC exposed USB NIC device. while (TRUE) { if ((DevicePath->Type =3D=3D MESSAGING_DEVICE_PATH) && (DevicePath->= SubType =3D=3D MSG_USB_DP)) { - Status =3D IdentifyUsbNicBmcChannel (*(HandleBuffer + Index), Devi= cePath); + Status =3D IdentifyNetworkMessageDevicePath (DevicePath); if (!EFI_ERROR (Status)) { - GotOneUsbNIc =3D TRUE; - break; + Status =3D IdentifyUsbNicBmcChannel (*(HandleBuffer + Index), De= vicePath); + if (!EFI_ERROR (Status)) { + GotBmcUsbNic =3D TRUE; + } } + + break; // Advance to next SNP handle. } =20 DevicePath =3D NextDevicePathNode (DevicePath); @@ -1105,10 +1164,11 @@ CheckBmcUsbNicOnHandles ( } } =20 - if (GotOneUsbNIc) { + if (GotBmcUsbNic) { return EFI_SUCCESS; } =20 + DEBUG ((DEBUG_MANAGEABILITY, "No BMC USB NIC found on SNP handles\n")); return EFI_NOT_FOUND; } =20 @@ -1139,62 +1199,70 @@ CheckBmcUsbNic ( =20 DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry, the registration key - 0x%08x.\= n", __func__, Registration)); =20 - Handle =3D NULL; - Status =3D EFI_SUCCESS; - BufferSize =3D 0; + Handle =3D NULL; + Status =3D EFI_SUCCESS; =20 - Status =3D gBS->LocateHandle ( - Registration =3D=3D NULL ? ByProtocol : ByRegisterNotify, - &gEfiSimpleNetworkProtocolGuid, - Registration, - &BufferSize, - NULL - ); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " %d SNP protocol instances.\= n", BufferSize/sizeof (EFI_HANDLE))); - HandleBuffer =3D AllocateZeroPool (BufferSize); - if (HandleBuffer =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, " Falied to allocate buffer for the handles.= \n")); - return EFI_OUT_OF_RESOURCES; - } + do { + BufferSize =3D 0; + Status =3D gBS->LocateHandle ( + Registration =3D=3D NULL ? ByProtocol : ByRegister= Notify, + &gEfiSimpleNetworkProtocolGuid, + Registration, + &BufferSize, + NULL + ); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " %d SNP protocol instance(= s).\n", BufferSize/sizeof (EFI_HANDLE))); + HandleBuffer =3D AllocateZeroPool (BufferSize); + if (HandleBuffer =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, " Falied to allocate buffer for the handle= s.\n")); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D gBS->LocateHandle ( + Registration =3D=3D NULL ? ByProtocol : ByRegisterNo= tify, + &gEfiSimpleNetworkProtocolGuid, + Registration, + &BufferSize, + HandleBuffer + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, " Falied to locate SNP protocol handles.\n= ")); + FreePool (HandleBuffer); + return Status; + } + } else if (EFI_ERROR (Status)) { + if (Registration !=3D NULL) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " No more newly installed= SNP protocol for this registration - %r.\n", Status)); + return EFI_SUCCESS; + } =20 - Status =3D gBS->LocateHandle ( - Registration =3D=3D NULL ? ByProtocol : ByRegisterNoti= fy, - &gEfiSimpleNetworkProtocolGuid, - Registration, - &BufferSize, - HandleBuffer - ); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, " Falied to locate SNP protocol handles.\n")= ); - FreePool (HandleBuffer); return Status; } - } else if (EFI_ERROR (Status)) { - return Status; - } =20 - // Check USB NIC on handles. - Status =3D CheckBmcUsbNicOnHandles (BufferSize/sizeof (EFI_HANDLE), Hand= leBuffer); - if (!EFI_ERROR (Status)) { - // Retrieve the rest of BMC USB NIC information for Redfish over IP in= formation - // and USB Network Interface V2. - Status =3D RetrievedBmcUsbNicInfo (); + // Check USB NIC on handles. + Status =3D CheckBmcUsbNicOnHandles (BufferSize/sizeof (EFI_HANDLE), Ha= ndleBuffer); if (!EFI_ERROR (Status)) { - DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " Install protocol to notif= y the platform Redfish Host Interface information is ready.\n")); - Status =3D gBS->InstallProtocolInterface ( - &Handle, - &mPlatformHostInterfaceBmcUsbNicReadinessGuid, - EFI_NATIVE_INTERFACE, - NULL - ); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, " Install protocol fail %r.\n", Status)); + // Retrieve the rest of BMC USB NIC information for Redfish over IP = information + // and USB Network Interface V2. + Status =3D RetrievedBmcUsbNicInfo (); + if (!EFI_ERROR (Status)) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " Install protocol to not= ify the platform Redfish Host Interface information is ready.\n")); + Status =3D gBS->InstallProtocolInterface ( + &Handle, + &mPlatformHostInterfaceBmcUsbNicReadinessGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, " Install protocol fail %r.\n", Status)); + } } } - } =20 - FreePool (HandleBuffer); + FreePool (HandleBuffer); + } while (Registration !=3D NULL); + return Status; } =20 --=20 2.37.1.windows.1 -=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 (#111656): https://edk2.groups.io/g/devel/message/111656 Mute This Topic: https://groups.io/mt/102763117/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111657+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700722087264929.3861974231696; Wed, 22 Nov 2023 22:48:07 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=ZX1XzEtVkZYkQ2yzTXg9NsULbFYuLKrBPi4t53juLOE=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722086; v=1; b=GEdzQ+uTU8dc2mbdSIiuU6g1mecsQvTLwbXFTEXCQPf+vJKCbCz9j5UZGB8K62lhU9GUTRmX E1fRVQYuRozKgL1Rq2hlMLEz6gqzMFsCa/2UGtHlTEkIxXwSbwvQETgBCgENNwZQT2uwTcqrOhC RUktGPqZs00jbzFRPr2naSYI= X-Received: by 127.0.0.2 with SMTP id 3qGnYY1788612xLOcJfavWGH; Wed, 22 Nov 2023 22:48:06 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.70]) by mx.groups.io with SMTP id smtpd.web11.86152.1700722086306867661 for ; Wed, 22 Nov 2023 22:48:06 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVaA7rV5SCsBQvIIqiGV9QoQCEkMgg6crx2U3c6s6WKBHcJ6DDBOGunH1FKx1O8nD9+EleqVaS1f875x36K/nsyVFQPROVYtAYWEorGQzsSGW15VJzJzaTHuLsSIJyod3qCnMPiXiK22CnjfqFlYuXbK3PUG1EJJ+pMI9TsaHwa/FlmLiNbGmepHJ/8j6raMbP5M1yD9bZO5RPp6HJEn9VmMAA7grk9WtlCNipYut3LC7UrGdzP1RBePIeDGos0rYRwrTSFUDjq0ZKCMBgsXLdaCCYvlL47Bj9i5xNxWqoApusD5utAswvv1xZyUNUIX6sLWuZFN0fFxUEfrP2WEdg== 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=LKMJTk2sepOJe2W+QgC6ewF5eEvLMWNUugeWDVwZ/3o=; b=WcuhyfCsE1zkh2XrL9Cd/Zj4Fmc9KXzqTP5QEiQDt5/wtsZvGTBh//wI/uR3eKK/Lx8SLgm072w/67nZ0TU6T16Bw/FLspmccd6LQgA5cZt5qDyAL+21Qr+2iWjbX6ymrMQJ4571Y9IvxdA4Rl0gptkG932wT2JvjRwE9vJW3NSfpk8KKYm2KyqWEGvXvNJpWh7mxIvOCPRboaOHJy7zetVD98ztnShPBO5PSsA8g/PgAK59k3hegFU/V1u6DTnqH99GVZ/LVh+LjQyhmFgqP3XslZQqBVkKdK76yqH98ynlZDVg0XcvZXckaTBUK1Y3++W1OUJVXkcBpcJrzu2H5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from CH0P220CA0006.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::27) by LV3PR12MB9188.namprd12.prod.outlook.com (2603:10b6:408:19b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Thu, 23 Nov 2023 06:48:04 +0000 X-Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:610:ef:cafe::be) by CH0P220CA0006.outlook.office365.com (2603:10b6:610:ef::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19 via Frontend Transport; Thu, 23 Nov 2023 06:48:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111657+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:48:03 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:47:35 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 2/8] RedfishPkg/RedfishHostInterfaceDxe: Add Redfish HI readiness notification Date: Thu, 23 Nov 2023 14:47:12 +0800 Message-ID: <20231123064719.1248-3-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|LV3PR12MB9188:EE_ X-MS-Office365-Filtering-Correlation-Id: b8da84a4-d466-4853-f7c4-08dbebf02447 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: c/YlNKxEdDxGYEZk5+46QfX/+9F0hn1fVOpPvQEM3d8qeyfRbM1JefDaL7iezpbd0254YvcqJMrjKMgzntAbJLNOJAqoyE6xrtrh+0dsg38AECZHZF5tS2WxpjZ1PxzqoFpSq6fTmGEYjhM/U1zlgM1SLdhHs3wyq74urIdklydKmG1tfgtQkBscR6UjgegrMdvCB18pboLcXYDhMhG5BactI43Fan3qP1meHOBpB7plQAaM/LmPcl3dncLdBvftz5eP3Qusw3WCCy/JNqvTR+puvsJ2qc26hbDZMpEXzf/CEYWoLnIKol4Hv1NhAM5sNdqqn5ej69DWRxRVVQrMqL84hiPonub12ohfncOKHhFZB+ryE89TQHMruVYI5WBZss+epaTmGM3iTKn3036kXFlEEYVRGO4KR74E83xt8EYDuIkIXzd7IMNmnQf2HBkWCRCwKVL5JjboL7QayQAVIfI/Edjv/HyIAZWpJsrsV5iJPqaY0RzbhAfQddIFjQmlpQDOenOfK9w8t9PkuddULjqkEj7uFJI2Sd0vm/vAApIrnVMrkG4x5KqJ8HsyXQBuAn2cgYh0Ois47OQxDzgpIkTyXeYzCJj9DpCETBt0NTCG1azHLArrYjaEKkqcfOiswAZO/7Coai+IIJSnvtIScE8W/qDFcX42iNfr+8m13TAc0qHB0RndBxufxcnm4GEHOttbjX8UQX5u2VCdKikjMBeaSqAIlT+D5RXtnSXp+ZuoA+NVeU0hDli0UOj+jyydxf4FxdTTOKQsNaBy5drYxg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:48:03.5025 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8da84a4-d466-4853-f7c4-08dbebf02447 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9188 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: OkEa05h9jgkJMVJvhwE28Z3yx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722087676100001 Content-Type: text/plain; charset="utf-8" From: Abner Chang Introduce gEdkIIRedfishHostInterfaceReadyProtocolGuid and produce it when Redfish Host Interface is installed on system. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- RedfishPkg/RedfishPkg.dec | 3 +++ .../RedfishHostInterfaceDxe.inf | 3 ++- .../RedfishHostInterfaceDxe.c | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index 0f18865cea0..e40538247c2 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -90,6 +90,9 @@ ## Include/Protocol/EdkIIRedfishPlatformConfig.h gEdkIIRedfishPlatformConfigProtocolGuid =3D { 0X4D94A7C7, 0X4CE4, 0X4A84= , { 0X88, 0XC1, 0X33, 0X0C, 0XD4, 0XA3, 0X47, 0X67 } } =20 + # Redfish Host Interface ready notification protocol + gEdkIIRedfishHostInterfaceReadyProtocolGuid =3D { 0xC3F6D062, 0x3D38, 0x= 4EA4, { 0x92, 0xB1, 0xE8, 0xF8, 0x02, 0x27, 0x63, 0xDF } } + [Guids] gEfiRedfishPkgTokenSpaceGuid =3D { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x= 88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} =20 diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf= b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf index 1cdae149aad..f969e75463f 100644 --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf @@ -43,7 +43,8 @@ UefiLib =20 [Protocols] - gEfiSmbiosProtocolGuid ## TO_START + gEfiSmbiosProtocolGuid ## TO_START + gEdkIIRedfishHostInterfaceReadyProtocolGuid ## PRODUCED =20 [Depex] gEfiSmbiosProtocolGuid diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b= /RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c index 55a66decfc8..94c0f9b6a92 100644 --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c @@ -53,7 +53,9 @@ RedfishCreateSmbiosTable42 ( SMBIOS_TABLE_TYPE42 *Type42Record; EFI_SMBIOS_PROTOCOL *Smbios; EFI_SMBIOS_HANDLE MemArrayMappedAddrSmbiosHandle; + EFI_HANDLE Handle; =20 + Handle =3D NULL; // // Get platform Redfish host interface device type descriptor data. // @@ -228,6 +230,20 @@ RedfishCreateSmbiosTable42 ( =20 Status =3D EFI_SUCCESS; =20 + // + // Install Redfish Host Interface ready protocol. + // + Status =3D gBS->InstallProtocolInterface ( + &Handle, + &gEdkIIRedfishHostInterfaceReadyProtocolGuid, + EFI_NATIVE_INTERFACE, + (VOID *)NULL + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to install gEdkIIRedfishHostInterfaceRead= yProtocolGuid.\n")); + DEBUG ((DEBUG_ERROR, "PlatformConfigHandler driver may not be triggere= d to acquire Redfish service.\n")); + } + ON_EXIT: if (DeviceDescriptor !=3D NULL) { FreePool (DeviceDescriptor); --=20 2.37.1.windows.1 -=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 (#111657): https://edk2.groups.io/g/devel/message/111657 Mute This Topic: https://groups.io/mt/102763119/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111663+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700722104236634.3752581378908; Wed, 22 Nov 2023 22:48:24 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=YioqptUP7fExjPf0FZxC0WpJnCoNeKECpiVhw+WXspU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722103; v=1; b=HYIsJu0PymcKkS70QtsnhM58uZlOi7jHYFRbg/4cMkfJpx0E4vNa86cEl6t/DcT0mO+qlrgQ Orm4B18nf/tLKe8mOaFuscI3Ka2981i5GVkLptdyN85DYsuasODVGh6H+bBEhaoBhV9g6R/BMmo adUuenJIVGzYc8NMHHz8jKjI= X-Received: by 127.0.0.2 with SMTP id TJA1YY1788612x5npG5AkCqN; Wed, 22 Nov 2023 22:48:23 -0800 X-Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.49]) by mx.groups.io with SMTP id smtpd.web11.86157.1700722103180417403 for ; Wed, 22 Nov 2023 22:48:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LpoTXg9o/K0NiU+WgYm53Crt/fTyHlK+vdQ+DCEC5KH74OVe4IfQrTM7ioRGrF1c/MxL4v8c7Fns2g/4nNddA/nHnOPhdp90H0hD8yZVjhv0tFduYhZ09nNuvZl3RtwzfwQtY/pLqokAaaLrSqkTdc57OXiS/45TslIfvbXX+Dp1KXPz4lmznJW7e14mfQJPdnRU9W1oSb9X77V75aroUrzMMBZ+8rCdHG3Y7nol8ZUMnIrZx/1m4Uu/9yiPQ1CpFs4v2b/CIcMLQUwq0Nu33+kJaQS564rKDlKmYci09QmpbKzTGKxCIsYLdd3gIjXUSEHC/8e/lFv0iOsNXyA7Sg== 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=CiZC5g7gHOhxRgr3I/UnVCz13d5a/iQhMcntQL1vkiI=; b=NHFMcEeUrQ5SCKlf5r1W/QEzrBjNQJkugWTjcwZ8hUp450AkdgJlM9DO81eHssyLq7A3cwjmvGA6KxF/MTnsljBdMKUx9edxCibkKPCmIBMbSHg8id5KlzchK5vAUZ5eG3JtS0t0ODh5BKh4H7wbXreEUk+Le9blAn15gFss+0AqUOQ8Rvt15naQ9RZGTqkSiPsyIwlgEo9uWJiC2quUA7kaNSxXeAKopUQoiyH6cNnNzpWStb42cK3I8xqSI5cU9RuEkFI+RuHHS8mHGNtlSH1LKA8VJV1opFyK4jJhprmZUmMoODua5xCM1vkZqdZDMWxVez3XI3k9H5bOfZamAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from CH0P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::34) by SA3PR12MB8437.namprd12.prod.outlook.com (2603:10b6:806:2f5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Thu, 23 Nov 2023 06:48:08 +0000 X-Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:610:ef:cafe::55) by CH0P220CA0017.outlook.office365.com (2603:10b6:610:ef::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20 via Frontend Transport; Thu, 23 Nov 2023 06:48:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111663+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:48:08 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:47:36 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 3/8] RedfishPkg/RedfishConfigHandler: Use Redfish HI readiness notification Date: Thu, 23 Nov 2023 14:47:13 +0800 Message-ID: <20231123064719.1248-4-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|SA3PR12MB8437:EE_ X-MS-Office365-Filtering-Correlation-Id: 56040479-64b7-4a0d-5d6b-08dbebf0271a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: raZy3hpQuTGje2uQ9Es3pDK2g4x8Qe893h3dva9vNcoX03l+vk+2KHyl11GdqZnlTnSeGGIjKdfpllWLFXxwNkHSeg5yjFtm7L1GHTRypaYVDWIyMOjN1kMl8JiBc/n0G9L0O/oWRodH/AMAYn25z9V5+EZ3t67yGYYtKtqhxDP30Cb14tXCNRGVzEkQwgYBr6Pbs0xGOGSxtGzEGESldbt/dUQoDoK71Ajuk7CU9xhl6aBvT+DcIq/+ryQglWqv/EPcsm+Wa6dGbu653C43uLbJCj1+DA4n9OdtOBrl1cwQFPFz9eFFAw+cLXfA+ZnUhdiE9YvrnDno9O5Hf7zdoEMO1ozS1NHpnUTCkZUVge4BImOSpwgxYnzuGdIJ2vop9n+yRiGIr2I6xHEoXQoDJX7N2m+Ofiy4VST1JpPVO0sinjKxJfuFMV+9bZhwIY2qKZO5aONv+CXAXmf4QwKJoLSjGy7/5bmMznygHn+LrpDVOlcEXAwNR0Z0U2008zfRc/A/lt1gxIns8IBBcMGAb8ZmfvNIj6gwyCD4O3QB6HukscW1El9lwWLBuHuld8xfAgu1eNCGAyaE0EDhfjAxc24sS05arhwqS9u28PvIxWWKwd1VrQf9JUtgtr521Sf4Csu3IeBVzM60QyFrdiMBfQhLk6dzJS+RUU0Uf0i1q4IFbM5MpMBsc2PiNR2Z6gQ6KjJUteGC0s/kgmHwmJ7ooRQ0jAYNns4fCrhMuDYg9lDLX+B+MUKIrnjOf5IMLcFIGgNt/XLjRM3JEJ1VGUV0CQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:48:08.2681 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56040479-64b7-4a0d-5d6b-08dbebf0271a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8437 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: x6oRq7I6qVonT3jrjU0P93hDx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722105660100001 Content-Type: text/plain; charset="utf-8" From: Abner Chang Wait until Redfish Host Interface is installed on the system then acquire Redfish service. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../RedfishConfigHandlerDriver.inf | 9 +- .../RedfishConfigHandlerDriver.c | 168 ++++++++++++------ 2 files changed, 116 insertions(+), 61 deletions(-) diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf= b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf index b167c6e1ee4..aed93f570cf 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf @@ -46,11 +46,12 @@ UefiDriverEntryPoint =20 [Protocols] - gEfiRedfishDiscoverProtocolGuid ## CONSUMES + gEfiRedfishDiscoverProtocolGuid ## CONSUMES gEfiRestExServiceBindingProtocolGuid - gEfiRestExProtocolGuid ## CONSUMES - gEdkIIRedfishCredentialProtocolGuid ## CONSUMES - gEdkIIRedfishConfigHandlerProtocolGuid ## CONSUMES + gEfiRestExProtocolGuid ## CONSUMES + gEdkIIRedfishCredentialProtocolGuid ## CONSUMES + gEdkIIRedfishConfigHandlerProtocolGuid ## CONSUMES + gEdkIIRedfishHostInterfaceReadyProtocolGuid ## CONSUMES =20 [Guids] gEfiEventExitBootServicesGuid ## CONSUMES ## Event diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c b= /RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c index f987cc67a69..b421f51374d 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c @@ -17,11 +17,15 @@ EFI_EVENT gEfiRedfishDiscoverProtocolEvent =3D NULL; // // Variables for using RFI Redfish Discover Protocol // -VOID *gEfiRedfishDiscoverRegistration; -EFI_HANDLE gEfiRedfishDiscoverControllerHandle =3D NUL= L; -EFI_REDFISH_DISCOVER_PROTOCOL *gEfiRedfishDiscoverProtocol =3D NUL= L; -BOOLEAN gRedfishDiscoverActivated =3D FAL= SE; -BOOLEAN gRedfishServiceDiscovered =3D FAL= SE; +VOID *gEfiRedfishDiscoverRegistration; +EFI_HANDLE gEfiRedfishDiscoverControllerHandl= e =3D NULL; +EFI_REDFISH_DISCOVER_PROTOCOL *gEfiRedfishDiscoverProtocol = =3D NULL; +BOOLEAN gRedfishDiscoverActivated = =3D FALSE; +BOOLEAN gRedfishServiceDiscovered = =3D FALSE; +EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *mNetworkInterfaces = =3D NULL; +UINTN mNumberOfNetworkInterfaces; +EFI_EVENT mEdkIIRedfishHostInterfaceReadyEve= nt; +VOID *mEdkIIRedfishHostInterfaceRegistr= ation; =20 /// /// Driver Binding Protocol instance @@ -339,6 +343,83 @@ RedfishServiceDiscoveredCallback ( FreePool (RedfishDiscoveredToken); } =20 +/** + Callback function executed when the gEdkIIRedfishHostInterfaceReadyProto= colGuid + protocol interface is installed. + + @param[in] Event Event whose notification function is being invoked. + @param[in] Context Pointer to the Context buffer + +**/ +VOID +EFIAPI +AcquireRedfishServiceOnNetworkInterfaceCallback ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *ThisNetworkInterface; + UINTN NetworkInterfaceIndex; + EFI_REDFISH_DISCOVERED_TOKEN *ThisRedfishDiscoveredToken; + + ThisNetworkInterface =3D mNetworkInterfaces; + // + // Loop to discover Redfish service on each network interface. + // + for (NetworkInterfaceIndex =3D 0; NetworkInterfaceIndex < mNumberOfNetwo= rkInterfaces; NetworkInterfaceIndex++) { + ThisRedfishDiscoveredToken =3D (EFI_REDFISH_DISCOVERED_TOKEN *)Allocat= eZeroPool (sizeof (EFI_REDFISH_DISCOVERED_TOKEN)); + if (ThisRedfishDiscoveredToken =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Not enough memory for EFI_REDFISH_DISCOVER= ED_TOKEN.\n", __func__)); + return; + } + + ThisRedfishDiscoveredToken->Signature =3D REDFISH_DISCOVER_TOKEN_SIGNA= TURE; + + // + // Initial this Redfish Discovered Token + // + Status =3D gBS->CreateEvent ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + RedfishServiceDiscoveredCallback, + (VOID *)ThisRedfishDiscoveredToken, + &ThisRedfishDiscoveredToken->Event + ); + if (EFI_ERROR (Status)) { + FreePool (ThisRedfishDiscoveredToken); + DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discove= red token.\n", __func__)); + return; + } + + // + // Acquire for Redfish service which is reported by + // Redfish Host Interface. + // + Status =3D gEfiRedfishDiscoverProtocol->AcquireRedfishService ( + gEfiRedfishDiscoverProtocol, + gRedfishConfigData.Image, + ThisNetworkInterface, + EFI_REDFISH_DISCOVER_HOST_INTE= RFACE, + ThisRedfishDiscoveredToken + ); + + // + // Free Redfish Discovered Token if Discover Instance was not created = and + // Redfish Service Discovered Callback event was not triggered. + // + if ((ThisRedfishDiscoveredToken->DiscoverList.NumberOfServiceFound =3D= =3D 0) || + EFI_ERROR (ThisRedfishDiscoveredToken->DiscoverList.RedfishInstanc= es->Status)) + { + gBS->CloseEvent (ThisRedfishDiscoveredToken->Event); + DEBUG ((DEBUG_ERROR, "%a: Free Redfish discovered token - %x.\n", __= func__, ThisRedfishDiscoveredToken)); + FreePool (ThisRedfishDiscoveredToken); + } + + ThisNetworkInterface++; + } +} + /** Callback function executed when the EFI_REDFISH_DISCOVER_PROTOCOL protocol interface is installed. @@ -354,13 +435,10 @@ RedfishDiscoverProtocolInstalled ( OUT VOID *Context ) { - EFI_STATUS Status; - UINTN BufferSize; - EFI_HANDLE HandleBuffer; - UINTN NetworkInterfaceIndex; - EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *ThisNetworkInterface; - EFI_REDFISH_DISCOVERED_TOKEN *ThisRedfishDiscoveredToken; - UINTN NumberOfNetworkInterfaces; + EFI_STATUS Status; + UINTN BufferSize; + EFI_HANDLE HandleBuffer; + VOID *RedfishHostInterfaceReadyProtocol; =20 DEBUG ((DEBUG_MANAGEABILITY, "%a: New network interface is installed on = system by EFI Redfish discover driver.\n", __func__)); =20 @@ -401,67 +479,43 @@ RedfishDiscoverProtocolInstalled ( Status =3D gEfiRedfishDiscoverProtocol->GetNetworkInterfaceList ( gEfiRedfishDiscoverProtocol, gRedfishConfigData.Image, - &NumberOfNetworkInterfaces, - &ThisNetworkInterface + &mNumberOfNetworkInterfaces, + &mNetworkInterfaces ); - if (EFI_ERROR (Status) || (NumberOfNetworkInterfaces =3D=3D 0)) { + if (EFI_ERROR (Status) || (mNumberOfNetworkInterfaces =3D=3D 0)) { DEBUG ((DEBUG_ERROR, "%a: No network interfaces found on the handle.\n= ", __func__)); return; } =20 // - // Loop to discover Redfish service on each network interface. + // Check if Redfish Host Interface is ready or not. // - for (NetworkInterfaceIndex =3D 0; NetworkInterfaceIndex < NumberOfNetwor= kInterfaces; NetworkInterfaceIndex++) { - ThisRedfishDiscoveredToken =3D (EFI_REDFISH_DISCOVERED_TOKEN *)Allocat= eZeroPool (sizeof (EFI_REDFISH_DISCOVERED_TOKEN)); - if (ThisRedfishDiscoveredToken =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: Not enough memory for EFI_REDFISH_DISCOVER= ED_TOKEN.\n", __func__)); - return; - } - - ThisRedfishDiscoveredToken->Signature =3D REDFISH_DISCOVER_TOKEN_SIGNA= TURE; - - // - // Initial this Redfish Discovered Token - // + Status =3D gBS->LocateProtocol (&gEdkIIRedfishHostInterfaceReadyProtocol= Guid, NULL, &RedfishHostInterfaceReadyProtocol); + if (!EFI_ERROR (Status)) { + // Acquire Redfish service; + AcquireRedfishServiceOnNetworkInterfaceCallback ((EFI_EVENT)NULL, (VOI= D *)NULL); + } else { Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - RedfishServiceDiscoveredCallback, - (VOID *)ThisRedfishDiscoveredToken, - &ThisRedfishDiscoveredToken->Event + AcquireRedfishServiceOnNetworkInterfaceCallback, + NULL, + &mEdkIIRedfishHostInterfaceReadyEvent ); if (EFI_ERROR (Status)) { - FreePool (ThisRedfishDiscoveredToken); - DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discove= red token.\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to create event for gEdkIIRedfishHo= stInterfaceReadyProtocolGuid installation.", __func__)); return; } =20 - // - // Acquire for Redfish service which is reported by - // Redfish Host Interface. - // - Status =3D gEfiRedfishDiscoverProtocol->AcquireRedfishService ( - gEfiRedfishDiscoverProtocol, - gRedfishConfigData.Image, - ThisNetworkInterface, - EFI_REDFISH_DISCOVER_HOST_INTE= RFACE, - ThisRedfishDiscoveredToken - ); - - // - // Free Redfish Discovered Token if Discover Instance was not created = and - // Redfish Service Discovered Callback event was not triggered. - // - if ((ThisRedfishDiscoveredToken->DiscoverList.NumberOfServiceFound =3D= =3D 0) || - EFI_ERROR (ThisRedfishDiscoveredToken->DiscoverList.RedfishInstanc= es->Status)) - { - gBS->CloseEvent (ThisRedfishDiscoveredToken->Event); - DEBUG ((DEBUG_ERROR, "%a: Free Redfish discovered token - %x.\n", __= func__, ThisRedfishDiscoveredToken)); - FreePool (ThisRedfishDiscoveredToken); + Status =3D gBS->RegisterProtocolNotify ( + &gEdkIIRedfishHostInterfaceReadyProtocolGuid, + mEdkIIRedfishHostInterfaceReadyEvent, + &mEdkIIRedfishHostInterfaceRegistration + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installatio= n of gEdkIIRedfishHostInterfaceReadyProtocolGuid.", __func__)); + return; } - - ThisNetworkInterface++; } =20 return; --=20 2.37.1.windows.1 -=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 (#111663): https://edk2.groups.io/g/devel/message/111663 Mute This Topic: https://groups.io/mt/102763126/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111658+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700722094123699.2266595747706; Wed, 22 Nov 2023 22:48:14 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=pSQTBuTtQNU42FMQJtzKUqDkd7qVjnCQz6CQsWHOeLg=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722093; v=1; b=Buhzy1bZGldI8bWWoJtrJewEJDam+yEy7UlJ6QWFJuS/mBTfm5ncU1NptasnqPXVgGoA5HUA 6FeSMl0v5VvpP9w2vjEFQhW06uWUlvmoBjVK+OaDrHupqmbJ3CKJpkJGmbFk2WjXdOuziwtwPDl eKvjVv7wgqAKok6xUwQTwSXU= X-Received: by 127.0.0.2 with SMTP id dms3YY1788612xiyHQlgYA55; Wed, 22 Nov 2023 22:48:13 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.49]) by mx.groups.io with SMTP id smtpd.web10.85903.1700722093090966702 for ; Wed, 22 Nov 2023 22:48:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GeF7TBu6mANYJXwPbeOHl3MpKKJcWyM2UiA1jWnueVvtg03BluP974onNweTQAGmS++Yp/awVo0Eh6Eew1RpxiAcm+a6wDaJbhKaYci+WpOJqUunGB210/DzRhMTdoxdGgU6naFCkeXJgtlTu9Q/GBLEXuPN87sc5EeQHvcqgj5JkD9dKGc2xS3wwTOeCaZkmiHBdDLDQAlqF+eZZgOXC2loE94yoz64C6PclGQkCFlwFj0tV5SHbH7mNKXTKGqaHaJK3NW+dhN0G74kFB2JSHhzdiJbKXFniWef8JBiDDbLZx/EchbSNeEzi9+KVdQkxzoAePWEGM6ykQqgTqh7Xg== 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=2lW1KQixu3udFkTCitX59dzjS1U7wdX/3O5HsHUzoq4=; b=kBB681CIRF2Z6x5C7pg4LQhdyEOsYSmMLr8X6w98gu1Kc37pI11JrLNGmlzoqzDnDZT+8mqYMyqpyFT+uWw8fNFvDljkYCI4KxKFCWR8odJBKyA63UtJBt4v+Eqjryji/zhlhdz//KmOYT+xO7FeHypL5gpFmjpCP7Mc6hip35KGTijV22mmeomjPX7gn3hs0sLK2CA2hnutIyg37Ms+94Ex0gRXdwHgWcXyQZnLpuUNdUO6+PAzv8ru+6vgqLMR0in+mxFd6yaiBuVUqaJBzS7AaJYFms93f8nKRL7KMXlGDR2MTkby4oSzwUxj0EF+MBFiiDKU9Ux9LqFkAorwvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from CH0P220CA0014.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::29) by IA1PR12MB8537.namprd12.prod.outlook.com (2603:10b6:208:453::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 06:48:10 +0000 X-Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:610:ef:cafe::e5) by CH0P220CA0014.outlook.office365.com (2603:10b6:610:ef::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19 via Frontend Transport; Thu, 23 Nov 2023 06:48:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111658+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:48:09 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:48:04 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 4/8] RedfishPkg/RedfishConfigHandler: Correct the prototype of callback function Date: Thu, 23 Nov 2023 14:47:14 +0800 Message-ID: <20231123064719.1248-5-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|IA1PR12MB8537:EE_ X-MS-Office365-Filtering-Correlation-Id: 40a78ddc-8cfa-4d85-b4dd-08dbebf027f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: vY4TrCKxuoVBUp4o9NLo3pltAcBGu91A2U8S/v+21ILQ9gZxev5C/diezc+0vf3rRWz8QTnjx3Ivw6vKFmzFhAiKjlGKUXerfK4ImUqL2EMLsqyKoDuiE8PAu50FROR8cJ/xhTgoklXOUX+CQHJlDB+YBCCGm8u5BV/1PRUYRdtdxvWiRWYoWveE25+zpC7CNvyt9IQEpokWx1wabW3tjEp+H49AsbRUcplkCJuHm405uxv3pNvBc7wue+UF8mbNidR6mgGuzVmm4qNA8JgPBOZg11hm5fF51PsYyEkH8bHpKcK5VcVv+WY068v6UZrIUBtWRccRetTXwSQpdUULqrsfypXh52/dnxfpDzAncKpZk8JxcwADl8RS8zGr3pI8Ci92/rBo3c15foYkTSJpuLsWMIVGedhutKPiuMAn4B0D5DauKwD/CnVwy0E52jA/x4o1KjxVUTy7FI9RejsL8rmnq75dMEXsNJ7EhD1ANB5hVkTTLDIJPKwrQ6Fyrd+qlatFiWyWYVIE7ymenwVvBmEv+feZ2F+I6BhttQ/l1q/yC6ei16DHvAxeV78jQauOpEoeXDcwJ7rfW3moSZIdu244SbV7c1Atpmcg10a6t000H7dgUH4j5FV3ATvIbIfs3yicWqaOQENNmbZ9IizzEz7yg9YHdDWdRYTsHN1h+8PYCL/0fFDPlUKsMZjgFDi1SJz0HKgEwllky/Qs3H6E1ucy74wtTwJbGx084jgzh40VAlO9gQpZMel8riKU7H/HGAL3ZQz6UTsIShGL/PYHig== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:48:09.6743 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40a78ddc-8cfa-4d85-b4dd-08dbebf027f5 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8537 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 6swdu6CYsJlmT0iAgyU7y7Ywx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722095525100001 Content-Type: text/plain; charset="utf-8" From: Abner Chang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c b= /RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c index b421f51374d..2d0170d8861 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c @@ -425,14 +425,14 @@ AcquireRedfishServiceOnNetworkInterfaceCallback ( protocol interface is installed. =20 @param[in] Event Event whose notification function is being invoked. - @param[out] Context Pointer to the Context buffer + @param[in] Context Pointer to the Context buffer =20 **/ VOID EFIAPI RedfishDiscoverProtocolInstalled ( IN EFI_EVENT Event, - OUT VOID *Context + IN VOID *Context ) { EFI_STATUS Status; --=20 2.37.1.windows.1 -=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 (#111658): https://edk2.groups.io/g/devel/message/111658 Mute This Topic: https://groups.io/mt/102763120/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111659+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700722096669418.3050664013158; Wed, 22 Nov 2023 22:48:16 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Tt5qLQ6zwvTYrT4nAcEZtuRoi/iae8NCm+klYZ8zC6k=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722096; v=1; b=PUefmuQzI+t3Ejn3sqYl19WLTTrk0804zpHvNf5sd5bu6gmjTMC7rpvWjP5qDNCSCXmNEBek J+9tNoIG8e5Mb2bTPVZ9FnT13U6ETZcF0j0P0/RCbrAKPiUiSY2ROPM0lL2FMSLU3sQKyEIhY+e gBlWlpolbKUitdV7fmHwR6Rs= X-Received: by 127.0.0.2 with SMTP id h2GsYY1788612xAEEYixzzYE; Wed, 22 Nov 2023 22:48:16 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.70]) by mx.groups.io with SMTP id smtpd.web11.86154.1700722095731676348 for ; Wed, 22 Nov 2023 22:48:15 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qd5Rig1Eu7vRpW/AwoNzMMSJbbZLzvQ6nU6OoTlaYRGuJW7SeW+yaDJM8LfpKP7Eat8+t55ZYWU35WHiC1OTFaDtYM2xfqEW6KzdGwe90JUdr3NlwHR/Fpw4CEjbU/piuoAJVq26sTd9SMZMYlVMg7aBwXLrXTOcl4SC7lPLUUJJhIWayh7fq/PiQJd6q5liwHmWanH8iDEnYxZoBhIue1LL3OvyskBISDU6gVom3NVzT7oX1b+m6qVu5drjs4WPTpIusSQ39lSNYtSYhusHuWi1FG0rksK9EF9gmOHEYo2gnGoSKcQTxuXaGLHgwheKuAaE0ykAg9pQSR24RPSJ5A== 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=tiHdGf9ep/V5QogIoZtU9+XlqO4FQ+BgFlpiN/fLm98=; b=GDuwwNMRnjVImjpSrnJCj3Uc+yFf2/igxt68/0dCKpoNecyeIeb/nwJPFUOgCnrjoyc4Y/Gat0yMBKyufZLqUx1WfGYnDHZBgeHVZGkteUUKv4f/XXRRlD3ysVtsQsr2u51hDcePdVWof2rKzsduPogbP31YMTnU6AcMBJ2PjAQhwWSX1kLh60uAdbw9oMOAyA0zR2UaC7GZWA1s6Prz/Np35RNQHGJ9sRv+9dQmOoBNonkqRmxuUA5ZzkTR0oo+BnzPbicUiUQwvNv6V9aksPLMFDvemTiFFoLSrvKCLEkA/Lyr+S46ARS3JA7pANwlpikMUzCY48bivr/BY5qQBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from CH0P220CA0003.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::31) by SJ2PR12MB8012.namprd12.prod.outlook.com (2603:10b6:a03:4c7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Thu, 23 Nov 2023 06:48:11 +0000 X-Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:610:ef:cafe::ec) by CH0P220CA0003.outlook.office365.com (2603:10b6:610:ef::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19 via Frontend Transport; Thu, 23 Nov 2023 06:48:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111659+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:48:10 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:48:06 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 5/8] RedfishPkg/RedfishDiscovery: Add more debug message Date: Thu, 23 Nov 2023 14:47:15 +0800 Message-ID: <20231123064719.1248-6-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|SJ2PR12MB8012:EE_ X-MS-Office365-Filtering-Correlation-Id: f75679fc-48ef-4616-110d-08dbebf02874 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: rTvs3QNDSaLuX3lE6Dxh2ZVgG+wnzRDaKTf2B+mvyqiFCbUEuxSTQro4dU1nGPwzhBGh+bRQBSCTSBMwTdw/5G0pXqV2ppBScPpzxyVLeE327d3jL3W5JEtsNYiIpbGAV3P3ItEn4GSjNE7ILxeCHr+KHjl39QdXdwtOhiTZmyyrgaNm7gDk+dS6C/O43+V3Lq0+iZ9RCLFm7pQbuKoHw84QUrrrwcMU1eSv0m0K3Hi4SumsXB9nIV1oLvsejcOHaKdrTug7EY1DSE7O4Y/cyv315yEdgQy4SMjMeBtQnNgkCxfVlAX+BF1OFJeFhqR4zMjwmRrcUY34cyAVf4vXjgCQDntYtJozBS4Yo106+zGLZTzBRcXLmHu3ntVkCnr6mpuAHoKLvT6TGKVXSUCT+G+0uXSlOjPDd/UMOYavne0IsHN0qVPoOY2o0TQuWlTP2mUTXuKv9w6KG3dq/k+7B15KoYExX1SQ1dpUBC5D5cvgR7/KK6jeW6/mlh/Lik8G4DQaBuYFq4P0fnNMRCLc3erTsFPoGLZ0iZmRJDBycIWoWdPlZIHyxjgj1/8gnkAhP71drTeFgXqQug1zEYghVDClwxc8EaRNM5gQxrjj8tyu0cUpwsFMgjQsYyMHB0UW1EPkvxvA2yjQAjK8aY3CII978sKckhsgSJ8UO6Nu7eqfSpJSm6cGujzB4w9PF64QfmxXG90JvnOzpQGjo7XETmL1yWUfTzPV/jrzf8wWw9y2G+vsERdL6tnAuSHQfdEZ0xOD+5F1RNjKSvAjihu1Gg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:48:10.4555 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f75679fc-48ef-4616-110d-08dbebf02874 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8012 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: M8nc04otf4vDarKVs6kzlXdOx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722097540100007 Content-Type: text/plain; charset="utf-8" From: Abner Chang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../RedfishDiscoverDxe/RedfishDiscoverDxe.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPk= g/RedfishDiscoverDxe/RedfishDiscoverDxe.c index 28ba2d3a9fc..833ae2b969f 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c @@ -603,6 +603,27 @@ DiscoverRedfishHostInterface ( } =20 if (MacCompareStatus !=3D 0) { + DEBUG ((DEBUG_ERROR, "%a: MAC address is not matched.\n", __func__)); + DEBUG (( + DEBUG_ERROR, + " NetworkInterface: %02x %02x %02x %02x %02x %02x.\n", + Instance->NetworkInterface->MacAddress.Addr[0], + Instance->NetworkInterface->MacAddress.Addr[1], + Instance->NetworkInterface->MacAddress.Addr[2], + Instance->NetworkInterface->MacAddress.Addr[3], + Instance->NetworkInterface->MacAddress.Addr[4], + Instance->NetworkInterface->MacAddress.Addr[5] + )); + DEBUG (( + DEBUG_ERROR, + " Redfish Host interface: %02x %02x %02x %02x %02x %02x.\n", + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[0], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[1], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[2], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[3], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[4], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[5] + )); return EFI_UNSUPPORTED; } =20 @@ -716,6 +737,8 @@ DiscoverRedfishHostInterface ( IsHttps ); } + } else { + DEBUG ((DEBUG_ERROR, "%a: RedfishGetHostInterfaceProtocolData is faile= d.\n", __func__)); } =20 return Status; --=20 2.37.1.windows.1 -=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 (#111659): https://edk2.groups.io/g/devel/message/111659 Mute This Topic: https://groups.io/mt/102763121/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111662+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700722098767907.6456583853901; Wed, 22 Nov 2023 22:48:18 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=YQ6xnQOh05pdwGoWD0TXUQvLuAJGFhdx6yCkfCtGOmA=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722098; v=1; b=D3U1i+u+GGOJu+Fs22kyCjsbZBBwqtYQmElC2CnwBelJnpTEv9b9+MOh0KBXeXfbQtVhYWWa BNm/4HgVS3e8oMyzArGtfugUWIPdpVQPhRp0Dx2g3PWc7129Huzq21oBt0VbXk8PSBA3AO0FVb/ C4x5xSFINm95TebTBd37srk8= X-Received: by 127.0.0.2 with SMTP id MqmAYY1788612xkNNEqaPs0q; Wed, 22 Nov 2023 22:48:18 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.51]) by mx.groups.io with SMTP id smtpd.web11.86155.1700722097770600370 for ; Wed, 22 Nov 2023 22:48:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nF0rhBu38eXZ3xBz6211wxdkbmPjxIeIZAuaGeIb/7AhoGfrI1ENYa+HYLtIz+7ZFyXCX2ggNsdbl0synW/vQLKLNg5ajkXvX4o9HlYEx+I2UFjQiAB0SG+9tLD9w2vecbKHSjoRO4TTBE9/8ntc0/rayYj8+3NBuDiPXmdweLhIRdcrX2/X1vjMZTUVBc2Q4mRfno5TCLOx2l5m0iyMVGHVCqXun8m8wRtWNUr+ntYngkzAkAwztqeeR8MJEpv1vdkLz4iV7hZJSHJfSLEFWJfUnCzV5Ql/jQV7q6KaRbMf5Qp5gpv7jDpmYltqoVBeeJ7welZHOeHWqcWOk0Y2ew== 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=+RBfbNXnAX9ZF54r68/ys7DVXUHO72MsJoh15v2+Mi0=; b=Hj7x9ywibUUJilIaNvsmJswCBHhljXsxIRVAlnaUDwDlJABkw4UUggJ55W5pBs1av41AjElzm3hXETY87tsJUfWL4RRONSVNBoa32swcU4d9DGxPfHGRRU9ZIVhs87AOa0kahpDnpTe0BeFKgzYfVv3kGJ06ht4KWeREI2ioHUfzYRDydHsrTMVdBOd77sXNqzGXvUXhlUlJnIO1Ra9y2cShGWw2kuUMKjZ+hCgk03FAThDUhbsnDxi23jnc4VCaSDSNN/nl9nKF8QJpzrDqoR537nUJSqrafnNazstSzJ6ENy72OtEzSmJorcJb9xkTpOlgaT8k2YGXElQ0rCtYaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from DM6PR07CA0046.namprd07.prod.outlook.com (2603:10b6:5:74::23) by CH3PR12MB9121.namprd12.prod.outlook.com (2603:10b6:610:1a1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19; Thu, 23 Nov 2023 06:48:13 +0000 X-Received: from DS1PEPF00017094.namprd03.prod.outlook.com (2603:10b6:5:74:cafe::51) by DM6PR07CA0046.outlook.office365.com (2603:10b6:5:74::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18 via Frontend Transport; Thu, 23 Nov 2023 06:48:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111662+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017094.mail.protection.outlook.com (10.167.17.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:48:13 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:48:07 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 6/8] RedfishPkg/RedfishDiscovery: Refine SMBIOS 42h code Date: Thu, 23 Nov 2023 14:47:16 +0800 Message-ID: <20231123064719.1248-7-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017094:EE_|CH3PR12MB9121:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e9260a8-ab16-48e9-99d8-08dbebf02a0b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: FzIU9o/pWnuqYTJI56bHXMAp9kI5pwv7m2gUuOsEmuew5Al3sQUNTAj3bMbEjPT68jFspl0f+BooqOFIUKffskIbGMVFRhL4VYaWG33pDORc5AR4bY++xlMzPMypS8V/Bl+A95xP8jcYDQ7JIqgnZV5xDJ1cfXB+dgdt5bqC8aAgFfFkJ42zD86NRSheaSAg8ghYrJ1TovcLP26oICMGrQ9yRH5KFKnAJ7QUM7PkQKBKJJxh5AFUg6nK92rJJJsUoMaG6PlwHRsv7Ej+aMHOjMy21h0vLPq3tMsbJskIlItYQJesnZzF4L5xcxPDP9qeU3ZskqfKWT7cNOkNTV0EqKU4BM/LQ5tAsGbg+nayJi0c05YCNyIJWq9uIJTgkIqWj74wxIg00lj6Rpk4EV0iIqUtP6Wf0+3wtnMsfwCEaiVhJgry5nwSpfPuSgBx28T0d+jsFjDQC5mxhZrHBwdviGBd2DXRLr+hA9LFeV4i963AMkjMluoygPpDkfNVpjiv9KJN8INEd6+QRPNMne812mYKtIns5aGzuGZEOQ+qQGXRTljhX8pqWZohhPOlso4OKWhLamkXBnie+6dxuYxuJrWM2eAQEDaLeI2Z66GfVPyEXSUlZykh/6FLE4KGM5+010c3M2G8BaQBXRpmjk4dg/6UqECqlNNlCmBAfUZFNqDGjeQuHA1LDpGf+pNED93AVdYD7jG5dQvALdm8YmGR8xhlOeXaVHghXWZJvrg0vgss9A7GYf0ixFsvtIBcnyClX0pkQlpkrnOci/e5wMLnzmjmiVRzyo4+RGOKcbU5+7E= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:48:13.1263 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e9260a8-ab16-48e9-99d8-08dbebf02a0b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017094.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9121 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 5Mhi6ViNH2EyJgOT4TVtITh8x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722099601100014 Content-Type: text/plain; charset="utf-8" From: Abner Chang Refine SMBIOS 42h code add mode debug message for the error conditions. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../RedfishDiscoverInternal.h | 2 ++ .../RedfishSmbiosHostInterface.c | 20 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h b/Redf= ishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h index e27cfa76e39..de7faa4f975 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h @@ -42,6 +42,8 @@ #define MAC_COMPARE(This, Target) (CompareMem ((VOID *)&(This)->MacAddres= s, &(Target)->MacAddress, (This)->HwAddressSize) =3D=3D 0) #define VALID_TCP6(Target, This) ((Target)->IsIpv6 && ((This)->NetworkPr= otocolType =3D=3D ProtocolTypeTcp6)) #define VALID_TCP4(Target, This) (!(Target)->IsIpv6 && ((This)->NetworkP= rotocolType =3D=3D ProtocolTypeTcp4)) +#define REDFISH_HI_ITERFACE_SPECIFIC_DATA_LENGTH_OFFSET ((UINT16)(UINTN)(= &((SMBIOS_TABLE_TYPE42 *)0)->InterfaceTypeSpecificDataLength)) +#define REDFISH_HI_PROTOCOL_HOSTNAME_LENGTH_OFFSET ((UINT16)(UINTN)(= &((REDFISH_OVER_IP_PROTOCOL_DATA *)0)->RedfishServiceHostnameLength)) =20 // // GUID definitions diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c b/R= edfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c index 0d6edc7dc35..57665f367be 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c @@ -56,7 +56,7 @@ RedfishGetHostInterfaceProtocolData ( mType42Record =3D (SMBIOS_TABLE_TYPE42 *)Record; if (mType42Record->InterfaceType =3D=3D MCHostInterfaceTypeNetworkHo= stInterface) { ASSERT (Record->Length >=3D 9); - Offset =3D 5; + Offset =3D REDFISH_HI_ITERFACE_SPECIFIC_DATA_LENGTH_OFFSET; RecordTmp =3D (UINT8 *)Record + Offset; // // Get interface specific data length. @@ -70,11 +70,13 @@ 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_PCI= E_V2) { + // According to Redfish Host Interface specification, add addi= tional one byte for Device Type field. 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 { + // According to Redfish Host Interface specification, add addi= tional one byte for Device Type field. if (SpecificDataLen !=3D sizeof (USB_INTERFACE_DEVICE_DESCRIPT= OR_V2) + 1) { ASSERT (SpecificDataLen =3D=3D sizeof (USB_INTERFACE_DEVICE_= DESCRIPTOR_V2) + 1); return EFI_VOLUME_CORRUPTED; @@ -105,7 +107,14 @@ RedfishGetHostInterfaceProtocolData ( // This SMBIOS record is invalid, if the length of protocol sp= ecific data for // Redfish Over IP protocol is wrong. // - if ((*(RecordTmp + 90) + sizeof (REDFISH_OVER_IP_PROTOCOL_DATA= ) - 1) !=3D ProtocolLength) { + if ((*(RecordTmp + REDFISH_HI_PROTOCOL_HOSTNAME_LENGTH_OFFSET)= + sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1) !=3D ProtocolLength) { + DEBUG (( + DEBUG_ERROR, + "%a: Length of protocol specific data is not match: %d != =3D ProtocolLength(%d).\n", + __func__, + *(RecordTmp + REDFISH_HI_PROTOCOL_HOSTNAME_LENGTH_OFFSET) = + sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1, + ProtocolLength + )); return EFI_SECURITY_VIOLATION; } =20 @@ -114,6 +123,13 @@ RedfishGetHostInterfaceProtocolData ( // This SMBIOS record is invalid, if the length is smaller tha= n the offset. // if (Offset > mType42Record->Hdr.Length) { + DEBUG (( + DEBUG_ERROR, + "%a: Offset (%d) > mType42Record->Hdr.Length (%d).\n", + __func__, + Offset, + mType42Record->Hdr.Length + )); return EFI_SECURITY_VIOLATION; } =20 --=20 2.37.1.windows.1 -=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 (#111662): https://edk2.groups.io/g/devel/message/111662 Mute This Topic: https://groups.io/mt/102763124/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111660+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 170072209704761.90527274151384; Wed, 22 Nov 2023 22:48:17 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=2dOzpJ5jqse0nfQu2mVuhojVgN9cZoLF7XuoHrGs/x0=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722096; v=1; b=cktCEHLkRmVEI70y8xPAqHo2WvKMIdwH2ypXrvh5rdwY6jNstIZZ8QVPRFKjzUmNB7j4Mc2j NvkLxL7uhuzXCmap/ZswCGdKhtGV/+aSwz/XP1nCnSul8dujp5QRgCt2noytvDcJcSpHhOl1PeA B8DpYYgGi/yUoxfclamFr/tg= X-Received: by 127.0.0.2 with SMTP id NhypYY1788612xJiFFAXRMYK; Wed, 22 Nov 2023 22:48:16 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.88]) by mx.groups.io with SMTP id smtpd.web10.85904.1700722096204409041 for ; Wed, 22 Nov 2023 22:48:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N3doKrXkNbb7O3HtzNVu16dnG4GSacE/0c1RP924G6Qu00ImTQ7NXk2mj76HaY6H0LViIDaBSzUMnmnSCtwUUhyFnNSwUSjXZctCn3Aj/wD5PWRfO2Ko0jafNxHUfzqDehudDd8QwlrBxx+DN6t2Y+Qur50u6s4X9qMVSxj+jMV0HhAjFeQ0WDlngRrq+7dzuZKCVEGpG8TCARGawJYRBhwQDB6MMJEaRDwMPnbTD7JymvkE2QtTgMUcX88iW1hQsTN5+I42QIYdCJ++B4V0qM/UGYaBRSp4KUVAv1Z/NohDDjHXYsjfFhMzn816ibYmOYYU+pLWhifgjNzU0P4+cw== 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=lhDK5LA13Dut23vRt+SbiMZPLJ8ro8ITDM5arVRum8Q=; b=PJC9twFU+6nvBxdkQewUG2QUzSzy1XfwCk0x56AseqzBhtpkCwB8kRODAF14EP7FM1N/qSVWe3iBCPXNagkx8o7rNJV3ZTalL/2w8nsNZ5LSfI7Nyz7ORvkH39jaLIhtVMOAfGk9DpAno4u/UYr4AW+ahJ7v+AXQ8rABdwmIFjOilTnw4SBytpGZ1fJhleoYjwMCZXU5TnYEEeirZpwX5o/0hjcsmGRhBGj8tSIc7OEYnW60XsPgUeBnyaR+iz/d6NlyvxFOo/vMrF+HmAZgRHCqUhNi9I96X9tSl9jC9h6Y67J0P2W6MdgnObfrnt2x9t4kWgAi0pxLbCxNhKcoYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from CH0P220CA0027.NAMP220.PROD.OUTLOOK.COM (2603:10b6:610:ef::21) by SN7PR12MB7131.namprd12.prod.outlook.com (2603:10b6:806:2a3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Thu, 23 Nov 2023 06:48:14 +0000 X-Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:610:ef:cafe::2e) by CH0P220CA0027.outlook.office365.com (2603:10b6:610:ef::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20 via Frontend Transport; Thu, 23 Nov 2023 06:48:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111660+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:48:13 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:48:09 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 7/8] RedfishPkg/HostInterfaceBmcUsbNic: Fix incorrect reference of MAC address pointer Date: Thu, 23 Nov 2023 14:47:17 +0800 Message-ID: <20231123064719.1248-8-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|SN7PR12MB7131:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e02ddf5-f24c-490c-aa49-08dbebf02a55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: n0g5Q1b5ihlVDpUpYSQ7j2+SfvcVLvbqoJSUqKja9Aa4zeVxsaElpXZVlRfhBc9CD10c5gCd4Gzh7x4EjyRxJ8BZpWcwpwkJauYjjZypstBA4fiY17q2NeOE2wiwR3Co2C52urHwt8JWB3Yz0w1DRuRzn8joYa0UZxteJZ5t8cWPvcWr7nwzM4O2mzRhMWJe1ucD2KlLbF4qbPRCmOAlTM3tZ2asvXVPWSJ1B/RoGXpyuj3vY53TILmYo0dpsO9c5sVDwnkcR1vNGpiGxx4WXiGDA0pxQeGbknBLhmAhLagCjTehI3wFVn1GHUmA7mTuQkcb3yRynjwwsyTJo2foWeL3lwBuB4lKTsmGMuwwCIf0qxXqqGZkDhpAb7KxMJWrGRsLSKgNrVgfg9muuG2+lyFHomFvavNycu9Syd96Lon9eDPNXYqqdBsbrc3FnZjlT+63xEhhOCSrQzKpeR4X7so75w+GsOyfhb7mONQHVQu41dzKw9iRbekXyQie5gnvj4lGspA6gYlgdflwfAzkGbWnUAqc+mr0pqc0Xv27N9EtfUo6w6Q/TAkWhqDef+iHG/IEAwZ0nL7DAr0a8V6gB000aUGeXUoACC/dS4+H/IFaECLUmy3YsbNNXhNRX/NxvuhBPmS7Y8Pp83mCVcqxhZ9ZTZmERm7XnCRAPIQm1Gv4CnWrZEfFUPbRbW6isMMQWQ2zeLb5Yhl9vLnYR2V8Q/LjdBPcIc19ISE5QMY6qOzL+CGLRkBbxASNK7nzhWO/1Wcrr6DJYAnwmRWKqBPASwtLelGIgb0t2dvyCdB3Ea4= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:48:13.5961 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e02ddf5-f24c-490c-aa49-08dbebf02a55 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7131 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: HrdPzP7SpghLhuMc9iRUW6EFx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722097516100005 Content-Type: text/plain; charset="utf-8" From: Abner Chang MAC address reference is incorrect when it is copied to Host Interface DeviceDescriptor. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../PlatformHostInterfaceBmcUsbNicLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformH= ostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsb= NicLib/PlatformHostInterfaceBmcUsbNicLib.c index e5bf70cfd58..c4a71226e63 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c @@ -120,7 +120,7 @@ RedfishPlatformHostInterfaceDeviceDescriptor ( InterfaceData->DeviceDescriptor.UsbDeviceV2.SerialNumberStr =3D 0; CopyMem ( (VOID *)&InterfaceData->DeviceDescriptor.UsbDeviceV2.MacAddress, - (VOID *)&ThisInstance->MacAddress, + (VOID *)ThisInstance->MacAddress, sizeof (InterfaceData->DeviceDescriptor.UsbDeviceV2.MacAddress) ); InterfaceData->DeviceDescriptor.UsbDeviceV2.Characteristics = |=3D (UINT16)ThisInstance->CredentialBootstrapping; --=20 2.37.1.windows.1 -=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 (#111660): https://edk2.groups.io/g/devel/message/111660 Mute This Topic: https://groups.io/mt/102763122/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 9 22:52:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111661+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700722097463697.2488595319091; Wed, 22 Nov 2023 22:48:17 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=KfehLMms3PR7cPFDTIhcj1It/uqXJLeGLVev+P4Hsnc=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1700722097; v=1; b=EsTc0UXECiFsQ1RUVHjJyRx/ALtjsyEF1F4AK/oV2Vqz+LddNCKaT85hxylD3ANXEpZo1aE4 jlM9sqaw792HaQo++PCKqdJtUMjlA7KU/vh8WkddUhaZmtnuSh7e9+FvXb8sd4p7Za1U4wawha+ h6QEejEq6A0PGyh4m1EQJDXQ= X-Received: by 127.0.0.2 with SMTP id bdCOYY1788612xFB0C639l0q; Wed, 22 Nov 2023 22:48:17 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web10.85905.1700722096517701727 for ; Wed, 22 Nov 2023 22:48:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OT2OjaTOYgmBfFF4c0o66sK1x9bTnybDOPr8Cm41Dpbu8tg36TMyCL3zwxdmqqXkyM4fv1sPr0mw/Yr5xjaBwEC+e7e4LWGX+lzHCXGyc4JfWFNKjvrmKeVBBJxsTNrW6QFB6FR41jqRbRw/pNI6XiP4+dzAr4tYF7KjJjmGMnY8NGz35yDcH4IxTsvEfmfll38vnvBlrtq+5wNNKH/GoRGqrIOPwvQDeaR6yLH2vA6gZV0s8eA6RZ+3z8Z/oqR7Eunpj5SNXWcP1hfXHc+7bajYOc8WzDJqjojoj6AkmPekOpbhDJHnJlWaeaV3QEybiJkBIZbvZ9CxnrQQMxvRXw== 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=ZNGE/E8DPxHY7ypxpAPE1BtIyFzv49eXI+C2+U/uBOc=; b=lmf3gVd+PZbTTx1Q5s1aiqEC8TM7ZCleQN5kKi7BMx2RiidoYYNyqSe8iFC8iSacEZeIXKU10aag1Ysy2OWh3tvlbRcuZbz9n/7WUlH6oPnTCfF2Q9tin0NHwZ21H5N+7oTh1AHZR7r7hfpFO+aI3Lfobgmbcea2IYig7+84AXBlQJbCRL3UQI+qftcm6JfXat58uZOlFeMpZpND6Cqrw+OYFUaPsIvG1HQeHRBhCC0JI4HU/ZGj6CP5aJO+tnC+jPwZ6hwnX6+uni421GKnbAJpQaKF3LvmlpcMuICiEdmac0qHWtmSPyJt/pLo3mfuLN37aRbfvsnrplEev6GTkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from DM6PR07CA0067.namprd07.prod.outlook.com (2603:10b6:5:74::44) by MN2PR12MB4112.namprd12.prod.outlook.com (2603:10b6:208:19a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 06:48:14 +0000 X-Received: from DS1PEPF00017094.namprd03.prod.outlook.com (2603:10b6:5:74:cafe::39) by DM6PR07CA0067.outlook.office365.com (2603:10b6:5:74::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19 via Frontend Transport; Thu, 23 Nov 2023 06:48:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111661+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017094.mail.protection.outlook.com (10.167.17.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 06:48:13 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Thu, 23 Nov 2023 00:48:11 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V2 8/8] RedfishPkg/HostInterfaceBmcUsbNic: Fix incorrect HI protocol record size Date: Thu, 23 Nov 2023 14:47:18 +0800 Message-ID: <20231123064719.1248-9-abner.chang@amd.com> In-Reply-To: <20231123064719.1248-1-abner.chang@amd.com> References: <20231123064719.1248-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017094:EE_|MN2PR12MB4112:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fd266bb-be4b-4825-3324-08dbebf02a66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: fMyT+xxUGvoYX/v572+NWKacIxol5yZEKZpX+XLS5J3WJdzIU4UJg4rOQltzqkLXofvUw39YjP9e2m5uyhiImdWcS+uzBBOeW9ONCIoxXxq/PU1N0lp1W68DLAFt3ahHP7WZEG6AwfaFpCoy93cNQyyYsiPijRweJ/Dw2CGL02V6j1I2CXN6DJU2kMsQvG/9nIj2o5TBTW11veHcjdLr4eFQdBFlqITrYn7GqVhBJJL5+S4aK1M1OVaXUAeSWUJeo1BKn5jw6IgqOGg6SPyZjX7LmlOXKhc+FqgmR+ZAdHN9/w/hFXf+KMAnZ2gUvf6yL7f+CVIazN3vSd684sV8Or2qRvbNMIEpb1Q+uTAnoGIQ4vY1owMbAsB8Ws6E5m3MrZwy6AoyixhXAdTFFb3JU8/QukhyVbVAx+YNfxhh740OB7m6pKXKXa/mn4UWw0MMHY4KFLlkj5JYxtdEE2B2E0XoeMlS+eYNob34ifCZi8VcttT0bninx1vsPOmSwz+uNbzayEfUMPGnfEKvsO8fKS2CVy/b52lrsljUFAHsoJ2aDKX/xPMRaXiWwt2FJcr8DcZm+wVb3e6H0q9kdiDWgnWMOPYFBQWwyubJHpTGNI1J0mS89GeQlSKRYunrwuW0tLljldMBSb6ozdeeITB4VN5IqOWU4GHXQ2HNzm+QjvSPxPThTRJ9w4u5oS00MbkgYBIXJ83/kpOaUjOV21+voRr4xS2TlR8nsqOgnNyEvqCVj8ZoYB6YXX/uf4QXz8nMrBsjrCfsxx9Hph2Lo/YSEsuF2mqgMXb8ebel1Q/tZ5Q= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:48:13.7045 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fd266bb-be4b-4825-3324-08dbebf02a66 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017094.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4112 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Yrvndj1BSezpf7NrBYeL9gMVx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700722099591100013 Content-Type: text/plain; charset="utf-8" From: Abner Chang The size of structure must be minus with byte that is occupied by the initial array. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../PlatformHostInterfaceBmcUsbNicLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformH= ostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsb= NicLib/PlatformHostInterfaceBmcUsbNicLib.c index c4a71226e63..a1ce2dd3d93 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c @@ -180,7 +180,7 @@ RedfishPlatformHostInterfaceProtocolData ( HostNameLength =3D (UINT8)AsciiStrSize (HostNameString); ThisProtocolRecord =3D (MC_HOST_INTERFACE_PROTOCOL_RECORD *)Allocate= ZeroPool ( sizeof (= MC_HOST_INTERFACE_PROTOCOL_RECORD) - 1 + - sizeof (= REDFISH_OVER_IP_PROTOCOL_DATA) + + sizeof (= REDFISH_OVER_IP_PROTOCOL_DATA) - 1 + HostName= Length ); if (ThisProtocolRecord =3D=3D NULL) { @@ -189,7 +189,7 @@ RedfishPlatformHostInterfaceProtocolData ( } =20 ThisProtocolRecord->ProtocolType =3D MCHostInterfaceProtocolT= ypeRedfishOverIP; - ThisProtocolRecord->ProtocolTypeDataLen =3D sizeof (REDFISH_OVER_IP_= PROTOCOL_DATA) + HostNameLength; + ThisProtocolRecord->ProtocolTypeDataLen =3D sizeof (REDFISH_OVER_IP_= PROTOCOL_DATA) -1 + HostNameLength; RedfishOverIpData =3D (REDFISH_OVER_IP_PROTOCO= L_DATA *)&ThisProtocolRecord->ProtocolTypeData[0]; // // Fill up REDFISH_OVER_IP_PROTOCOL_DATA --=20 2.37.1.windows.1 -=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 (#111661): https://edk2.groups.io/g/devel/message/111661 Mute This Topic: https://groups.io/mt/102763123/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-