From nobody Sat May 11 13:47:33 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+111719+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 1701063098858895.821198363854; Sun, 26 Nov 2023 21:31:38 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=V3v27/4A8jqtdm2ig80KTTr12KArDZQN04Us1NsrPd8=; 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=1701063098; v=1; b=G36n3BNnsBqmk7Y16DpdfMLo/FzlP5yESbV7jbhp6I8Vl1tTMhhHuFvV5/jVIi8vcTRD5B5q lx5lgloPbdBn8ZRz/kKKow4BL/qbCsnct9QvRh8XbZWCPp9/GwUhk7Abi4Bh6OhmKnA1e003Bvk NsSVhwGSpIjyqdDwFdYEGZog= X-Received: by 127.0.0.2 with SMTP id 5cnDYY1788612x1hkAq06YXA; Sun, 26 Nov 2023 21:31:38 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.86]) by mx.groups.io with SMTP id smtpd.web11.86856.1701063094359103060 for ; Sun, 26 Nov 2023 21:31:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJY6XJmlxzynk+LjbCvKdde7KWDni99GxPze4M4hkMyuJZ4SpRh0zH1TqMLHgLHQl03mr7blZen0JzauL8NN88COGHFL+E7MkUJeFIDGguY3sXqbavoKmxTJoR8K/eNXsQkG1nCsHkwjIF+/i+S7si+k7kl/4lfdATGR3jL+k7O5bbPp1ERsvNeLowahA8yB+amRLjUxcjUBXZ0HsO3K6bBvUwgkhcU2PMnckOPpL5r0Ioua0shYiJtFiovhk5V5CL26aXV8Lvsy0ENQucnlYT5hgndQX8wc27TMbI4CFI4OljLUAm2r5bBPnR3f9dizV4stf1mSdXiVlcBtdTyM8Q== 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=KalvMZrpZCM0T/lheUDodac/feE9lm4UnTVADyr8sXQ=; b=gqHRoNLAeX+FBjtyr4FnZkcpojA3lXoN3GVXEpXCQY9wFmUw7Cj+UUQiF8yXGiyoR5FSy42s5z/h19ORJQvYOg6q0mlHcFuvTw388S9BUML3TssGStftZRKHx+SsoM+bf/0mTQIrabqWtWyRSzFAKDkzwFoRyUEKmC+DokpNHXccG5hJ0twYELwjPWtJzMJ+Yqp8ejOENYDcI+KnuvxAT7XqfNwo8D2OXekbsTg9JzPKRoA0mJ5i6hRf6AeeKLVg09wnZggg3+nZ3dzQDHmzlW6PvSIUEyIhZght6oY6RBZ8b1OtTBTh/R6Te7zsPONu/rOAqqPAqgXmUU6EaBGcJA== 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 SA0PR11CA0065.namprd11.prod.outlook.com (2603:10b6:806:d2::10) by CY8PR12MB7337.namprd12.prod.outlook.com (2603:10b6:930:53::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:31 +0000 X-Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:d2:cafe::d1) by SA0PR11CA0065.outlook.office365.com (2603:10b6:806:d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 05:31:30 +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+111719+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 SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:30 +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; Sun, 26 Nov 2023 23:31:28 -0600 From: "Chang, Abner via groups.io" To: CC: Mike Maslenkin , Nickle Wang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V3 1/9] RedfishPkg/BmcUsbNicLib: Update BMC USB NIC searching algorithm Date: Mon, 27 Nov 2023 13:30:59 +0800 Message-ID: <20231127053107.1686-2-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|CY8PR12MB7337:EE_ X-MS-Office365-Filtering-Correlation-Id: 0be143c5-330b-4b64-47c9-08dbef0a1c38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 2j3JZCpKQeAU+ScE8OBEeGBSShdxmFGq7pOScwIdRU0h7NaaRerEP7zWFwJuNG/DZo0RIsa8eQtghWffDVn+60vnTOqpVInFIASZwFBib4QH1QFLmdyvwOyTK6r05U2AnBFWMEkfa2oYSKnnil5di7aol9FLWAgtV0L1tVJABtVvsM74YGI3Ojjgc4KV9KmQgTLIuJD9cGbqL2GukSyaz+t2IkJTdg1YdtU99ZJa7s4NgxfCizmNWkqqsvzBsEuNaGAxNYiea1vfF84JVVHnSuUXMGVK7KVAZuzmIV/LcvZoIFuskQQFRQqR5edLaG6hjoNy6xOtSp558thEmZWyVMLHnUAzNSZ2MOF5m/cWveQCSMVeB54NfNCLtL0hmbNcGnzZ/tLJbQnycakKRETMEL7MTRdbs+jhVIR1DbdPO0oQ9jGynxw0XDyT+vCe4wL3TTW6yCQ+jf3Tj+lwc2tE2s+R71WQeSr39U+wT3OHpfx24KdeiFwfuOS+Up1Qtk6pQLqocc7xY7hT5tKNV/kbgcSbA1JIkclOivjhOvJs3bqUgub2saoPJgOVkQbJ0PZeq6drF/G5C5t7B8RZndTEkOyBQPYTwWdJtMXGekjmtW5Da+8CheraCkYIKf/fewzHSGPhOceHJyqgGuAiFdTbgbR/P57JzO6pvJgGihJe9zLudkvLmkVYHRdaXSzWGYdkWQxgnsPlydH18/cfwMBEVAxXKkO8ePc6GGLr5PnmNtYyJTECCJCwIAti7yNWUAVYj3O3fbjJdZTslAN/DzM+ww== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:30.4594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0be143c5-330b-4b64-47c9-08dbef0a1c38 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: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7337 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: 682nlio9ogi6LHFMSHYvmeH5x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063100447000008 Content-Type: text/plain; charset="utf-8" From: Abner Chang Update BMC USB NIC searching algorithm for IPv4 only. Signed-off-by: Abner Chang Co-authored-by: Mike Maslenkin Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin Reviewed-by: Igor Kulchytskyy --- .../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 (#111719): https://edk2.groups.io/g/devel/message/111719 Mute This Topic: https://groups.io/mt/102824318/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 Sat May 11 13:47:33 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+111718+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 1701063098301616.479656321738; Sun, 26 Nov 2023 21:31:38 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=U8aVV+74b9ljXzufapfQ3xfoT2gBYsS0Dy6pF+8QQhw=; 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=1701063097; v=1; b=F1mULHCvGuJeHYQMxDuw/FKxaqFAWToKPDKQhUhXiUHN3L2zlFGq133ofSUJOMslvei7brlx Ah1SvFUw55l9eoJlyhXmHyI5k2ChehlNBbr/ATaDyYP+rifO0m/y+A6v2umGqkrMSAkGhGSg1TV qJADJOmp1Tw0wPqZC5PrKtZE= X-Received: by 127.0.0.2 with SMTP id zCUKYY1788612xNEgtq1wvVl; Sun, 26 Nov 2023 21:31:37 -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.87208.1701063096243799967 for ; Sun, 26 Nov 2023 21:31:36 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lUwIfngHbWVdpVpheBr6Rv5iJtv3jqoO3wnDATEBKcV1vaZttEWUKGgNayV2uRtg8yap+EYtH4EBlf2rxboI/HxDh8+tnB8grXqDxeiH5Dt7VT+yFilTYsaefzIXVPWCDHZcMcvfSFkg2wBKFEIESdWcu2s8JDS0+8rXPzxBk/TRiIr2JR87+alS/zDrPJ/hAbl0Usev8bJKg11Ky9JjmpI90aeQWdnwcevCYSUIknnOL3IxbCDnqLm1o2C66989wRZ4JMz0czRY2vlB+80z8el+D1xobPUaVo7K4BISQX1hB++JWb4J1z5Tu6+wy5WQuGdsSJVpoPj8E254QlJC3w== 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=wIzJQjWuHSGVFwH2vgJodik7cMiC4V64rR97ckw0eSQ=; b=mqGEiO3qkr91dbqfb7ANVW7zvd+v4gze6xjGTJd4Swe/pNjkxirVDjo4fyxnQAF8yzA9s14bcdOkyt3/htGn2o8He7MYfXB8a9BoRSugPpGzZkXoaRh1RJKqdLzMI606aG9dn5uu2v33cPbHHSGwmpofCz6hGtC9eJIYK0pyF3ehxy0Wnwj5Lx0N4+d470TSJn/Dn2ZWRr6R+6H9xLl4ug1+9IBkpLxt2k90T9elW0oukexGfUf9J0BUKxgO0oog2d4iFZRX5JTOXJK++fex6AeurtdKjW3t2q6hcqcShdhO9a3MwIy2riyUACv/xBbPNyXqnr2mhkp19N/925Xjew== 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 SA0PR11CA0065.namprd11.prod.outlook.com (2603:10b6:806:d2::10) by CY5PR12MB6321.namprd12.prod.outlook.com (2603:10b6:930:22::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:32 +0000 X-Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:806:d2:cafe::d1) by SA0PR11CA0065.outlook.office365.com (2603:10b6:806:d2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 05:31:32 +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+111718+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 SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:32 +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; Sun, 26 Nov 2023 23:31:30 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 2/9] RedfishPkg/RedfishHostInterfaceDxe: Add Redfish HI readiness notification Date: Mon, 27 Nov 2023 13:31:00 +0800 Message-ID: <20231127053107.1686-3-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA51:EE_|CY5PR12MB6321:EE_ X-MS-Office365-Filtering-Correlation-Id: b88daf3f-c211-4835-b3b3-08dbef0a1d26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: XHC8Vj0muGtfe3PYHU7CNgXtjhhOpz28AhqsDiBftJ6B+JJog3rf1p6yfOJrCRV9LWRlx9kOLBRT/V82tb7AgF5YJYiVSmMSKDbSYnblZs/rGXcuvMPuZNYJ6tHaVnfSSFzj3itWq0EA54LX0LVcm6AmN3jxGg2n56madE0Qx+pelJTa/C7BndKCAAtzm3IP0iOl46/Uat9FO2m85uw7+ICIwOP0uTvIaoRndYYBAso45ACvQfeLbLBOTx3cZXwjrLuVN61kdfE7p2EhzHlK8p1dhePCjIWipthFh2JxqcQbsu2t2cMoRSHMMVS8mw8vGjU5Qv+Rv1g4QikudCib14ViKg8EcOjZkXtDYLiKJWRkT/PL5Jb+y7bbuf9R70kcy4JDY1b2yRvJlilEettGu/3RxzZgCoa9yhugR+Yxfo2m2aiRrw81opOWBZN/arSpz9tv718/lKjVnPFgrU8aALIjurSfXE38n/kV66o9Wc0I0Vbu+mDQeMApHIeP7aJN2eJk0P3Pdt8W/22NsZQ/Ri7c8+bIuja0307ix08OQByymLsvNLfMMqWcGuKD6XxobdT2U0+9Qkp45+vB4Bl5ruX/w4eCCMLd2ciqhbMmu6FoS1KjmmI4kSK5SXG5GezZ8qKpVE240c6HOSuOc+trnskxpyBcT8ZPPi+24RJUj8ZYW8to7xBD8DhGQkkVUfHGlJMkcA9MUgyGC/+5cQ059ce2uO8LSqgt1CNlNOU83MCbF3OUYM8MP9berve9MElS0cysoTcUtpfWfaUbuLHItg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:32.0219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b88daf3f-c211-4835-b3b3-08dbef0a1d26 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: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6321 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: c1NmjystLVWdsiFqkMASfS8Lx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063100423000007 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 Reviewed-by: Nickle Wang --- RedfishPkg/RedfishPkg.dec | 3 +++ .../RedfishHostInterfaceDxe.inf | 3 ++- .../RedfishHostInterfaceDxe.c | 18 ++++++++++++++++++ 3 files changed, 23 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..02d5f14bd20 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. // @@ -226,6 +228,22 @@ RedfishCreateSmbiosTable42 ( goto ON_EXIT; } =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")); + } + + // Set Status to EFI_SUCCESS that indicates SMBIOS 42 record was install= ed + // on the platform sucessfully. Status =3D EFI_SUCCESS; =20 ON_EXIT: --=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 (#111718): https://edk2.groups.io/g/devel/message/111718 Mute This Topic: https://groups.io/mt/102824317/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 Sat May 11 13:47:33 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+111717+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 1701063097765175.47023239536134; Sun, 26 Nov 2023 21:31:37 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=1Sxk/FPv/RBXj+3NEuBncXajWMiD0BB1mv5CKhgONTM=; 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=1701063097; v=1; b=PUphl8hVzmhS2o2eB39qhwaqW0Mbj9Q6/eW2kYPkpeh7W3dqRVKlVIuqcXbnfBF5Pwac5apK 1AB3E5+au3hLuI1vqopFuPLfU6zU3QNdeVzmcrJgFaoEyBbOZX8eK2eB6t7QHx+z5UgoHhhM+ax X3aC5NpBNj9AlNGKPf6ydrSA= X-Received: by 127.0.0.2 with SMTP id 649fYY1788612x2rICJ15415; Sun, 26 Nov 2023 21:31:37 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.62]) by mx.groups.io with SMTP id smtpd.web10.87207.1701063096202118209 for ; Sun, 26 Nov 2023 21:31:36 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MrUCkutSYTi9I0+6WaGYk1XEVfxCF4roMj969NvOH2okjYXceGboJbAZlwJ3loT7kjTj8Z9C8yxsZhBIvsSsd2fCzG63cBJFNmqUlhNShdu5ZX6JFQLguPOkH+6reS3iOn5z+1uwe8hTjkmANflsTQdXZKSH1elytO3GHqHoy6mxmY8MIgm0PjCjVOrOFKjZyFmiHCdd+l9soIssSlcJ5sGJN7mifB97lPOnDrk5JQRHrmT01BGRs8I8yU6FdaFH9sDI8hEoCA/BXa0DuM1ze0mfFmM5mJziD74Qt4EFVVUdPOoV1oM621tZH0DwldwTx1ouRZfjU/uRM7jok0lKyA== 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=DDFTN9cofQM2p+iJtR8h27LAhZu4PpQYg+taIgvln6X4a1ePq5YD0kvW5g1Z9kscNt9YtUPqbefdxnLGtVlBPJOfB7VBEBAOJZ0fJ4J08jfyCJiEYF5ygmmp6YMdW8N+9E/Vd8dxorkRdL5+97TYvu0IYJGqBO5oJXmL/ODGk9bwqMf6JQ/bLqJmfXcqoNA5+360DHgI/9WVZzNX43AEiJmop2w/DxLP9kZiTzNwPBgXPNUfVcEEjc7AX028M/LgZPDzhJykT+VkzBWr0GN4c7c/fbgU4fNv8PyLAeSDKiCxfGC4s4bumBL66f+lVkd23SJt4HYvfizNyDa8Y6WHdg== 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 PH8PR05CA0001.namprd05.prod.outlook.com (2603:10b6:510:2cc::22) by PH7PR12MB6934.namprd12.prod.outlook.com (2603:10b6:510:1b8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:34 +0000 X-Received: from SN1PEPF0002BA4E.namprd03.prod.outlook.com (2603:10b6:510:2cc:cafe::a4) by PH8PR05CA0001.outlook.office365.com (2603:10b6:510:2cc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.19 via Frontend Transport; Mon, 27 Nov 2023 05:31:33 +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+111717+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 SN1PEPF0002BA4E.mail.protection.outlook.com (10.167.242.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:33 +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; Sun, 26 Nov 2023 23:31:32 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 3/9] RedfishPkg/RedfishConfigHandler: Use Redfish HI readiness notification Date: Mon, 27 Nov 2023 13:31:01 +0800 Message-ID: <20231127053107.1686-4-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4E:EE_|PH7PR12MB6934:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a5e073a-55bd-42a4-8a68-08dbef0a1e26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: MAErGjtAniVeNUh4mJLclFLet8A6Mtuih2GYPz/yhupQ57QaSju6KHQbAxGG5P3IvHczPzcliwRHu1aM9RNvcg259uHCRWgOhUIgGgjkKObrVQ5OJwaYj3r8U1MYxIcoOAQAKzNEW0k0In45SKvI8WR3ClnbFtNPj5trH1OIQFSZCm2lmpJvNgaeql5QtK1NCU81nVpfEfh4y2xae4cwqfz/4tcVHgK5F2fyL9pMvA/yqGF55deZllFGw6KdwYJ6IY/VMZJNisU5FG/M0WLunwdtdK3foxeSSxlrQhdT38gw2newRdIAvT1Tch5wlGaDtfyomNeersqok5xZbTZOqIwEEuc+LD7M6eB4DtouEtgCNuv4C7DkoToCjS0LZQHPU8bL5XhP4v4CSG7am/GaIYgQpNomtP39yZwE4mRUHa2P07AHRpxB3L91hNR1LqeS750oiXgxji8cjGIIVEuZg+vIDQgZxdusZh7PuZqSoNQA7Z9zlClZLJtby7SA9VOcnXWGO1hKAPtPrXbA31+df+tl8B38cDuv0NQGjtRWgxzs6mhtedZAyvJD5puVzovUFzMpSSPZ9RhTMS3/FcykV9Znd/XKcqQ37UIl7Wt20X7KaHY1NGqFOuPRWD7R6H7McgYM/OwoGrefCCvtHG7Uk5SX5Kgco2NK+bNvQFZdNuTJpSaOmEeRJtXSPVmEQsjNX5j9f3Ldsc/yeTjvWqUDIMEJvo1nG4TyZIu8s0SC1COGEh60nmpITpdJP+VSbggFruEgmHPmPbK1m61VOMqBZQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:33.7142 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a5e073a-55bd-42a4-8a68-08dbef0a1e26 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: SN1PEPF0002BA4E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6934 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: 3PJaS0qoTTPk5OF6EArJx4jJx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063098413000001 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 Reviewed-by: Nickle Wang --- .../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 (#111717): https://edk2.groups.io/g/devel/message/111717 Mute This Topic: https://groups.io/mt/102824316/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 Sat May 11 13:47:33 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+111720+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 1701063101719504.6014536709629; Sun, 26 Nov 2023 21:31:41 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=W5Y6EsAvrFj58cbrz0koRRgssZdTV0t2HFCdAaWqZho=; 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=1701063101; v=1; b=dlp7dzh5OvnHw6fuHnsTU+lJ3RauroMHire8skZlN27/rDOYKxOJWI7704VxDEoJ1kQ8TtYC 0y1w8MPjyblu9RW3VBaB9MUhBTmgKB2i8Ubixzcfq64nJ+slJXsG3EQqG/7o22igRAw/Q6NSQkL mQZMZU0rxwK6s6kjpf5JwQ1s= X-Received: by 127.0.0.2 with SMTP id FCAlYY1788612xYr6RScnteM; Sun, 26 Nov 2023 21:31:41 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.75]) by mx.groups.io with SMTP id smtpd.web11.86861.1701063100013092401 for ; Sun, 26 Nov 2023 21:31:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vg/1gC7W4IJBhzq1cCnbEL+Q/0xR/hjGkK5K2E3BUiwXeyTiSfs4tKex+565/GlcGX/SR7Gy4ssXoVTPFbjE77IOo7+tBMpLwlktDj1zjU/3ARYNz9NGTTX9p9Rr/jiAhcjAi+AXqG01zg3UWkFse2IfAmhTY0t/1MSjtY4+0t0xl6/CKLkOG9BBVovekSbLmk/hrDcCt/wsU3BQ/ojtHNMNm6lCU88eeW5ibA7V+GpSNrYUhKvhp/mvoMEBtubkTsBLAJ6noQhuBEEis7Jiz7wickndo3w1IaLcno+8paMu4gBSocb0gbv05P1Yuunoe/Uvcj7A8dURj7ltkVBE+Q== 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=j9SScLqjMtMs/hzfhhNytoS2vMcKlUrxpp/r7oNxrHHoRwixPOr2x5P3eJurafiuNm7zop4lvXoGUjDhrqX6l1B1yKoYvY9+VcT++0XTuO9iqRNEmK06WOmagOo9hSW/GDar3DQXNpVz9VixjH4vG0WT7TENUDRUT7oc+7cY1XjPwcUqtGpHUFozNKOJvOBJ0vSiAvN42TX+c3DAbek7gGb+Qy09snt9NmcGZ/ECPb8j7nbTvLjye3vEdGKPzEVlQbze3ITELU/EvBFMVF3Dyu1oe8HoMrfhTM8eIjIHnraampyBIiI/nsevPV7MaIN17bg+s+T6nRCT1mSaWTaxBA== 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 CH2PR15CA0005.namprd15.prod.outlook.com (2603:10b6:610:51::15) by SJ2PR12MB7962.namprd12.prod.outlook.com (2603:10b6:a03:4c2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:36 +0000 X-Received: from SN1PEPF0002BA4F.namprd03.prod.outlook.com (2603:10b6:610:51:cafe::79) by CH2PR15CA0005.outlook.office365.com (2603:10b6:610:51::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 05:31: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+111720+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 SN1PEPF0002BA4F.mail.protection.outlook.com (10.167.242.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31: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; Sun, 26 Nov 2023 23:31:33 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 4/9] RedfishPkg/RedfishConfigHandler: Correct the prototype of callback function Date: Mon, 27 Nov 2023 13:31:02 +0800 Message-ID: <20231127053107.1686-5-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4F:EE_|SJ2PR12MB7962:EE_ X-MS-Office365-Filtering-Correlation-Id: 92d78335-ceed-4fbb-0ae5-08dbef0a1f1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 0+HR9QnQCt/pb9BtC5YDq2hiIg8WFRA4YRH8lyps63P47MeU8JaILoTwg4Otdz9lPd/j3xuvGWzEZF6ts1TcF9aAtY6MWkDvYclTw4OTtt7wx4gwfpvQOrjiOo4GcqxVta5mDDsDwYBMI+vxXLx5Mv5V9Kx3kznNnnx3xGty/dz9TIf+RO9hAz5rLv4c3kRtcaNpnPF6zPLDGRaE8bK1aaHjM2b2YSN1d+FnueY1BNRuZnr52D0KWeVmBYBBtJhl025qnm3Z5iIzwVVo60PhFwdao2bLkNEJCbhX762tK4hKLHJYidxvHGLaoSsIB2nJdKAEzfebK/2q+p9fbq87yiWcLloLOE3jQKjoP2vOFisnAWYYvJ4eHoYjGTGoViHdxDHrumhHVPxAvrAT/7jKbyWRd+zVCZmJHXcs9IuDMPuQoH1+kch+NeTwYWAP5AvXFd6nvs9+wz3MF1MaK6aSXKkrnYaPB2dKlz+YWQs6elakqDn9XUJx76BNZlo58or30NNyKOijSfrCr5YU22EaDPks66CGQ+9qqMtcvt0RCL9OpmW77IjNa6xewJ93eCfwz/iX4Jn5+4WqgIx5VsKzDm/tZngoo/0G88k7Suqsjn6wL7geA08yxhSaUCYogbFqR1U7urvR7OErPBX137jrBAZYTrjxw2OoDQW5G2MSEQ1F6SVYaZxIyunGt/eoWRtN5IPQgt/FCNY75hwwAp3KufYPPpKQ4X/nd2AOxPpiUPeNXwUJmF8hIkyEl1uJB9gOw4rz0wZ+vngkDKX/1ONGcw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:35.3427 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92d78335-ceed-4fbb-0ae5-08dbef0a1f1f 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: SN1PEPF0002BA4F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7962 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: RDBXvqZ3MVaXOqMjNgWOGfh7x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063102528000013 Content-Type: text/plain; charset="utf-8" From: Abner Chang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin Reviewed-by: Nickle Wang --- 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 (#111720): https://edk2.groups.io/g/devel/message/111720 Mute This Topic: https://groups.io/mt/102824319/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 Sat May 11 13:47:33 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+111721+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 1701063101748955.4833493367491; Sun, 26 Nov 2023 21:31:41 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=XLqcAdb1Cy4awZS2hZw2D6XMg1pzBvWlyM0V/Ed7kI8=; 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=1701063101; v=1; b=ntzzlMt9NKI5Aa6VUGbNc1Br61PVkdM3REl6r1+KQD5gZd/FurzU1o+puveQxN4i4JDNupNX iwaTsUQqHqxZnTBsKMDchO/bmDddt55J3nvU71EgeFmL7UW79wbJFZo8Xn+Gvsh+3rOdaTSolGd q9yMLnyiOTkTa/hc1vM9j3Cg= X-Received: by 127.0.0.2 with SMTP id NrT8YY1788612xtqbiV62VOI; Sun, 26 Nov 2023 21:31:41 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.43]) by mx.groups.io with SMTP id smtpd.web11.86862.1701063100049103084 for ; Sun, 26 Nov 2023 21:31:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aA2tjSwkq2Q4NvBJaPwouHSra+Oy+Hqi1l+mjepFBsiBu4FkBTazIW+rI6jWVJoRANE3j6tVEDjV62pjdcVBQocweWMFTD997hBa2qENeXWd1CjBOCGkAguEKV0gm6tCQX63LEk8imeQH6J1xtFvlY6kh60NoWgDFU8fpRd+s9evVCYOWv3DKs08cO1eg5PvcjDnEFQq8DMmObT3L2nEEdqX/CRaTI8QZ1tPD/syg9dC7L0bZddoNOlSR/Afp+a1KY6Zh5oBCqsQdDkFmymsrew5Z1QRbbpzmHl4voLIkjsq0S0jBcyKQ21CBuT8ohaVPv84S+MdeYjA87MSpAiBGA== 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=A8nw9JrFMYiM5kU+rRmKukSh2zi9TXeWQmtrA2t0aZZp7t5AvfGAPpGfmEtIXvLilTXx6X8f43NtwJnFQNdmNj3wP7XFZMmZ9/XXVIHqb4dABbaGnz1RDUbUIWWRgGXUANNn6l0/sgGiuWjvDVIWP5KnfyXRiLFaAAyso8wz+gOwU7/e4haSXG+xQjK7F9CwAo8h/uhKiFVYMYEm8mPpyvGHixEqgiV8gWhaoM0Qek7VccSDF5bI98vWAtj5hRtyUgD7UymT/cJh6So62Tld1wQ4cu471pOUduQ2HBtpn30du1dFZ82EJjCKTVXEOmI1t7i3494abaiyITV7yybvWQ== 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 SA0PR11CA0113.namprd11.prod.outlook.com (2603:10b6:806:d1::28) by SJ2PR12MB7992.namprd12.prod.outlook.com (2603:10b6:a03:4c3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:37 +0000 X-Received: from SN1PEPF0002BA52.namprd03.prod.outlook.com (2603:10b6:806:d1:cafe::5e) by SA0PR11CA0113.outlook.office365.com (2603:10b6:806:d1::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 05:31:37 +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+111721+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 SN1PEPF0002BA52.mail.protection.outlook.com (10.167.242.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:36 +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; Sun, 26 Nov 2023 23:31:35 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 5/9] RedfishPkg/RedfishDiscovery: Add more debug message Date: Mon, 27 Nov 2023 13:31:03 +0800 Message-ID: <20231127053107.1686-6-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA52:EE_|SJ2PR12MB7992:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ad606e0-7471-4dc5-9cf4-08dbef0a201a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: qYvhC7QuPEfITe9yC+RXMAhpyN/THugOJF1VatUFWGICKcFyYrJU+JoZuVcKeaaUvaVTaT9juHp9jTX7itPZhL4aEEe4YlhpaWMqqxarJAx20bEcH0VA71oM6gNasJb4bdO01qxEbVI+XcF7DZ+g/7oiAk9gkO+iz6Kd68C99OnwonXdydganxqeOl2B2/cNnGCgDpSnJlz2JBJ6bcdvrbDWhK2lHA0OhUBO8jSbQhzkRwF5awWIUdmke69sJhj8LOx4gljWg1GSiDdPM6yHoiBuKM14AmJKqymWhjGhHeecLQBBpDeFOyzsiM8dZuhPwIvE0/+YiYKXAxs2ij8INsEAYlKLxgGmhjX0M3Ztzdq7ogp7K5bM3Dugtqr+7UMmcvEhaThzndgrE3cNvWM2YPL4KiuRDuW0BRM8kg33I86Rfy9SSVt3zJ34uEMh0hA60J3U94Ie8AMbmj9LMAIriHJgYj4C5A0zJPyGyhLv6Z8v5UODDJarf8yrEPKiNH8+TGyob48wdNDx8JUk95YnLQutbCZQGncwFnfioYTOa7mdwQ05BO6MHhr9LhQPX1QaE/fDUYG+S/HUnuyOFpOSYCB+lr43SnY0Mm+5I1QmGiwKGmBrHsHQpHtUNlW1E+NRz8HzBSXSi00yMmf01347RD7kYXKsjJ0RxqnC57DNIDTL2zWrf483IElioIoEOGNkjspYe9ACbNOxb3IZUgkwmUDXFMMhUaBCWjHRKwEmT43y33Qy2IppIPi0H2w66squCH613fdezgzTSk3gzXOA1g== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:36.9602 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ad606e0-7471-4dc5-9cf4-08dbef0a201a 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: SN1PEPF0002BA52.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7992 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: D4UoaThe9l7BHQZ5n6zvUWiVx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063102577000014 Content-Type: text/plain; charset="utf-8" From: Abner Chang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin Reviewed-by: Nickle Wang --- .../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 (#111721): https://edk2.groups.io/g/devel/message/111721 Mute This Topic: https://groups.io/mt/102824320/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 Sat May 11 13:47:33 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+111723+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 1701063108722786.0578564799197; Sun, 26 Nov 2023 21:31:48 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=ZVeHM6TudYSywNmhdvBlog6yhTN2Ns9Ifta9lw2b07A=; 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=1701063108; v=1; b=pHPTiSncDfzidpCeemM1jn22wr5B0RuD335g1NjA9iltEYCiOHy8qbZj7rZQ4D6p/Vc99E0D DGeki1oHKH7QXdCqkaMpBkT6oOOcQVX9thnsX+dlEiF/EbrqZkEgjtVMIMuRoQzDMXnlDKtYLWL gRy8gws0W1oTPF2LtLMaiRlY= X-Received: by 127.0.0.2 with SMTP id ogzWYY1788612xn5ifSqMy1B; Sun, 26 Nov 2023 21:31:48 -0800 X-Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.82]) by mx.groups.io with SMTP id smtpd.web10.87211.1701063107658882257 for ; Sun, 26 Nov 2023 21:31:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oTIh5ecW0JpMi8PlPQeBWldNjlGMsWQEEZ4p2jmUPNvZpQb84hGrgL9Lc/ZrbxfVmCB/MVdKNTxG49gAgf2CyaaOXmyfltL/UwUxhPA1AvIFHthpysIQsL1Y4pBypd8rC1WtGfDc/od0+ondOuhWFuNyCmo9uLZWiJEJdivEfke/MV9KZHgLDIBIXOfxb944S8rp4Ken9QPC5/4Tj6/7GC0byeb1LCukbFJdcL2qvDz+LUxq2v8CgCBIfBy+0TUlw9ZAsF+VCQw5kY47ZVKZUsJh+1ufDCaen7bOzBG9T3ocOrp+EUJqDOAhJYiHfw0O5YghxsQjdJ/8xa0IRrlsjQ== 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=GJsI00It9p+rbc2PIutkepAtHva+BqUCsueTaGOMZsbQ6f7SWHU/H4X81609dLAlrQZ1ao/UbuOX+LpWTbDqqS+xNkzxR5LK0FTvBMzSCLizJ3UfdWfws8F/66hDGOaQi0Ux1eke6ofZTIJPWg5NP0rH5zNp7IKSf1+gbt07OahCOaT29QpemuvaKlOnhM0JlbCV7WAe76Zm4J3bbvORYAYe4jzYxfi7wjZcSvDtyVPDJpdlm9UiISyrwlbblgX8vVN2EdR/yiA7T/M7IONwN2PRn6xAGCIyK6hVsS4EmBLB7jkBWgRHfDOUfYQHik2/9gqP5WPIocy/y3nZ+MqrPQ== 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 SA0PR11CA0091.namprd11.prod.outlook.com (2603:10b6:806:d1::6) by SJ0PR12MB5486.namprd12.prod.outlook.com (2603:10b6:a03:3bb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:43 +0000 X-Received: from SN1PEPF0002BA52.namprd03.prod.outlook.com (2603:10b6:806:d1:cafe::83) by SA0PR11CA0091.outlook.office365.com (2603:10b6:806:d1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 05:31:43 +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+111723+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 SN1PEPF0002BA52.mail.protection.outlook.com (10.167.242.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:43 +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; Sun, 26 Nov 2023 23:31:36 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 6/9] RedfishPkg/RedfishDiscovery: Refine SMBIOS 42h code Date: Mon, 27 Nov 2023 13:31:04 +0800 Message-ID: <20231127053107.1686-7-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA52:EE_|SJ0PR12MB5486:EE_ X-MS-Office365-Filtering-Correlation-Id: 470db94f-d657-4d4f-0c77-08dbef0a23f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: m6PgSnBdDMviz+V1DsVugOtvCxArD8kJXJC9pQIcFzAGasvUie1j+OjqG92N8lQIwXeOvdUAvC1fOZ1h8a2dMgv9wsw2TnJ9mZKcRnZJ3y8O/LASe6+hinsvgldUPW2flZ4dtsGMg+UBLJY3KyTrxztSLPQcQqe7+LNkg5w50xBbOCPGoTJmk6YtoNHfGIB7ldJMfNmJjdGHD4URI7SvdWTy9QD+4byw65AWiq0eaKEXQ487dFJDGCjyOlG3GxZLhKUKSFguFrdLWM/siReGWvTxjXeYdenlOqoCbGM7y/P9Heej4R0uMiLBo6uLtpeKiEFJ+HMfvzkdtS49ZJZXudIVxHKzNsTwP9LXPNzK2nf75sXUWyuq49kJ3s09exTsm69b2PBYPiCHk+UKpV6vZJnvcGaiMxy3rZrhkkinXMk3NQ0dhKjSY96NT0rJe9qep8GZpckpG+s3J95LRUN/M51uglssmfLBrWhOXmaPifB29fpyQscIYS2XauSQnTXZcCBDFQFiqT7ge4ScGQiyxcd5JPVCwqVxHX0bLmwruvR6Oro6ZyL7saDH81+9HCpdEsYhcL17LS3LPRtb6Zvg3DxcHTqo3VP9FsKxPYyG5sjpZUHU0jldHNOHAtsMjmgVqcXraUxQ01GteCnKs1l+5gGqcu/vc7OVfPK9CwWUDNjeMIxQRb8/NhfD8++pm2x4+HxZ9lLdfyuSgtj2IbJbOth3iYpKbagAnIBl7ppy/3zeEL4ksl0Ht2BzJv12JyNFjVQF8GX6cD5aW6OadCPENCioaq9eE+rwfYXFemVY9As= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:43.4602 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 470db94f-d657-4d4f-0c77-08dbef0a23f8 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: SN1PEPF0002BA52.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5486 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: JHI2qZ75H3YKOjscMhwh8ruOx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063110666000007 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 Reviewed-by: Nickle Wang --- .../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 (#111723): https://edk2.groups.io/g/devel/message/111723 Mute This Topic: https://groups.io/mt/102824323/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 Sat May 11 13:47:33 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+111722+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 1701063108199926.3935134378258; Sun, 26 Nov 2023 21:31:48 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=BjwINhc4C4FcYIfXFAOWHU5PqUV5TuP+NO40tKGlUl0=; 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=1701063107; v=1; b=bbZcuoJAVf2nWprcIxGck6EuJ96Htp4GdCpWlZ4P/siUtMXH4y7zaFNYY+cCPRk22epeQkUS x7YQ1DBt+R9DSB1RXJJP//hOEFB0BMV5UuSCfSUYp/pxRo1q5FwpwcIzPOarpSdQH9y315Ogc0v fu5CLU97y+Ix8NQ/I3J7WC3c= X-Received: by 127.0.0.2 with SMTP id 1YELYY1788612xhKVtZnR5xR; Sun, 26 Nov 2023 21:31:47 -0800 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.40]) by mx.groups.io with SMTP id smtpd.web11.86864.1701063106969908560 for ; Sun, 26 Nov 2023 21:31:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FeaP6TU4YAPGxjaVqDeN7Q1QGkzVAymAXM2aWTmtIZziHhsPM4K9liSeHCbnnQCt8KOOGGJKsnIZ7gEfGMreSm6OUzMxSjBmYNGpp88YPtjMu6mTESepiVUuz9nxRf4R1xnACuxtxNmyDooMQLgaTO+K8NOykPdrufs7PSZLG0D1ZUJ+DyG6j6Y8p6G0Gf3O1xFYAhqHGA9QRC/FbtT7jtuzPPCYq7KfzXrw++fFT91XUJUPebHwbn2LItx2x0uUEykpnKD/F1+dUAFv08AHLGZYzZmwhmvtScNyGlGGfDpcfHczdw2AhaaJvszPRvERgN92xxAOsVNkMB5B/ukOAg== 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=EqO5Fax4e97nekjqukhTTrcXYA/AgjLRYY3JI0zPHF9ebxhJWK4FED0+Cezl///eSOqcZNlBYlVB1oSmuRNSpcHppxkQx7II5YBpjXBV/MKm7G9G7jbPsnECa3gSZzxiDEUUcBaMkAJHwMvk/TmSgc/KP+gesseaHZOSUmXwbFy5aM6eD3LaSOqRnct6kw6fE00YBKk6QlzKih2iXL59XuxZo4cq0lKh8gGXuBHHQR3b/ZA4/dW25hOT6g6PgcsFiecQpiy3xKr9ugeQ5yfMwC85ldZrAQo7qB0TGDNuCQJomkA0RoI+OytBqtVzA1pKdGu3Jovxq/qxeT+8ATlaRw== 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 SA0PR11CA0106.namprd11.prod.outlook.com (2603:10b6:806:d1::21) by SJ2PR12MB8874.namprd12.prod.outlook.com (2603:10b6:a03:540::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:44 +0000 X-Received: from SN1PEPF0002BA52.namprd03.prod.outlook.com (2603:10b6:806:d1:cafe::a3) by SA0PR11CA0106.outlook.office365.com (2603:10b6:806:d1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 05:31:44 +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+111722+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 SN1PEPF0002BA52.mail.protection.outlook.com (10.167.242.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:44 +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; Sun, 26 Nov 2023 23:31:38 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 7/9] RedfishPkg/HostInterfaceBmcUsbNic: Fix incorrect reference of MAC address pointer Date: Mon, 27 Nov 2023 13:31:05 +0800 Message-ID: <20231127053107.1686-8-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA52:EE_|SJ2PR12MB8874:EE_ X-MS-Office365-Filtering-Correlation-Id: 63fda44f-367e-4f05-9003-08dbef0a247d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: OqXsHAgikGgqAAFN9x1nIKEg2Gd4crBvH9ZD8mfBCHQsLSG/+H320mSPaEpR2fJPFnHuivVFhDzGmF15/BP5wS+l+Bi3sTnT9uqEAulBO+2IYxX3+vVvzxLdQkCH91yVmlJNiXO8HsLiE6uToYUQi6bJS4rTvEnQ77L+nfkzXoElfdSuk2thIbbbme9SBzLDILJuatwmSGUDNQylwb72QAXL92ncE9ZZzrACZm967ljOEJxSxaNWNEckWMSKolj5ux99gaj2fSJ5ErQU5wgEqlhDJsY+O0CTX9vy9XMNXEyg5fglKkaMGkRwNFP6rJPinJxiLekSICsD7omkt5UAAkmTQz4XlKX4D1rTIb/J8wA7NHPp064CZYOPkr/iJsjcK21XlsZZywgTNVmIILMvSbqtBwYZCvM15dM0WwMAyQYDQEhY+XOk9aYjQJNZX69CIP71N7Zul5ituo0FPEdN6PxFRwuhDIqm/judskQTsUOaRRCoRsTopRCTZ3XbBfCiCsyGGIY7cNl+M9yB5DOn/DmYA58FF+zTB18S7xnxejM583Aiy5hhzBXKSXxsLAvO8pAOgiBsx5/fikw08ZpS4uobnPbpV7zldcRwEFSsVjdJfKwVfyDYipbTqvfk68Ulgo3jzPGbftiJmTt/mkDibAKV93Xb0brPTBuIw3xHd7WJ/v9AhdAGLSOl17RNVzPMqZ6TgekN2ryOkIJ1DPrY9tp9lCbK1OIGneNY/nQ/i0q+Nn3WD1lIcv2GOrurUTIWsQMASBsB5Mn99ikySxvNe02THjsf2ekq/Si7jnlXPoU= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:44.3352 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63fda44f-367e-4f05-9003-08dbef0a247d 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: SN1PEPF0002BA52.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8874 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: Ral7Cz1YW2VgimCCXVp3632Yx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063108631000001 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 Reviewed-by: Nickle Wang --- .../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 (#111722): https://edk2.groups.io/g/devel/message/111722 Mute This Topic: https://groups.io/mt/102824322/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 Sat May 11 13:47:33 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+111725+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 1701063112077746.6358864835466; Sun, 26 Nov 2023 21:31:52 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=JZNz95wYllHBxr4ZTB52Tw6Chf2sU4bs0GTVN32oc/4=; 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=1701063111; v=1; b=m/ikBPpuRtStc3kX5wTMl8K8yzae40fvwabZOLy3k+N8IspDaFC0mkCxvy5uq0H/hE6ROvmF RNzdlkmcX4L0+POeWT/J9nZjpV/Sxe6g4IIeIZ2vxNKjZGnrfDcNzF0a/1rsm5+rtRPphvwSX5N HEvCft4yQFXed+iUzrjE1Lc8= X-Received: by 127.0.0.2 with SMTP id eJjPYY1788612xnLpHc5GLdi; Sun, 26 Nov 2023 21:31:51 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.84]) by mx.groups.io with SMTP id smtpd.web10.87214.1701063110898322115 for ; Sun, 26 Nov 2023 21:31:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GNtJsygdcClieEb2WdIkzc9T7mDCi52RW3OOWQoUeNEYXIueXw8FNY6RHi3AyApqudpoDPIwmsNIuzX4BYPnm3ON/49Q+x8hMPZ3RcdZ+GNgO9y7nxoBe/UZmY6XkZL5FnvDoqqET1tBQThcIkYFkRD6M1FMNSMiGHng76tkVBJ5feq7hQol/O4L88MmFAOuLa8/uwgby4V5Pf5c16xThaJSyUmodPcYDxXLdGvvOI8i1dnVPv9nC/jTFX9ndxJYSbg+CdcAZ9cz35rOorZD0cn+WiUcPJOZqI7kcnYUii1UTRmPmdjjZnDSPQqTchna6iLy1vC7fURZ09LdQHvjwQ== 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=V1QLYPtzwXpJQ5M1Gfw2Ep/pHdMP5Q+MDPWxiBWVj7Y2CeyE6o40QLKQQMIJZUoTSgU1Nv2IQCMmcaL3d6TKFPLyZnB4+eJH/HjoCD46Fw03eN1SudM1e4JqFEZnpyPo/b56vyGheU3gKzL6b2rii8OIj4iibtFqmxA2GXCrx7LcLqe2Ppgne+DDG+WjldDqQZvQ7+mK4s0i8r1z0RriKzCpUF8ZK7VYeul6+MPnu+DbYHB5pceZGzxSOdG4onLbrenzVaTFPKmykwitgo8GJL/ScuvUePRj5r9RQxtmv6lQP8+ut3sIiioAyDDUmlykqr5iZ68pdMnSyPCi7KcuGQ== 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 SA0PR11CA0118.namprd11.prod.outlook.com (2603:10b6:806:d1::33) by PH7PR12MB6489.namprd12.prod.outlook.com (2603:10b6:510:1f7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:45 +0000 X-Received: from SN1PEPF0002BA52.namprd03.prod.outlook.com (2603:10b6:806:d1:cafe::cb) by SA0PR11CA0118.outlook.office365.com (2603:10b6:806:d1::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29 via Frontend Transport; Mon, 27 Nov 2023 05:31:45 +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+111725+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 SN1PEPF0002BA52.mail.protection.outlook.com (10.167.242.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:45 +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; Sun, 26 Nov 2023 23:31:40 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 8/9] RedfishPkg/HostInterfaceBmcUsbNic: Fix incorrect HI protocol record size Date: Mon, 27 Nov 2023 13:31:06 +0800 Message-ID: <20231127053107.1686-9-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA52:EE_|PH7PR12MB6489:EE_ X-MS-Office365-Filtering-Correlation-Id: 23b71ea0-a76b-425e-633f-08dbef0a24f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: QHtgsptNbJNHwap3UdR+C73j3AnVdPQqCy6CKdATiXduaOFrV2cpmqnC/fsEA0pPu1UA4B+z7yzf2ZZlBPT9kLCQV+XEpX8tSsZFhi33GXrHGQxXgf6fME+bO5yPLn+i0OSHbKoUzXW3qViy0+EXP8E3TAnYVShds9m+FY4kpS075olQrXQpIwIbXbp33cM+SdZCQ6g8fDccNKgT1ugaA3NeavmSuSnATLFgGg9WWLTul4/doh7ank035eiU6MEdbvpgUY9WteOQqrqwBUOnESUSJhRjIiQAcHRR9W6X01uxhLR+7oCxKSV2BADFgar2PiFggkzS95hmMkjFf9iLCI1MYTUOu3bNhezzTtGWuhA0sGUY24tyPfiT9r5S67aY2c+B6WAgelTeZ6A9vxlL4ArBGjd2Dykp5YF7YPX+cIF7Aso65iq4kGqDFxVgpBesX+Kmdi2pDndZSZkpZuIhET9XqjtCeWF2gDuBXnYquNhh+AyB1bRhqDoXX14nAdX6PTx9KPlTam2Za2ztJWyqlg+CknLOZDGV2yUWdWZBafeqonUfGpt3lp0Nre7u2ddnFJ2RfiArO+/umGOkgtL59CVBreaFYEHUXpTcB0JOw+6P4uP6/lz6dgk/AW2rIBu5BHRrCfNZ2KJWbLDZeoITIsNy9ucysLZsmPoECpgZhb5S0aZtRrd8RmFnBDB7+7cMuH8E0GDcAOXjFM518jSJEaGOwUf8vGpr+s0W/OFA/qRowaHkxigIYGwuiWu0b55T9c2TlF9M1m47r1XfRAavZSHwEiz5/wAcfmQvfOq3lxA= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:45.1008 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 23b71ea0-a76b-425e-633f-08dbef0a24f2 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: SN1PEPF0002BA52.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6489 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: JO32wR0QneoLLOy723vwrsTSx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063112763000012 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 Reviewed-by: Nickle Wang --- .../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 (#111725): https://edk2.groups.io/g/devel/message/111725 Mute This Topic: https://groups.io/mt/102824325/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 Sat May 11 13:47:33 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+111724+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 1701063110580834.1927829674983; Sun, 26 Nov 2023 21:31:50 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Jf5fgXVzEP6mYi7YbXmoQ8+lipSyBvGa9Vfx6SJMo5s=; 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=1701063110; v=1; b=uZK6d5cUwjsWbdnZwke8RIb1rBFlwt2+tO3XVjKJsYtg90BQ4cU5cvranRwdWt7Ol/F7FwnE fpHMxzZzNA+73d++23eupv9zsPorZ2Y/lnZti4tc4xYp3tPUIfBitusv9jR0sk3+2+bCzL4obDe awcvGsi2VvV4xRA6f5pmPHDA= X-Received: by 127.0.0.2 with SMTP id BeevYY1788612xUUnK7vy1lV; Sun, 26 Nov 2023 21:31:50 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.47]) by mx.groups.io with SMTP id smtpd.web10.87212.1701063109502958050 for ; Sun, 26 Nov 2023 21:31:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oa28gDWqYslCiMyu0IbeYU+SnLWAVEsVZGYvACDD6ueVTtNjdV2wbYjnjVU0gxc7CPjTbBeavIBKlfkk3FvRGfi+iaElYIhY3+6yO4OQgDcUno9CqY5BKFOOXa+kc3LXmUz/iTVrcqAKo8Ckx+dAkOJAWuivp/NaT1oD+HVlTnDLMn2th7RYJLydwBy7k0A0hXoCYS8m0ogyOks4r59ocU9etMheiWGHQXwQ9toJAaK9EWWdbCUFS+m5WuSomJCGopiTMajP2lBIZdKvCkkztSewO8znGsYvH+2T24t/nGSdOm2lUr7+Gsa3L/FoIPIHMfRb93e8YtZoYX6FYPU77g== 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=bheeMP4Yli9NPYFa5zp50l7a+BcijBVoYgFNc/it18k=; b=XLnMd93niiaF11+5OgBHVFeM/mak3rPaO8di53aTQUVNMItgHI1hlAJtBIQ8RkwkugBs8oePkScgO37Vuzpa0uAyLediE1VAPZQ/umHTDYK2KGs4tCGuyUUhpI9BqVqBFkR6XE1Xs8Pzdku2lUaat44oSIX4R1rqJ1ZKMbcU4cei/8OCAzfwMcnms8WMXDIDwLllwhTCEs2HPidehy92T5q7VOMZh+dtcuu0txNhHTg4TKgIw75nKimeBp8yOX06bMk6xBEGWc8AGMjn3z1bZIGpebOGh+0rkdz7KQaqn/aSPJwfvmdt1fmzZ59JXF/3TjwrrxV8ynqMtEOuRrpc0Q== 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 SA0PR11CA0103.namprd11.prod.outlook.com (2603:10b6:806:d1::18) by MN2PR12MB4109.namprd12.prod.outlook.com (2603:10b6:208:1d9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Mon, 27 Nov 2023 05:31:47 +0000 X-Received: from SN1PEPF0002BA52.namprd03.prod.outlook.com (2603:10b6:806:d1:cafe::30) by SA0PR11CA0103.outlook.office365.com (2603:10b6:806:d1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27 via Frontend Transport; Mon, 27 Nov 2023 05:31:46 +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+111724+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 SN1PEPF0002BA52.mail.protection.outlook.com (10.167.242.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Mon, 27 Nov 2023 05:31:46 +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; Sun, 26 Nov 2023 23:31:41 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH V3 9/9] RedfishPkg/HostInterfaceBmcUsbNic: Fix potential memory corruption issue Date: Mon, 27 Nov 2023 13:31:07 +0800 Message-ID: <20231127053107.1686-10-abner.chang@amd.com> In-Reply-To: <20231127053107.1686-1-abner.chang@amd.com> References: <20231127053107.1686-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA52:EE_|MN2PR12MB4109:EE_ X-MS-Office365-Filtering-Correlation-Id: c9b69de8-40e4-49a0-6ae8-08dbef0a25fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 0PL05qMJbuldQ5n/2w5CN8CeCBi+9Ac8jV50FeAq3cfH2qLL02Yag23RQGAjWPjoBg8OwDh7LFUldGSPqNY+Utr4+IV84QBSfKgMzPZCPEwlGLrZdRkXpV8H+jyQUie59/0uH9+UJMe3JSkDi1FTP1oYIg5BpgsGEAzFm+EKJ4ObKAXp9IeHnkQoN9oC+6ln8yUorA4t5mWNfQoNjG4LCMbCwoK4igOhfQzQHOFbKNEJeBVTfj9su4gWy3KS+RBZsXBtalboEFGw9JZURdZ7avaEEdkHF0hl92xJZ/SmT2Ku1LPRtq8hZTSSE75UEz7+oJpwyPoB5a9r/Q5ROTql1MqA6izLYLR2BsDPjZND4Ez1nINbIEPyW6hcx6oRY3daJdc6vwYpZmV3wMUS3ovdwQcSXfivDudVTMoJTsYv5VQvj8wo+mqEzkoRwzDd2Q8SJukKYU8/hpGIpko+DXeFiFSj/iIpsnVI2MrRQn73TZWE1LwI397jNVgSEISIj75gzvoSuYjTyA80cu79fp3knKfKWuwDvaSxy5ubCxHmZemFAOSw4gqTLPSv/vDvqmKnZINlowevtJZc2B5r2mDfAnBvvMJLuXFc1yGpYhzXP19n6OW007oX9W1VWB9cRzvKoSb7spIlX8YcQ+HN50Irc3Bv0qO+cEoNDWfXXq01Yv8Q4qOdb3rRii4miwoOSRusS0Vx7d680disqdu6yIb3+W4ry93KkWu0sWN3nHaQmACYst/BQrlEDzOzn1eve+Hs/eGErCFBF7Teq4bwKbQYd/Jqpo3P86P3VhSuEQ95eOU= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2023 05:31:46.8508 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9b69de8-40e4-49a0-6ae8-08dbef0a25fd 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: SN1PEPF0002BA52.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4109 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: tt2FeghwV00unhyED4CxEx7Jx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701063112763000011 Content-Type: text/plain; charset="utf-8" From: Abner Chang Wrong memory allocation issue may result in memory corruption. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin Reviewed-by: Nickle Wang --- .../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 a1ce2dd3d93..2938d54da65 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c @@ -1060,7 +1060,7 @@ IdentifyUsbNicBmcChannel ( =20 InitializeListHead (&BmcUsbNic->NextInstance); BmcUsbNic->MacAddressSize =3D Snp->Mode->HwAddressSize; - BmcUsbNic->MacAddress =3D AllocateZeroPool (sizeof (BmcUsbNic->MacAd= dressSize)); + BmcUsbNic->MacAddress =3D AllocatePool (BmcUsbNic->MacAddressSize); if (BmcUsbNic->MacAddress =3D=3D NULL) { DEBUG ((DEBUG_ERROR, " Failed to allocate memory for HW MAC address= s.\n")); FreePool (BmcUsbNic); @@ -1133,7 +1133,7 @@ CheckBmcUsbNicOnHandles ( (VOID **)&DevicePath ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, " Failed to locate device path on %d handle.= \n", __func__, Index)); + DEBUG ((DEBUG_ERROR, " Failed to locate device path on %d handle.= \n", Index)); continue; } =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 (#111724): https://edk2.groups.io/g/devel/message/111724 Mute This Topic: https://groups.io/mt/102824324/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-