From nobody Sun May 12 18:58:57 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+111650+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 1700718898240735.8622222961463; Wed, 22 Nov 2023 21:54:58 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=qFTUlSC94zA4O+6ht01vEZH7NQ12PGmQsUg+gyrQ7x0=; 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=1700718897; v=1; b=pT9HhJShnOwF6UVBjWt7NxItkM1xWZRjkCBrR0CnzGx6KYzKkcbD0hq6AYS7wGYDgbsagR1m jbveeuNBNznINuTDCTCZU61rDrWBpZFOozEah/BS+TLXj6VhPd+9t1h0QNDi6s9EcOZWYhYOVoM KQ0rr/nN+mmSyl8G27goOM/w= X-Received: by 127.0.0.2 with SMTP id 40Y4YY1788612xCEPgvgXOEm; Wed, 22 Nov 2023 21:54:57 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.70]) by mx.groups.io with SMTP id smtpd.web11.85675.1700718897066320097 for ; Wed, 22 Nov 2023 21:54:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cIAhplCJ5sgnL9bvVkj6K5EJd6Dn5wwv+KTSLHbq/bmXzUcQCzycyZszkAVV1wkQruB8rxJ7bFh6huN0dcnRKks1fyiO0GjiHWVBRIZ7VK9Cp8ScE3kJUcXNckOLH2nQ+HJIIl62beej9/GiO6oq57APkcnaKoI1iF+mDsxoUD6OkcIG854SX2OLt3aFzA0Ho+5eQqZobmBZhdA+3uhtLY8hpPVYRsh5ovf8s9Sx96K8I4Bke21XcssbZmMtQWYjnxhdqpk5vVU4iSmmc8V6A6zvVnwuek0dgUGN71erxIlKIygeHpApcfKP6Db7v8VaqUoOybLq1bOk88QiZXo9mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e5CR7BB1pw+ZeX/uyHxk8/d7n6oTQvk1PXEQPAjepqM=; b=oXB0fp58gCyywQ32x3b6dYZNT8mIsK4vctj+uodAkXBL9q04Xk4JiOnG/TCGnynHwRS/vLNpEmSADBTu8X939LJ/1mDkau+zhwAFiEmWsKUoqr8dGGOdXI0IquHfm9UxLsaHV/tcCne5iI+eXIOHdlFcHIrOnOqqsFIx5+wW67thcSZu5857XJkRTICuodncjrVyPVbWyQ3wJ0fWO+ZoBgNyIailBgbcDKiqVFam9B7jJTuwEj0SRf+82+Y3TTKDeprlKblb9/7/yITqHEjBTdoxscZySjnh0rk8pqUmvkNAmNn7LOYn5w+0U6NRxqH2a8bkERGj38MnNkwJdUZkeQ== 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 DS7PR03CA0083.namprd03.prod.outlook.com (2603:10b6:5:3bb::28) by CH3PR12MB8403.namprd12.prod.outlook.com (2603:10b6:610:133::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 05:54:50 +0000 X-Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com (2603:10b6:5:3bb:cafe::92) by DS7PR03CA0083.outlook.office365.com (2603:10b6:5:3bb::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20 via Frontend Transport; Thu, 23 Nov 2023 05:54:50 +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+111650+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 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 05:54:50 +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; Wed, 22 Nov 2023 23:54:47 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH 1/6] RedfishPkg/BmcUsbNicLib: Update BMC USB NIC searching algorithm Date: Thu, 23 Nov 2023 13:54:27 +0800 Message-ID: <20231123055432.86-2-abner.chang@amd.com> In-Reply-To: <20231123055432.86-1-abner.chang@amd.com> References: <20231123055432.86-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: CY4PEPF0000E9D5:EE_|CH3PR12MB8403:EE_ X-MS-Office365-Filtering-Correlation-Id: 020e78e2-35a5-4933-f7e0-08dbebe8b4df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 9o8TQjHJiCW0Ma7spF9kSI9+7hfdxqjJ0h/cfuUZt6XKOOxazsb16HbPC8fzf1+T3sWjU0WnpnSdDGBy0z1/KBFkQvtwcYXeHISO3u+ZD2Cc2z3O8905TCAXLsILagVq5y+MHFugU9Y+XvwycOI+DYB+rTKA7/TPm/Q1jbPKsq5JdXQyovCLvvPg2EjBK/7lXmWdEDpicIbhp64PsJdLD8XX7BA0362uN9ixycL3FG5BxiaYEuBdypN99wcffn2qkvC2xYh4Yr5VMkDwkuUI4vHXrLnwxBL3LulufX/26LaFAkkMt9pqPg2pRmIWUUmhCeDK9dM8xIjz3XnHWHWDKX18WHP5AapQJGWRyB79Y63upvD7zYFxl1UWejXAl/zd3yIb4BLmnPk5sbcb0QpxZxT8UiY9eaeWQS6FwexyXmjPAjtHzeqCV8dJxxWgUt4qUb7/S2u6+AsQ5/Ekk5BDJgPOPrtJ2//RjTmaPFUlG1izPI3JOpWnO0O0iG5GcCIAYdWWek/yI8iG5hn6T4A8XOVA8sbBI/yVNGRzlypR1LXZnnbibbxeSSMEMQWF8ReMsWdRDa71WdS/wGywVAohM9HKrHpRW/Q+U+prM7hIKbt1S5Hwv9075Y7DgIA6agj0P0g7s3PND4mLj2MwhY1dKcPtXi5o9Ol/8CGbEDgTWi0fhGDoNudQyTU84wruWqkNi1CZ10LCE9xneAsa1cv1AH7+tF/ffjrHcIelqcaNiD6Wwyb1xtPsoGZmnL00c9VmZZ5+Gv/WRCgSA6LzLhGP8g== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 05:54:50.1324 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 020e78e2-35a5-4933-f7e0-08dbebe8b4df 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: CY4PEPF0000E9D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8403 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: VCDggKgeNZ66dkF0Of2GoNJZx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700718899351100004 Content-Type: text/plain; charset="utf-8" From: Abner Chang Update BMC USB NIC searching algorithm for IPv4 only. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../PlatformHostInterfaceBmcUsbNicLib.c | 188 ++++++++++++------ 1 file changed, 128 insertions(+), 60 deletions(-) diff --git a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformH= ostInterfaceBmcUsbNicLib.c b/RedfishPkg/Library/PlatformHostInterfaceBmcUsb= NicLib/PlatformHostInterfaceBmcUsbNicLib.c index 95900579118..e5bf70cfd58 100644 --- a/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c +++ b/RedfishPkg/Library/PlatformHostInterfaceBmcUsbNicLib/PlatformHostInte= rfaceBmcUsbNicLib.c @@ -368,7 +368,9 @@ RetrievedBmcUsbNicInfo ( )); CopyMem ((VOID *)&ThisInstance->RedfishIpAddressIpv4, (VOID *)&DestI= pAddress->IpAddress, sizeof (DestIpAddress->IpAddress)); // - // According to UEFI spec, the IP address at BMC USB NIC host end is= the IP address at BMC end minus 1. + // According to the design spec: + // https://github.com/tianocore/edk2/tree/master/RedfishPkg#platform= -with-bmc-and-the-bmc-exposed-usb-network-device + // The IP address at BMC USB NIC host end is the IP address at BMC e= nd minus 1. // CopyMem ((VOID *)&ThisInstance->HostIpAddressIpv4, (VOID *)&DestIpAd= dress->IpAddress, sizeof (DestIpAddress->IpAddress)); ThisInstance->HostIpAddressIpv4[sizeof (ThisInstance->HostIpAddressI= pv4) - 1] -=3D 1; @@ -729,8 +731,10 @@ HostInterfaceIpmiCheckMacAddress ( =20 // // According to design spec in Readme file under RedfishPkg. - // Compare the first five MAC address and - // the 6th MAC address. + // https://github.com/tianocore/edk2/tree/master/RedfishPkg#platform= -with-bmc-and-the-bmc-exposed-usb-network-device + // Compare the first five elements of MAC address and the 6th elemen= t of MAC address. + // The 6th element of MAC address must be the 6th element of + // IPMI channel MAC address minus 1. // if ((IpmiLanMacAddressSize !=3D UsbNicInfo->MacAddressSize) || (CompareMem ( @@ -738,8 +742,8 @@ HostInterfaceIpmiCheckMacAddress ( (VOID *)&IpmiLanChannelMacAddress.Addr, IpmiLanMacAddressSize - 1 ) !=3D 0) || - (IpmiLanChannelMacAddress.Addr[IpmiLanMacAddressSize - 1] !=3D - *(UsbNicInfo->MacAddress + IpmiLanMacAddressSize - 1) - 1) + ((IpmiLanChannelMacAddress.Addr[IpmiLanMacAddressSize - 1] - 1) = !=3D + *(UsbNicInfo->MacAddress + IpmiLanMacAddressSize - 1)) ) { DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " MAC address is not matc= hed.\n")); @@ -962,6 +966,49 @@ UsbNicSearchUsbIo ( return EFI_NOT_FOUND; } =20 +/** + This function identifies if the USB NIC has MAC address and internet + protocol device path installed. (Only support IPv4) + + @param[in] UsbDevicePath USB device path. + + @retval EFI_SUCCESS Yes, this is IPv4 SNP handle + @retval EFI_NOT_FOUND No, this is not IPv4 SNP handle + +**/ +EFI_STATUS +IdentifyNetworkMessageDevicePath ( + IN EFI_DEVICE_PATH_PROTOCOL *UsbDevicePath + ) +{ + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + + DevicePath =3D UsbDevicePath; + while (TRUE) { + DevicePath =3D NextDevicePathNode (DevicePath); + if (IsDevicePathEnd (DevicePath)) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "MAC address device path is no= t found on this handle.\n")); + break; + } + + if ((DevicePath->Type =3D=3D MESSAGING_DEVICE_PATH) && (DevicePath->Su= bType =3D=3D MSG_MAC_ADDR_DP)) { + DevicePath =3D NextDevicePathNode (DevicePath); // Advance to next d= evice path protocol. + if (IsDevicePathEnd (DevicePath)) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "IPv4 device path is not fou= nd on this handle.\n")); + break; + } + + if ((DevicePath->Type =3D=3D MESSAGING_DEVICE_PATH) && (DevicePath->= SubType =3D=3D MSG_IPv4_DP)) { + return EFI_SUCCESS; + } + + break; + } + } + + return EFI_NOT_FOUND; +} + /** This function identifies if the USB NIC is exposed by BMC as the host-BMC channel. @@ -1025,7 +1072,7 @@ IdentifyUsbNicBmcChannel ( (VOID *)&Snp->Mode->CurrentAddress, BmcUsbNic->MacAddressSize ); - DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " MAC address (in size %d) for = this SNP instance:\n ", BmcUsbNic->MacAddressSize)); + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " MAC address (in size %d) for = this SNP instance:\n", BmcUsbNic->MacAddressSize)); for (Index =3D 0; Index < BmcUsbNic->MacAddressSize; Index++) { DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, "%02x ", *(BmcUsbNic->MacAddress= + Index))); } @@ -1068,7 +1115,8 @@ CheckBmcUsbNicOnHandles ( UINTN Index; EFI_STATUS Status; EFI_DEVICE_PATH_PROTOCOL *DevicePath; - BOOLEAN GotOneUsbNIc; + BOOLEAN GotBmcUsbNic; + CHAR16 *DevicePathStr; =20 if ((HandleNumer =3D=3D 0) || (HandleBuffer =3D=3D NULL)) { return EFI_INVALID_PARAMETER; @@ -1076,26 +1124,37 @@ CheckBmcUsbNicOnHandles ( =20 DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry, #%d SNP handle\n", __func__, Ha= ndleNumer)); =20 - GotOneUsbNIc =3D FALSE; + GotBmcUsbNic =3D FALSE; for (Index =3D 0; Index < HandleNumer; Index++) { + DEBUG ((DEBUG_MANAGEABILITY, " Locate device path on handle 0x%08x\= n", *(HandleBuffer + Index))); Status =3D gBS->HandleProtocol ( *(HandleBuffer + Index), &gEfiDevicePathProtocolGuid, (VOID **)&DevicePath ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, " Failed to locate SNP on %d handle.\n", Ind= ex)); + DEBUG ((DEBUG_ERROR, " Failed to locate device path on %d handle.= \n", __func__, Index)); continue; } =20 + DevicePathStr =3D ConvertDevicePathToText (DevicePath, FALSE, FALSE); + if (DevicePathStr !=3D NULL) { + DEBUG ((DEBUG_MANAGEABILITY, " Device path: %s\n", DevicePathStr)= ); + FreePool (DevicePathStr); + } + // Check if this is an BMC exposed USB NIC device. while (TRUE) { if ((DevicePath->Type =3D=3D MESSAGING_DEVICE_PATH) && (DevicePath->= SubType =3D=3D MSG_USB_DP)) { - Status =3D IdentifyUsbNicBmcChannel (*(HandleBuffer + Index), Devi= cePath); + Status =3D IdentifyNetworkMessageDevicePath (DevicePath); if (!EFI_ERROR (Status)) { - GotOneUsbNIc =3D TRUE; - break; + Status =3D IdentifyUsbNicBmcChannel (*(HandleBuffer + Index), De= vicePath); + if (!EFI_ERROR (Status)) { + GotBmcUsbNic =3D TRUE; + } } + + break; // Advance to next SNP handle. } =20 DevicePath =3D NextDevicePathNode (DevicePath); @@ -1105,10 +1164,11 @@ CheckBmcUsbNicOnHandles ( } } =20 - if (GotOneUsbNIc) { + if (GotBmcUsbNic) { return EFI_SUCCESS; } =20 + DEBUG ((DEBUG_MANAGEABILITY, "No BMC USB NIC found on SNP handles\n")); return EFI_NOT_FOUND; } =20 @@ -1139,62 +1199,70 @@ CheckBmcUsbNic ( =20 DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry, the registration key - 0x%08x.\= n", __func__, Registration)); =20 - Handle =3D NULL; - Status =3D EFI_SUCCESS; - BufferSize =3D 0; + Handle =3D NULL; + Status =3D EFI_SUCCESS; =20 - Status =3D gBS->LocateHandle ( - Registration =3D=3D NULL ? ByProtocol : ByRegisterNotify, - &gEfiSimpleNetworkProtocolGuid, - Registration, - &BufferSize, - NULL - ); - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " %d SNP protocol instances.\= n", BufferSize/sizeof (EFI_HANDLE))); - HandleBuffer =3D AllocateZeroPool (BufferSize); - if (HandleBuffer =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, " Falied to allocate buffer for the handles.= \n")); - return EFI_OUT_OF_RESOURCES; - } + do { + BufferSize =3D 0; + Status =3D gBS->LocateHandle ( + Registration =3D=3D NULL ? ByProtocol : ByRegister= Notify, + &gEfiSimpleNetworkProtocolGuid, + Registration, + &BufferSize, + NULL + ); + if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " %d SNP protocol instance(= s).\n", BufferSize/sizeof (EFI_HANDLE))); + HandleBuffer =3D AllocateZeroPool (BufferSize); + if (HandleBuffer =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, " Falied to allocate buffer for the handle= s.\n")); + return EFI_OUT_OF_RESOURCES; + } + + Status =3D gBS->LocateHandle ( + Registration =3D=3D NULL ? ByProtocol : ByRegisterNo= tify, + &gEfiSimpleNetworkProtocolGuid, + Registration, + &BufferSize, + HandleBuffer + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, " Falied to locate SNP protocol handles.\n= ")); + FreePool (HandleBuffer); + return Status; + } + } else if (EFI_ERROR (Status)) { + if (Registration !=3D NULL) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " No more newly installed= SNP protocol for this registration - %r.\n", Status)); + return EFI_SUCCESS; + } =20 - Status =3D gBS->LocateHandle ( - Registration =3D=3D NULL ? ByProtocol : ByRegisterNoti= fy, - &gEfiSimpleNetworkProtocolGuid, - Registration, - &BufferSize, - HandleBuffer - ); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, " Falied to locate SNP protocol handles.\n")= ); - FreePool (HandleBuffer); return Status; } - } else if (EFI_ERROR (Status)) { - return Status; - } =20 - // Check USB NIC on handles. - Status =3D CheckBmcUsbNicOnHandles (BufferSize/sizeof (EFI_HANDLE), Hand= leBuffer); - if (!EFI_ERROR (Status)) { - // Retrieve the rest of BMC USB NIC information for Redfish over IP in= formation - // and USB Network Interface V2. - Status =3D RetrievedBmcUsbNicInfo (); + // Check USB NIC on handles. + Status =3D CheckBmcUsbNicOnHandles (BufferSize/sizeof (EFI_HANDLE), Ha= ndleBuffer); if (!EFI_ERROR (Status)) { - DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " Install protocol to notif= y the platform Redfish Host Interface information is ready.\n")); - Status =3D gBS->InstallProtocolInterface ( - &Handle, - &mPlatformHostInterfaceBmcUsbNicReadinessGuid, - EFI_NATIVE_INTERFACE, - NULL - ); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, " Install protocol fail %r.\n", Status)); + // Retrieve the rest of BMC USB NIC information for Redfish over IP = information + // and USB Network Interface V2. + Status =3D RetrievedBmcUsbNicInfo (); + if (!EFI_ERROR (Status)) { + DEBUG ((DEBUG_REDFISH_HOST_INTERFACE, " Install protocol to not= ify the platform Redfish Host Interface information is ready.\n")); + Status =3D gBS->InstallProtocolInterface ( + &Handle, + &mPlatformHostInterfaceBmcUsbNicReadinessGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, " Install protocol fail %r.\n", Status)); + } } } - } =20 - FreePool (HandleBuffer); + FreePool (HandleBuffer); + } while (Registration !=3D NULL); + return Status; } =20 --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111650): https://edk2.groups.io/g/devel/message/111650 Mute This Topic: https://groups.io/mt/102762735/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 Sun May 12 18:58:57 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+111649+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 1700718897087751.4068170909676; Wed, 22 Nov 2023 21:54:57 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=dVtV+NIlORwxUJD3iidFIFLLGxe09xsVoHrcmNb0w9o=; 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=1700718896; v=1; b=pE2xU0uVyA1IOvkNeLDfpsa0U5I/PLtw1xY3+lS+d44gIcFDKejweiCdNMT6P3us549JwQJZ cXuVolEWOWeWJPXx6mSCRBZCdnNghiR7ttJqV6heA5vhyjNQnNe/83DgLcaRDVP5HOOfLuB7ZLA QnOwEFMKtDN7V0W0eUjMnTWI= X-Received: by 127.0.0.2 with SMTP id CNPsYY1788612xMYxm4KPNK5; Wed, 22 Nov 2023 21:54:56 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.79]) by mx.groups.io with SMTP id smtpd.web10.85465.1700718896220276845 for ; Wed, 22 Nov 2023 21:54:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y0VQ686ZQ/haDVA9ONGFu9I+38SsBLxH71Xw+bpo+zuooyEdX+9YiVFyy1ZhqXD/5aDYFz+GoghryjVIg2e+mge7EA8AvxhkO3BakYBKlJhGlB1YfHAr4a8oyWCe7GwzWw0L4cxem56WG5Nm+DUG8spd6/jTsqx74BG/1y5OJI5ovm8ImbxAt8RMY0Gns6Crj3Ir42b0lFT/dolP63jOIQnnnGzxvZ0g0kiLdy5yI7yI+4z9mn0kcNfC7jqIMPGsBejHdUsu/LRO5LQk1oc6gfIpbLKWNph0s5zXr5gfkq7zn2N6NpDhTByScKa1MUSePDHG7gXdPgU5Ph9BIPltVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LKMJTk2sepOJe2W+QgC6ewF5eEvLMWNUugeWDVwZ/3o=; b=nYesb60dHxGHRsd+knyKAysEsFFRwOHO78ARCx4TYgX4BxGOMIS5ARZURgYJIdv3MgFL3gOTuqdwB92QXwXmRcmD4L7htghoPJy43CEuHoVfrztqgr4WnEC56rQtQIMOeSsWbGbbiPP/d+z9486HPkvyYaew0PrApiEdnqSaJZeARZBnV2Z3YlgoWurRGGenUHM3LOmWwfw+yfAKa5dIltiGnfUwYK3ZThMxwM56WBWTZWQ9axDOSVCol8gDaaoNuqcrIE8VGZV7/X36M/fuCzLv0Np3Zqr3y/QpnXMa/p6HQUzFym5HvEzElKSJOURsJI5kaDDPYPeo6J6glVE9wg== 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 DS7PR03CA0071.namprd03.prod.outlook.com (2603:10b6:5:3bb::16) by CH0PR12MB5331.namprd12.prod.outlook.com (2603:10b6:610:d6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 05:54:54 +0000 X-Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com (2603:10b6:5:3bb:cafe::66) by DS7PR03CA0071.outlook.office365.com (2603:10b6:5:3bb::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19 via Frontend Transport; Thu, 23 Nov 2023 05:54:53 +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+111649+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 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 05:54:53 +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; Wed, 22 Nov 2023 23:54:49 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH 2/6] RedfishPkg/RedfishHostInterfaceDxe: Add Redfish HI readiness notification Date: Thu, 23 Nov 2023 13:54:28 +0800 Message-ID: <20231123055432.86-3-abner.chang@amd.com> In-Reply-To: <20231123055432.86-1-abner.chang@amd.com> References: <20231123055432.86-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: CY4PEPF0000E9D5:EE_|CH0PR12MB5331:EE_ X-MS-Office365-Filtering-Correlation-Id: 83cc0b1e-3988-431f-b842-08dbebe8b706 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 2sS+HKXT+pAWu8YiJImCKJDY5epXqUcfqyVDoX+W6A1l+Sumi7LYEiW6MppG2Figr59F4SjWQhLm15hjtIEljOKE1uLF/NGXWc2574koO/08WGk76fpVY4rwXl53hN4+SoXVz8K2SZghA9j1X9iheg5o9iZqysUVqBzSMQDZul3CK4v7EkM45ABBLKr/axtDHyicMNNEHZ3EXVLevOeQYpBHNRA2wgBZvB1zqyMYV9DN8sjgB0peAVPh0/JufnqcJ0l5deQkllc60BjnHtTGlD5m5FKHDCxzZFqK/EGuBtEG6pIoOHIr+CurdIey3VWY9aoKSlZvC1YSu/rbgAPUGkpj4bMT25UzXd6U0/+HQUGvykNSxmqDh92KeSADhLKoDsKjkz82AII9o8sbS3ZlKBy6IxSk8DeUg0oIvzbSUOQ7a3gl5TdIz/zhW6NpT8adl+fekNaMluSq6Hs9m3rt+7Flqn6eLsT3RJeeuJ/ybbrYXuWkJnOntuoocDM4znuDoJWm3uC6+GKCjy22le0GjPm1PElCoQJQZquB7vPNObq9KvrSSMgoXQ/vO5M8Cr8csT/HU2rbbv89VakpBUeMOJRRPIJS5TraAUipxx9ftba5nT8CXOSLzZ9HoW/eEvXZBdwfOxoXtFK9mAUgrAc5BmRcMiVmQQZAcKGJ/QV/vNrfgrvJ0ANJ7M+PBaMu1jlCwj2TciiQEyfBH3BjctgHWxPcLZabpEzPXRx8gCFWh8VR2xbjSLAtIU3cjsvykLADXlhQfYhM5Z8s+s4HfUG9qw== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 05:54:53.7574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83cc0b1e-3988-431f-b842-08dbebe8b706 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: CY4PEPF0000E9D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5331 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: gDNbjsMdnNINF56Fp2PNC5XHx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700718899328100003 Content-Type: text/plain; charset="utf-8" From: Abner Chang Introduce gEdkIIRedfishHostInterfaceReadyProtocolGuid and produce it when Redfish Host Interface is installed on system. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- RedfishPkg/RedfishPkg.dec | 3 +++ .../RedfishHostInterfaceDxe.inf | 3 ++- .../RedfishHostInterfaceDxe.c | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index 0f18865cea0..e40538247c2 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -90,6 +90,9 @@ ## Include/Protocol/EdkIIRedfishPlatformConfig.h gEdkIIRedfishPlatformConfigProtocolGuid =3D { 0X4D94A7C7, 0X4CE4, 0X4A84= , { 0X88, 0XC1, 0X33, 0X0C, 0XD4, 0XA3, 0X47, 0X67 } } =20 + # Redfish Host Interface ready notification protocol + gEdkIIRedfishHostInterfaceReadyProtocolGuid =3D { 0xC3F6D062, 0x3D38, 0x= 4EA4, { 0x92, 0xB1, 0xE8, 0xF8, 0x02, 0x27, 0x63, 0xDF } } + [Guids] gEfiRedfishPkgTokenSpaceGuid =3D { 0x4fdbccb7, 0xe829, 0x4b4c, { 0x= 88, 0x87, 0xb2, 0x3f, 0xd7, 0x25, 0x4b, 0x85 }} =20 diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf= b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf index 1cdae149aad..f969e75463f 100644 --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.inf @@ -43,7 +43,8 @@ UefiLib =20 [Protocols] - gEfiSmbiosProtocolGuid ## TO_START + gEfiSmbiosProtocolGuid ## TO_START + gEdkIIRedfishHostInterfaceReadyProtocolGuid ## PRODUCED =20 [Depex] gEfiSmbiosProtocolGuid diff --git a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c b= /RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c index 55a66decfc8..94c0f9b6a92 100644 --- a/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c +++ b/RedfishPkg/RedfishHostInterfaceDxe/RedfishHostInterfaceDxe.c @@ -53,7 +53,9 @@ RedfishCreateSmbiosTable42 ( SMBIOS_TABLE_TYPE42 *Type42Record; EFI_SMBIOS_PROTOCOL *Smbios; EFI_SMBIOS_HANDLE MemArrayMappedAddrSmbiosHandle; + EFI_HANDLE Handle; =20 + Handle =3D NULL; // // Get platform Redfish host interface device type descriptor data. // @@ -228,6 +230,20 @@ RedfishCreateSmbiosTable42 ( =20 Status =3D EFI_SUCCESS; =20 + // + // Install Redfish Host Interface ready protocol. + // + Status =3D gBS->InstallProtocolInterface ( + &Handle, + &gEdkIIRedfishHostInterfaceReadyProtocolGuid, + EFI_NATIVE_INTERFACE, + (VOID *)NULL + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to install gEdkIIRedfishHostInterfaceRead= yProtocolGuid.\n")); + DEBUG ((DEBUG_ERROR, "PlatformConfigHandler driver may not be triggere= d to acquire Redfish service.\n")); + } + ON_EXIT: if (DeviceDescriptor !=3D NULL) { FreePool (DeviceDescriptor); --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111649): https://edk2.groups.io/g/devel/message/111649 Mute This Topic: https://groups.io/mt/102762734/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 Sun May 12 18:58:57 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+111651+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 1700718898772161.98824568702798; Wed, 22 Nov 2023 21:54:58 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=vF9LDnChNP3NTFRLXPckgoHkngC5MUYACIgdgMO0Rek=; 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=1700718898; v=1; b=fEiqk8F8G0M4oA1VDeo1VQg4WXFmj326y6xPgNC3hVIy+3YGnx+WRZANh77EKt2fTS+K9TPs vxjzEH6NFwZkLfVkAedE8ghbp++Ad055VWDgNQ++sYAaWAkqflSIj3NUItYapejd36Pp9Zq5seb GS9NPYsZB9XT92hi9iQ0pZ5M= X-Received: by 127.0.0.2 with SMTP id qRMvYY1788612xUv6owpkCue; Wed, 22 Nov 2023 21:54:58 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.52]) by mx.groups.io with SMTP id smtpd.web11.85676.1700718897235581888 for ; Wed, 22 Nov 2023 21:54:57 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jreYdVKT9NRmThURf71Tdx6GlmS6jRTvSCJq5k5kTE7zCAVcTi3cO9g9J5VZGb0dpBn7Ulp9YEL8UDRa+DWQy2YdKjCIw97AD3K2If/qX4ZTkC1m145aCOBtSX/iop58njL9Sbi/9f/pjkbaxZ0rnCiy2+QgSxXjjsBHL4/0d0PcPZgIitUU//2C0cvG2YYfs6zSiFOsDF05ITbKRjyyEz5OA4FwVCYrjhT5tgNlGKCYzD9Zyi7VNcG1x8QXVwyNMwgpkqejZx88olA1tu+Da3EmqDBPjjgDjJObX0LBStyt3MF4GdpMj8FN1MubKBjVBam4ZzpNLlSxu0EhkfhX3g== 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=cAD7ZAxVUsLYkldcuSdQW2On4VIRSWItZNiAToy4bBQixVqczvdW509YPvA70RDj1BEwmX7k6+ecgFrcRSENWL1e3GhAPGIsa2wM9FpEDypVjfVvfbq5/Rf2oyrkz4nBqSqAiru4tGiw1+iSMvpqyvAgxxrgSMSRPySVIIQsO/B3c6HiLVeBwmvc83ODgsV5GJ6vpHjffOXdCf+LagWjumFZU2b+0APqaMSC/dZ+P4CscHxgoyo8npkAtCqgMZ6laMDGacW3QgSbZOsJvLFB/AT7wNoxzV3MCZXcwIq0AlBrzjMXLyehwy/2dPTdQkcl/vdw4v0GcTmINr80m+R0Ow== 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 DS7PR03CA0061.namprd03.prod.outlook.com (2603:10b6:5:3bb::6) by DM6PR12MB5005.namprd12.prod.outlook.com (2603:10b6:5:1be::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 05:54:54 +0000 X-Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com (2603:10b6:5:3bb:cafe::9c) by DS7PR03CA0061.outlook.office365.com (2603:10b6:5:3bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20 via Frontend Transport; Thu, 23 Nov 2023 05:54:54 +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+111651+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 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 05:54:54 +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; Wed, 22 Nov 2023 23:54:51 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH 3/6] RedfishPkg/RedfishConfigHandler: Use Redfish HI readiness notification Date: Thu, 23 Nov 2023 13:54:29 +0800 Message-ID: <20231123055432.86-4-abner.chang@amd.com> In-Reply-To: <20231123055432.86-1-abner.chang@amd.com> References: <20231123055432.86-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: CY4PEPF0000E9D5:EE_|DM6PR12MB5005:EE_ X-MS-Office365-Filtering-Correlation-Id: 54f68bdc-cdb7-4702-78c6-08dbebe8b768 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: ubQrUJbc1AfHL7asggvOCGPPc1UwubHe1mfxYTy5NR/qzxX6QF+CtOeQ1fSBRpqvjMEi5bvBmYJYq2igptcpSkfyAD8bep7KMYkTGwwx5AETeySLDwofHH5m5zGHgp7a7WArScWpxx4V5aN27mA7lly/9Q3p98pdWdrWkyHirW0tbOdqMVALFHxrg7+ZELdaAiItC2s1geIenqgZTXHgLEDaFNf8KH/TSlsVXzYsR73Yl3yr4rV6Lp+PSB1fJGOlHOSO6tZ3Zfud6LIgZvCVvBy6YBucIohEy3q1xjWQB6akIHMoSenFSHQapjFYjWmU784xjH0MO1XVqU/qsy0fLe+u2ZqGCgAvthOu2AJKtoLaw0njEikgC4EPi4klyQvnYX/Xm3Kmiod2zty+AKjobKPvpDbEamEWw7XZHu4Z/C3mbY/hunEy4FBlY9xE1+Uf83ySlvUe4yX5s3MoxvkGl1yHLLPFoYDhHATkNps/sV24lqxSihYD2AFrNHcx/IbjAxD2YANV1MHgGjQa2eomheJDnLTt8/0OlUrkIKTJHJHv0ezZO1TrCx/3sfMGrBtup4QcuK67FOtC4CTkpNCpBt38bDPgKP5/SZN04ofsoGQLinj85wyCUAnSTH6676iPdK6MT3QJAm3hciYUGYduFuSXCi5VPc+o8D8x4PZ2Xj2ul1DKun0vJ0Zq4ur5+BR6bX/P9Alrznb0V1ZN/i8VvPQLy5tiP59XotYs+9uL19KokQjBVGNKnG/KLHNmD5zQkv641qsGH6Zp1MzYc0NykA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 05:54:54.3511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 54f68bdc-cdb7-4702-78c6-08dbebe8b768 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: CY4PEPF0000E9D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB5005 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: x5dJQu75qRfOUojMB4ImOnAvx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700718899366100005 Content-Type: text/plain; charset="utf-8" From: Abner Chang Wait until Redfish Host Interface is installed on the system then acquire Redfish service. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../RedfishConfigHandlerDriver.inf | 9 +- .../RedfishConfigHandlerDriver.c | 168 ++++++++++++------ 2 files changed, 116 insertions(+), 61 deletions(-) diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf= b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf index b167c6e1ee4..aed93f570cf 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf @@ -46,11 +46,12 @@ UefiDriverEntryPoint =20 [Protocols] - gEfiRedfishDiscoverProtocolGuid ## CONSUMES + gEfiRedfishDiscoverProtocolGuid ## CONSUMES gEfiRestExServiceBindingProtocolGuid - gEfiRestExProtocolGuid ## CONSUMES - gEdkIIRedfishCredentialProtocolGuid ## CONSUMES - gEdkIIRedfishConfigHandlerProtocolGuid ## CONSUMES + gEfiRestExProtocolGuid ## CONSUMES + gEdkIIRedfishCredentialProtocolGuid ## CONSUMES + gEdkIIRedfishConfigHandlerProtocolGuid ## CONSUMES + gEdkIIRedfishHostInterfaceReadyProtocolGuid ## CONSUMES =20 [Guids] gEfiEventExitBootServicesGuid ## CONSUMES ## Event diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c b= /RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c index f987cc67a69..b421f51374d 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c @@ -17,11 +17,15 @@ EFI_EVENT gEfiRedfishDiscoverProtocolEvent =3D NULL; // // Variables for using RFI Redfish Discover Protocol // -VOID *gEfiRedfishDiscoverRegistration; -EFI_HANDLE gEfiRedfishDiscoverControllerHandle =3D NUL= L; -EFI_REDFISH_DISCOVER_PROTOCOL *gEfiRedfishDiscoverProtocol =3D NUL= L; -BOOLEAN gRedfishDiscoverActivated =3D FAL= SE; -BOOLEAN gRedfishServiceDiscovered =3D FAL= SE; +VOID *gEfiRedfishDiscoverRegistration; +EFI_HANDLE gEfiRedfishDiscoverControllerHandl= e =3D NULL; +EFI_REDFISH_DISCOVER_PROTOCOL *gEfiRedfishDiscoverProtocol = =3D NULL; +BOOLEAN gRedfishDiscoverActivated = =3D FALSE; +BOOLEAN gRedfishServiceDiscovered = =3D FALSE; +EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *mNetworkInterfaces = =3D NULL; +UINTN mNumberOfNetworkInterfaces; +EFI_EVENT mEdkIIRedfishHostInterfaceReadyEve= nt; +VOID *mEdkIIRedfishHostInterfaceRegistr= ation; =20 /// /// Driver Binding Protocol instance @@ -339,6 +343,83 @@ RedfishServiceDiscoveredCallback ( FreePool (RedfishDiscoveredToken); } =20 +/** + Callback function executed when the gEdkIIRedfishHostInterfaceReadyProto= colGuid + protocol interface is installed. + + @param[in] Event Event whose notification function is being invoked. + @param[in] Context Pointer to the Context buffer + +**/ +VOID +EFIAPI +AcquireRedfishServiceOnNetworkInterfaceCallback ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *ThisNetworkInterface; + UINTN NetworkInterfaceIndex; + EFI_REDFISH_DISCOVERED_TOKEN *ThisRedfishDiscoveredToken; + + ThisNetworkInterface =3D mNetworkInterfaces; + // + // Loop to discover Redfish service on each network interface. + // + for (NetworkInterfaceIndex =3D 0; NetworkInterfaceIndex < mNumberOfNetwo= rkInterfaces; NetworkInterfaceIndex++) { + ThisRedfishDiscoveredToken =3D (EFI_REDFISH_DISCOVERED_TOKEN *)Allocat= eZeroPool (sizeof (EFI_REDFISH_DISCOVERED_TOKEN)); + if (ThisRedfishDiscoveredToken =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Not enough memory for EFI_REDFISH_DISCOVER= ED_TOKEN.\n", __func__)); + return; + } + + ThisRedfishDiscoveredToken->Signature =3D REDFISH_DISCOVER_TOKEN_SIGNA= TURE; + + // + // Initial this Redfish Discovered Token + // + Status =3D gBS->CreateEvent ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + RedfishServiceDiscoveredCallback, + (VOID *)ThisRedfishDiscoveredToken, + &ThisRedfishDiscoveredToken->Event + ); + if (EFI_ERROR (Status)) { + FreePool (ThisRedfishDiscoveredToken); + DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discove= red token.\n", __func__)); + return; + } + + // + // Acquire for Redfish service which is reported by + // Redfish Host Interface. + // + Status =3D gEfiRedfishDiscoverProtocol->AcquireRedfishService ( + gEfiRedfishDiscoverProtocol, + gRedfishConfigData.Image, + ThisNetworkInterface, + EFI_REDFISH_DISCOVER_HOST_INTE= RFACE, + ThisRedfishDiscoveredToken + ); + + // + // Free Redfish Discovered Token if Discover Instance was not created = and + // Redfish Service Discovered Callback event was not triggered. + // + if ((ThisRedfishDiscoveredToken->DiscoverList.NumberOfServiceFound =3D= =3D 0) || + EFI_ERROR (ThisRedfishDiscoveredToken->DiscoverList.RedfishInstanc= es->Status)) + { + gBS->CloseEvent (ThisRedfishDiscoveredToken->Event); + DEBUG ((DEBUG_ERROR, "%a: Free Redfish discovered token - %x.\n", __= func__, ThisRedfishDiscoveredToken)); + FreePool (ThisRedfishDiscoveredToken); + } + + ThisNetworkInterface++; + } +} + /** Callback function executed when the EFI_REDFISH_DISCOVER_PROTOCOL protocol interface is installed. @@ -354,13 +435,10 @@ RedfishDiscoverProtocolInstalled ( OUT VOID *Context ) { - EFI_STATUS Status; - UINTN BufferSize; - EFI_HANDLE HandleBuffer; - UINTN NetworkInterfaceIndex; - EFI_REDFISH_DISCOVER_NETWORK_INTERFACE *ThisNetworkInterface; - EFI_REDFISH_DISCOVERED_TOKEN *ThisRedfishDiscoveredToken; - UINTN NumberOfNetworkInterfaces; + EFI_STATUS Status; + UINTN BufferSize; + EFI_HANDLE HandleBuffer; + VOID *RedfishHostInterfaceReadyProtocol; =20 DEBUG ((DEBUG_MANAGEABILITY, "%a: New network interface is installed on = system by EFI Redfish discover driver.\n", __func__)); =20 @@ -401,67 +479,43 @@ RedfishDiscoverProtocolInstalled ( Status =3D gEfiRedfishDiscoverProtocol->GetNetworkInterfaceList ( gEfiRedfishDiscoverProtocol, gRedfishConfigData.Image, - &NumberOfNetworkInterfaces, - &ThisNetworkInterface + &mNumberOfNetworkInterfaces, + &mNetworkInterfaces ); - if (EFI_ERROR (Status) || (NumberOfNetworkInterfaces =3D=3D 0)) { + if (EFI_ERROR (Status) || (mNumberOfNetworkInterfaces =3D=3D 0)) { DEBUG ((DEBUG_ERROR, "%a: No network interfaces found on the handle.\n= ", __func__)); return; } =20 // - // Loop to discover Redfish service on each network interface. + // Check if Redfish Host Interface is ready or not. // - for (NetworkInterfaceIndex =3D 0; NetworkInterfaceIndex < NumberOfNetwor= kInterfaces; NetworkInterfaceIndex++) { - ThisRedfishDiscoveredToken =3D (EFI_REDFISH_DISCOVERED_TOKEN *)Allocat= eZeroPool (sizeof (EFI_REDFISH_DISCOVERED_TOKEN)); - if (ThisRedfishDiscoveredToken =3D=3D NULL) { - DEBUG ((DEBUG_ERROR, "%a: Not enough memory for EFI_REDFISH_DISCOVER= ED_TOKEN.\n", __func__)); - return; - } - - ThisRedfishDiscoveredToken->Signature =3D REDFISH_DISCOVER_TOKEN_SIGNA= TURE; - - // - // Initial this Redfish Discovered Token - // + Status =3D gBS->LocateProtocol (&gEdkIIRedfishHostInterfaceReadyProtocol= Guid, NULL, &RedfishHostInterfaceReadyProtocol); + if (!EFI_ERROR (Status)) { + // Acquire Redfish service; + AcquireRedfishServiceOnNetworkInterfaceCallback ((EFI_EVENT)NULL, (VOI= D *)NULL); + } else { Status =3D gBS->CreateEvent ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - RedfishServiceDiscoveredCallback, - (VOID *)ThisRedfishDiscoveredToken, - &ThisRedfishDiscoveredToken->Event + AcquireRedfishServiceOnNetworkInterfaceCallback, + NULL, + &mEdkIIRedfishHostInterfaceReadyEvent ); if (EFI_ERROR (Status)) { - FreePool (ThisRedfishDiscoveredToken); - DEBUG ((DEBUG_ERROR, "%a: Failed to create event for Redfish discove= red token.\n", __func__)); + DEBUG ((DEBUG_ERROR, "%a: Failed to create event for gEdkIIRedfishHo= stInterfaceReadyProtocolGuid installation.", __func__)); return; } =20 - // - // Acquire for Redfish service which is reported by - // Redfish Host Interface. - // - Status =3D gEfiRedfishDiscoverProtocol->AcquireRedfishService ( - gEfiRedfishDiscoverProtocol, - gRedfishConfigData.Image, - ThisNetworkInterface, - EFI_REDFISH_DISCOVER_HOST_INTE= RFACE, - ThisRedfishDiscoveredToken - ); - - // - // Free Redfish Discovered Token if Discover Instance was not created = and - // Redfish Service Discovered Callback event was not triggered. - // - if ((ThisRedfishDiscoveredToken->DiscoverList.NumberOfServiceFound =3D= =3D 0) || - EFI_ERROR (ThisRedfishDiscoveredToken->DiscoverList.RedfishInstanc= es->Status)) - { - gBS->CloseEvent (ThisRedfishDiscoveredToken->Event); - DEBUG ((DEBUG_ERROR, "%a: Free Redfish discovered token - %x.\n", __= func__, ThisRedfishDiscoveredToken)); - FreePool (ThisRedfishDiscoveredToken); + Status =3D gBS->RegisterProtocolNotify ( + &gEdkIIRedfishHostInterfaceReadyProtocolGuid, + mEdkIIRedfishHostInterfaceReadyEvent, + &mEdkIIRedfishHostInterfaceRegistration + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Fail to register event for the installatio= n of gEdkIIRedfishHostInterfaceReadyProtocolGuid.", __func__)); + return; } - - ThisNetworkInterface++; } =20 return; --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111651): https://edk2.groups.io/g/devel/message/111651 Mute This Topic: https://groups.io/mt/102762736/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 Sun May 12 18:58:57 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+111652+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 1700718899997636.828751989371; Wed, 22 Nov 2023 21:54:59 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=spwp27ZA0atsu0m44iO3mQjHIKJ3dK2BTWoiX/J9mxs=; 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=1700718899; v=1; b=DMJwkK5JIGhRuG2N2qomfoe8Pyfal44RdNHfBMGqfq2kJlasV1EPWUpRepQS79dhdC95P2rg LLmg7TJuUGdBz3haHKuzW+v7CAdFnQKS3HK8+eYKgqq3HEzrakaQpi0vlkQQGuSUY9tnWdMjjLX o2shrWcrSoc4WT1ItiSG1640= X-Received: by 127.0.0.2 with SMTP id 0rbtYY1788612x9nUlJqAhS9; Wed, 22 Nov 2023 21:54:59 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.68]) by mx.groups.io with SMTP id smtpd.web10.85468.1700718899086118151 for ; Wed, 22 Nov 2023 21:54:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lhd9T4K1c6ynztmUXXhY744w9VGWK1IiqE4tGzdnlKSXxMo1Zxpqh9AgCkVZcgz+8iP3L2VPCZpOwwpq+6dBHcDf6BD81WNLUkuU0YgWbFrledk6ML/nUpJYqP3ajcDaYJb7TJm31VHdXsZCsG8a2oNzPwaaoqxkonSlxDdDMiOYu6Ga7cF0enZjXwR2za4hoNN2nYrcrqo6zzKNvWNYmGsSRw13mxHN239qr6iwY2pTS3zM2OnGdeHl+86sy3KonST4DpXNWuFiG3ZJO52tjGUJs1Z5umpjakUTFoHRsG7NPndl+9b2hqBtGna2aNh20Z5F4bpOj4upaxvPnu6CWg== 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=jKDNPiGohtyLaBhjxU+lxlqcgLGL/7fna1rZRlZEZmxRk6l0NVK9GgOWJOjv+48WsbnAJYHIheaHpBbczl2GCwCr5bkGciIbwAWMwnI0SB5KgJhMQHcBOrVLRbPaCCguztW5Kyy77cVV/ZFdsbVB/omn6uzvaVWsWC+oegQ6284j1dPJkkUlSoxZ8m2D9dIw4cjbkB4p0n6X+SNSFdIeLqSwo+MeXsanESEhQ80EkEY2Orm91BQMDIyDxe5iANTIkG+nlpxZkSukXR97Ccm/a/qJPxjp3Of4cksCgf315rZ45NE2V/QOPGnB7QvuN8vG0+yYyZeZ1eqAizY6b0YXLQ== 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 DS7PR03CA0087.namprd03.prod.outlook.com (2603:10b6:5:3bb::32) by PH7PR12MB8153.namprd12.prod.outlook.com (2603:10b6:510:2b0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Thu, 23 Nov 2023 05:54:55 +0000 X-Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com (2603:10b6:5:3bb:cafe::3e) by DS7PR03CA0087.outlook.office365.com (2603:10b6:5:3bb::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19 via Frontend Transport; Thu, 23 Nov 2023 05:54:55 +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+111652+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 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 05:54:54 +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; Wed, 22 Nov 2023 23:54:53 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH 4/6] RedfishPkg/RedfishConfigHandler: Correct the prototype of callback function Date: Thu, 23 Nov 2023 13:54:30 +0800 Message-ID: <20231123055432.86-5-abner.chang@amd.com> In-Reply-To: <20231123055432.86-1-abner.chang@amd.com> References: <20231123055432.86-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: CY4PEPF0000E9D5:EE_|PH7PR12MB8153:EE_ X-MS-Office365-Filtering-Correlation-Id: f137f4de-1228-4363-3abb-08dbebe8b7ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: Lkx/WOhAG6flTX7LwOF+V+VsCH1750mzLlzPuOz3fkUUyAgdLBqfabBd/pCLOAIzm/y8LXcyM69opwn/S5FWt62IHYs4lB09gzMHa7qcPd8xLvldJGA914j3Xl7dZvcskrM5bkRdxR+mGqxAcn3bOjecnNWkMnhpfOxSLInudu05knI9oA/a/FrIjaGbwygHtijW2ecTPaLpKDUX6vGv0QuWJ6oJor6vmplMGzVASHU6NU2hp9f9zF9WxYj6aunKN7vrjxPyxMTH8beUkZ6KMwkk/w+VsUMFpcalZb/NmZR5L9O4sXoJ5+HYBYNs+sZkl0IyLsSD9bcFIsb81VKZxUapAs4vp4eLrFbqOgvjuWaylWeZuqSjTdecew4LlRWGbSH02U+fuUCRHSktAl6ME9R7rAR7kFkOtk0PX1mwGkYsectW65Kz2tERIxpp89EQiL95P5ALIG4KTHDoN9O4wDkdEwRL8sglSvxaHelxluU8hyAaL/HcPnIbTS39ibBDJ0e1bdfpMHyy8XL9ICAk/nIfsiSqCjhLjpvheZCzVT87nlwG/pqOjZ6giEw7GicMHwlo725nMRxLNnQ5MbpUG/Fn3ShcmdKsRS/JIh7E8J/MOFtHFpnC1I3yfj6Pj9XI67YXURv3LGJEwRbh3LzUt+f2d3RiunBnH89AY1Y0fi01ftt2STi4RHT51lRaoHlV9ePdoZpeVieJPrKVFGVpjwNY95nbJwsouU2eiDuhRly2+3MNv9+n18t9juacRmIUjkqywgj0Pm/j+unNXYYW7Q== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 05:54:54.8355 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f137f4de-1228-4363-3abb-08dbebe8b7ab 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: CY4PEPF0000E9D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8153 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: Z83SjfJ05OcAm91rY1y1MUp1x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700718901284100015 Content-Type: text/plain; charset="utf-8" From: Abner Chang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c b= /RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c index b421f51374d..2d0170d8861 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c @@ -425,14 +425,14 @@ AcquireRedfishServiceOnNetworkInterfaceCallback ( protocol interface is installed. =20 @param[in] Event Event whose notification function is being invoked. - @param[out] Context Pointer to the Context buffer + @param[in] Context Pointer to the Context buffer =20 **/ VOID EFIAPI RedfishDiscoverProtocolInstalled ( IN EFI_EVENT Event, - OUT VOID *Context + IN VOID *Context ) { EFI_STATUS Status; --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111652): https://edk2.groups.io/g/devel/message/111652 Mute This Topic: https://groups.io/mt/102762739/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 Sun May 12 18:58:57 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+111653+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 1700718924504813.3567012698816; Wed, 22 Nov 2023 21:55:24 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=H4/cFmP80oPrbzPhSWeWLYWDoRbFpvdMlUnluC7JBrE=; 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=1700718924; v=1; b=tebcsSg0Neo46HGpUbdlms4fdQ2KVFfpRvFTyEEW+xXPSKWgw6WjTuAQPT9BJLyYk/v6gljy j+SQJSttvyEvGjlIMyeC7+El3RunutA8i6ST+gasAmdsyKOxIC8djIhraaHLQ2HHx9eZxwS9iKf Z9ohEFjRNI/z6NFhsZ1mXQeU= X-Received: by 127.0.0.2 with SMTP id w8fyYY1788612xf1mYPGIipI; Wed, 22 Nov 2023 21:55:24 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.40]) by mx.groups.io with SMTP id smtpd.web10.85476.1700718923456955638 for ; Wed, 22 Nov 2023 21:55:23 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZSKPe6bUcz71/Hor1+mI3tgBURHP7vFkX/Vl5Ot369vvQPPSsu8FFvcdr2OtM9OOOYG5yQSHd029OPGCIkUi0UFR88zaY8+8aL9BkBDetA5NZt65Oz9wRCagtVNHIobavWON1p0mu3ZW3uOhFdsOKtif9QS1YoclXlSNPKgEcn4+s+00vdfHgvRLS+WuRZlqzW9um+bIBf2vDBxZlgJFLwA3f7GV6G7RM5ONzu11BF4SIMFUIqzqHMa3i5hbAMoqZpW8gM0zcAKd7YfBqM9OVlQlWAw2Lsa1wMipulqcDDpdMxXuYaODv1GXbJp1/hSPE0Z828NhJ4IEfK39UXJJw== 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=ULgkxT+3oUcHkp1T8XCGYZ8cmn8RjdWBQlFP2umJ0Ngm7i76JxkX2jeoVS0dB0v7EuKAv+E9aU1pBYj9iAgDzPCzRkFJQ2xSqGxn+JaHEtDM/7dxAHChi5N0ChefxD0Hx6cmZonx3i91oCzSt3EgtbG3EjgK2cpuHZz2MVWQzIlIgd4Er44RNK1zQ2XrY3sN5/zx6+s1351mD2ns+wywMJrzPqQdcrtH7J++EoH3u5XWKbQZrcR16F+6hnHJVi02on8sSgcQ56XxLEqHqKPWi9UHklEtZjBHtEY4QP7C1mCyTugWJT1fTyZZSFy0fr9geXq3QiGeNGhLDwVZtvRfEA== 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 DS7PR03CA0113.namprd03.prod.outlook.com (2603:10b6:5:3b7::28) by IA1PR12MB6460.namprd12.prod.outlook.com (2603:10b6:208:3a8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Thu, 23 Nov 2023 05:55:21 +0000 X-Received: from CY4PEPF0000E9D6.namprd05.prod.outlook.com (2603:10b6:5:3b7:cafe::d) by DS7PR03CA0113.outlook.office365.com (2603:10b6:5:3b7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19 via Frontend Transport; Thu, 23 Nov 2023 05:55:20 +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+111653+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 CY4PEPF0000E9D6.mail.protection.outlook.com (10.167.241.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 05:55:20 +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; Wed, 22 Nov 2023 23:54:54 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH 5/6] RedfishPkg/RedfishDiscovery: Add more debug message Date: Thu, 23 Nov 2023 13:54:31 +0800 Message-ID: <20231123055432.86-6-abner.chang@amd.com> In-Reply-To: <20231123055432.86-1-abner.chang@amd.com> References: <20231123055432.86-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: CY4PEPF0000E9D6:EE_|IA1PR12MB6460:EE_ X-MS-Office365-Filtering-Correlation-Id: 616ea4e1-4b05-4fd0-a540-08dbebe8c717 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: l7R+gXvvwuXb2/VYcRcnCBCErsemPbhXJQSTEjIfwJqUtMGt+drGKIe6iZQpNHWhgOy8sZtCF8u7fXUjAeah2BJaEecHTKTbMldffsO3qMEF8OqPQGglNuQoJn8RRI+Tjvc87wjGl6ytyYUhi6PrrxKWdPfnBCC9y7CeDRzTm2QWce5doSXuNCrjTvV/NVAeI2Fx/zpu2bPRyUk5ucw7JPZPImp0VWH9svBQH3D32uU+Q7vdpKJf/GC1Ujj/5hfR2v+Bwtreh0rOLe2eR19DJX7SUPizLMg/NZDdSWKzTbbVy4LtASp1Be/AC4j95OH4n0uieNnj9Fj6OXDvYneNnZgi50TGmcN4S+azKO7ihfUBriNCIHuBwsP4VINF+UJvTRhpKYSpcKi/x4qxJEg7w3ACpPpmrFuXMtLyUt3NtA1AihiWcdkuxKSGR+fkEMLKbXKar7ZU0SyEsnef5LWLaKZxMnNjzccHx1unWCHJFbG/JeKJ7mORUqjb1hUYK3gmYHukbY37Yzb4/v8tl9cgPSNqokwW4BmNspr33SIVWgYaJrNDXLx7AfMapb0xTuwLfU3mlDtNwdYd/YfOliwWVZihXWPExBawCKR7gezwqrFshx1tZxAnPvjMNrQo0z0do98GLVHl1l7FDUV+qMw5x4vD24nROjDmkAA3lecjBPenvyWXsrni/0tKvbd7x3PDU+MBw6UfaKe0SrObyz+VMp0qFr0AWs9yg0VxPhSQby4bUEIUTOhTYOU3tVQfQOgVXldFOUr5mXWgijYPyqzokQ== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 05:55:20.6337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 616ea4e1-4b05-4fd0-a540-08dbebe8c717 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: CY4PEPF0000E9D6.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6460 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: pawc8cB7rtIG8bg537yp1Rg5x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700718925380100003 Content-Type: text/plain; charset="utf-8" From: Abner Chang Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../RedfishDiscoverDxe/RedfishDiscoverDxe.c | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c b/RedfishPk= g/RedfishDiscoverDxe/RedfishDiscoverDxe.c index 28ba2d3a9fc..833ae2b969f 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverDxe.c @@ -603,6 +603,27 @@ DiscoverRedfishHostInterface ( } =20 if (MacCompareStatus !=3D 0) { + DEBUG ((DEBUG_ERROR, "%a: MAC address is not matched.\n", __func__)); + DEBUG (( + DEBUG_ERROR, + " NetworkInterface: %02x %02x %02x %02x %02x %02x.\n", + Instance->NetworkInterface->MacAddress.Addr[0], + Instance->NetworkInterface->MacAddress.Addr[1], + Instance->NetworkInterface->MacAddress.Addr[2], + Instance->NetworkInterface->MacAddress.Addr[3], + Instance->NetworkInterface->MacAddress.Addr[4], + Instance->NetworkInterface->MacAddress.Addr[5] + )); + DEBUG (( + DEBUG_ERROR, + " Redfish Host interface: %02x %02x %02x %02x %02x %02x.\n", + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[0], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[1], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[2], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[3], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[4], + DeviceDescriptor->DeviceDescriptor.UsbDeviceV2.MacAddress[5] + )); return EFI_UNSUPPORTED; } =20 @@ -716,6 +737,8 @@ DiscoverRedfishHostInterface ( IsHttps ); } + } else { + DEBUG ((DEBUG_ERROR, "%a: RedfishGetHostInterfaceProtocolData is faile= d.\n", __func__)); } =20 return Status; --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111653): https://edk2.groups.io/g/devel/message/111653 Mute This Topic: https://groups.io/mt/102762746/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 Sun May 12 18:58:57 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+111654+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 1700718929612638.4026373751077; Wed, 22 Nov 2023 21:55:29 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=pLs0K+NEmE6RsRgi9FFXGHYH7QTEMv17LdV+CN4OoTc=; 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=1700718929; v=1; b=lwCKjE0f7nAEt8SoebsoGMVfHN+/4oCbXZQMbRUl1AWJGEjtggUv7DZZzelC9g+u3rF3uVzE iWDc3Nr7RnqfzZJndI17cE0cP9/soOEy4JLpcu1ZbbEX+7+G4V6RPeZn2GMiqEWUz/cfzLKyzjV xidKQIYSNs2cbTBFmlOyXsR8= X-Received: by 127.0.0.2 with SMTP id OTtlYY1788612xKoMFJHMlID; Wed, 22 Nov 2023 21:55:29 -0800 X-Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.72]) by mx.groups.io with SMTP id smtpd.web10.85477.1700718928728524494 for ; Wed, 22 Nov 2023 21:55:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YYQt7Aicw+BdjabRkqtuOcl4qlfA3aEI7AAnBcOtqlMiiXFbl+ljU50xJ9d1MeXTfW8TLUllqdBxGB9w71sC6qHofVE+kckW9IChcAZ3wdJIzhrYVSH69kCEHSHNe67t2IoxLxCBs3eio/f29DgKvuJ0SXxV1pAC304WLdiiGxR3SwgXNVLepQI5Nx2V2hOAJ+AbBOyHm8/q/zyQH397stqxLu61BH986fsxpjbXON53dJ0DuXJlK5dOAEVMaksQUlML5jHAJEeFth2ilUR6JcBWe8kgKAy81ENKukgkMr/cpDIskcIR+x8+mmltrJ6uY1rF4mMkQrIHHlvrPtEt3Q== 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=CWRyvg+hnTWN6k5Zt26T72ZmnlHPe9pAZWUQHJ1jgrOaeBJMh3RaT6uARdoK/KZYm6TE5A+GRTwpWj5vugAWVw1hsDd8PAK4XXIEhzVmsclQ+ds1C4GVFXjW5qFqeDLUg96YVM2mBQ8vmUAjyWVHnqFRh3HOcAe1pesxSLyG6QCUq7h5kY+kFeseg8Q4+PSwxtabpepBZ81vlZ3gE9R1Lg5G/ACG+4uIDRN3qXElyZ/xePGzorrZxxedsw+Y6Hp2cLXUUUJY8iMCZh1+8h3KNpVPrO+MDvxLDpsBfmtm+23Zhgqg2FGEwkhoqUW5o94PX/ehyrbrJpajSCB9FUbr4Q== 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 DS7PR03CA0074.namprd03.prod.outlook.com (2603:10b6:5:3bb::19) by SA1PR12MB6946.namprd12.prod.outlook.com (2603:10b6:806:24d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.19; Thu, 23 Nov 2023 05:55:26 +0000 X-Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com (2603:10b6:5:3bb:cafe::91) by DS7PR03CA0074.outlook.office365.com (2603:10b6:5:3bb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20 via Frontend Transport; Thu, 23 Nov 2023 05:55:26 +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+111654+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 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7025.12 via Frontend Transport; Thu, 23 Nov 2023 05:55:25 +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; Wed, 22 Nov 2023 23:55:20 -0600 From: "Chang, Abner via groups.io" To: CC: Nickle Wang , Igor Kulchytskyy , Mike Maslenkin Subject: [edk2-devel] [PATCH 6/6] RedfishPkg/RedfishDiscovery: Refine SMBIOS 42h code Date: Thu, 23 Nov 2023 13:54:32 +0800 Message-ID: <20231123055432.86-7-abner.chang@amd.com> In-Reply-To: <20231123055432.86-1-abner.chang@amd.com> References: <20231123055432.86-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: CY4PEPF0000E9D5:EE_|SA1PR12MB6946:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d258154-3ad1-43fe-1ae6-08dbebe8ca23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: NmSqwOwnUBN2Xkb0LGqJbxflZEF19bhN0zuxxGDhaPadcrrlz5/LDm9BpliSqObBIFvkHCsgYlTOC+gGzg51mm+XK+lo5gBH5XZe//9Zgk14xaU9jVE1Ed3NasjcuJnOxbpkM1JdQuXihmQNVd0NRAdlVjQyjOHJuSk9aSBvAaRCDD2egApcru6dv81HhDaYIsesUHW6l3vR9/qS8K71XeSTSa8xa7X6dMFD4g3STdkhZZqiJM43j1JYbEkz0vJDh4wCoysfSS0/LGyuFByP4kFeZ02xJ62QGGO0asaMr0D8qlQYNQLnMxbMaV14om7e+qDDQph7PhQ7tRJdkl8XzoPS974yJcHgpIvbR4jBiFoO1fk1b60m7MSoWwOz3JXsj4kKCVv+4Lc1V5Et6R7iCGnhZ0r+yuSwxTs5NMgEcuoevzMJqL6nUyqq6p59f/s3U5wvuTxDvAxcuyVmnBBjLs2R8PEpwEIkcbuWg8SihvLkEK70jn9YUQUwG6ZB21YSeNqtPXHVFuDLscWaqIUuVjBOylaRUjQu4QiSTVKWw0uFvYJMHh/sMl9Q4z4iEQGsy/MgSsr8tNY28G9pe+BmkHav9MJP6oDOTCyf7IOYXhOckCrZC8IDCHL/s20LD4+e9fo75zSWHX9Ys5PESJOH54/P/+3PV3zNtCXUSS3/EEzWyAQT8N4kWpEfnGTeAeCbWxznLPrD1PDyZMz7sGrmkP/VPyTNLCMNj9g2IWRVjfLBlErUFg+ZhgtjapKg8hka3n2DhRxJWHfGFGWHrzulhmGzFq9eq6K41SzuFkUkW/o= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 05:55:25.8045 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d258154-3ad1-43fe-1ae6-08dbebe8ca23 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: CY4PEPF0000E9D5.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6946 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: crqQcYCpw709J4VQZFFzXZ1ox1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700718931401100003 Content-Type: text/plain; charset="utf-8" From: Abner Chang Refine SMBIOS 42h code add mode debug message for the error conditions. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Cc: Mike Maslenkin --- .../RedfishDiscoverInternal.h | 2 ++ .../RedfishSmbiosHostInterface.c | 20 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h b/Redf= ishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h index e27cfa76e39..de7faa4f975 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishDiscoverInternal.h @@ -42,6 +42,8 @@ #define MAC_COMPARE(This, Target) (CompareMem ((VOID *)&(This)->MacAddres= s, &(Target)->MacAddress, (This)->HwAddressSize) =3D=3D 0) #define VALID_TCP6(Target, This) ((Target)->IsIpv6 && ((This)->NetworkPr= otocolType =3D=3D ProtocolTypeTcp6)) #define VALID_TCP4(Target, This) (!(Target)->IsIpv6 && ((This)->NetworkP= rotocolType =3D=3D ProtocolTypeTcp4)) +#define REDFISH_HI_ITERFACE_SPECIFIC_DATA_LENGTH_OFFSET ((UINT16)(UINTN)(= &((SMBIOS_TABLE_TYPE42 *)0)->InterfaceTypeSpecificDataLength)) +#define REDFISH_HI_PROTOCOL_HOSTNAME_LENGTH_OFFSET ((UINT16)(UINTN)(= &((REDFISH_OVER_IP_PROTOCOL_DATA *)0)->RedfishServiceHostnameLength)) =20 // // GUID definitions diff --git a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c b/R= edfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c index 0d6edc7dc35..57665f367be 100644 --- a/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c +++ b/RedfishPkg/RedfishDiscoverDxe/RedfishSmbiosHostInterface.c @@ -56,7 +56,7 @@ RedfishGetHostInterfaceProtocolData ( mType42Record =3D (SMBIOS_TABLE_TYPE42 *)Record; if (mType42Record->InterfaceType =3D=3D MCHostInterfaceTypeNetworkHo= stInterface) { ASSERT (Record->Length >=3D 9); - Offset =3D 5; + Offset =3D REDFISH_HI_ITERFACE_SPECIFIC_DATA_LENGTH_OFFSET; RecordTmp =3D (UINT8 *)Record + Offset; // // Get interface specific data length. @@ -70,11 +70,13 @@ RedfishGetHostInterfaceProtocolData ( // if ((*RecordTmp =3D=3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCIE= _V2) || (*RecordTmp =3D=3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_USB_V2)) { if (*RecordTmp =3D=3D REDFISH_HOST_INTERFACE_DEVICE_TYPE_PCI_PCI= E_V2) { + // According to Redfish Host Interface specification, add addi= tional one byte for Device Type field. if (SpecificDataLen !=3D sizeof (PCI_OR_PCIE_INTERFACE_DEVICE_= DESCRIPTOR_V2) + 1) { ASSERT (SpecificDataLen =3D=3D sizeof (PCI_OR_PCIE_INTERFACE= _DEVICE_DESCRIPTOR_V2) + 1); return EFI_VOLUME_CORRUPTED; } } else { + // According to Redfish Host Interface specification, add addi= tional one byte for Device Type field. if (SpecificDataLen !=3D sizeof (USB_INTERFACE_DEVICE_DESCRIPT= OR_V2) + 1) { ASSERT (SpecificDataLen =3D=3D sizeof (USB_INTERFACE_DEVICE_= DESCRIPTOR_V2) + 1); return EFI_VOLUME_CORRUPTED; @@ -105,7 +107,14 @@ RedfishGetHostInterfaceProtocolData ( // This SMBIOS record is invalid, if the length of protocol sp= ecific data for // Redfish Over IP protocol is wrong. // - if ((*(RecordTmp + 90) + sizeof (REDFISH_OVER_IP_PROTOCOL_DATA= ) - 1) !=3D ProtocolLength) { + if ((*(RecordTmp + REDFISH_HI_PROTOCOL_HOSTNAME_LENGTH_OFFSET)= + sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1) !=3D ProtocolLength) { + DEBUG (( + DEBUG_ERROR, + "%a: Length of protocol specific data is not match: %d != =3D ProtocolLength(%d).\n", + __func__, + *(RecordTmp + REDFISH_HI_PROTOCOL_HOSTNAME_LENGTH_OFFSET) = + sizeof (REDFISH_OVER_IP_PROTOCOL_DATA) - 1, + ProtocolLength + )); return EFI_SECURITY_VIOLATION; } =20 @@ -114,6 +123,13 @@ RedfishGetHostInterfaceProtocolData ( // This SMBIOS record is invalid, if the length is smaller tha= n the offset. // if (Offset > mType42Record->Hdr.Length) { + DEBUG (( + DEBUG_ERROR, + "%a: Offset (%d) > mType42Record->Hdr.Length (%d).\n", + __func__, + Offset, + mType42Record->Hdr.Length + )); return EFI_SECURITY_VIOLATION; } =20 --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111654): https://edk2.groups.io/g/devel/message/111654 Mute This Topic: https://groups.io/mt/102762747/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-