From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9CE26AC08FB for ; Thu, 4 Jan 2024 02:32:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HpOPJeRGkNXaGZ6f7ItjLQzOux0d5oGFerd66IisAUI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID: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=1704335525; v=1; b=KH14AQtbzIjkOag0AdZcFN9H+kHcrrP2s8v0w8HWK/YKkeRTpB+NoEtn0DxtT4/FAN8Bhyg1 5FWup2h8LkvWkWjrr6NWC3bFRZ9hMmIFpYkQwUgMXBTwoXa7BkazjGmxZHrrJbladC41h7gg/kk LhSyjMysATR9kEa544Bs2NRM= X-Received: by 127.0.0.2 with SMTP id YIMKYY7687511xaUFnYXg7WR; Wed, 03 Jan 2024 18:32:05 -0800 X-Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.44]) by mx.groups.io with SMTP id smtpd.web11.45876.1704335524446222302 for ; Wed, 03 Jan 2024 18:32:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fT8cFHQsDLUVRqxKADnJFmMaFAGNz7uFp9cJ+Ss7GsdvbhCJ0yia1W/yM6uwhnA4MrHgbNQU8mcXh3aFts7nUxliuxjQYFDqPQCM5XN/bm6gCXjKEscMzuycrtV0l4G6xHka+mIpULxlDhaXuMg19LKJ5zAKyFofp/s/LIGfd+yPIo5VDmyhKh06E2q3uelBzbw/HLELYfl565ci9VOuhORl/Ay48hS3rW/rC0t1hdAoZ4vyMlWOPHxJc/d7h0nH8AJCKDmtQO+Vd07QeQoRGmQh3EIsM7StBtoVO3hI+BNE96D1+91M/e0Eeu/AXE0nKu9CryvFFXZfElbqUSEQmg== 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=xL2EfGU2Ls4m9/ft5pPo6wQsqR8alfaFHm2wijU59E8=; b=mfNTU9OHgfOE/6dyNnMDHbCJ8U+ovLWZE7WyzHbzIDrZ3Srin5cCPkV//rvY9gyC2zTlvjGosilid23PF2i7wrxQlyLxLICUoVSHQIAPeBgENj/EmeJAMItnK7ERwOjPNz60SW7k3/XdZ+xxD0QuAePTIia7MVLpKiM5+h/nnIKQjQEyypzG9k96Ui9TgBwcJ24HfVrwXSQ+L3+f/5SjIJGqV0co95XTU7TBbK740FSav8AS5rPpe1U9sR+fN+KodeKunKR9eB/phc2Civ2thB/fNCTyXVKpOvNdoQhNPnhC2ltoZf8NKjvXsiOFm7IosdvSC+fWCp+SUw0XQUfm1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) X-Received: from CH2PR17CA0003.namprd17.prod.outlook.com (2603:10b6:610:53::13) by DS7PR12MB8249.namprd12.prod.outlook.com (2603:10b6:8:ea::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13; Thu, 4 Jan 2024 02:32:01 +0000 X-Received: from DS2PEPF00003441.namprd04.prod.outlook.com (2603:10b6:610:53:cafe::13) by CH2PR17CA0003.outlook.office365.com (2603:10b6:610:53::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.13 via Frontend Transport; Thu, 4 Jan 2024 02:32:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.161) by DS2PEPF00003441.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Thu, 4 Jan 2024 02:32:00 +0000 X-Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 3 Jan 2024 18:31:51 -0800 X-Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 3 Jan 2024 18:31:50 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Wed, 3 Jan 2024 18:31:49 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH v2 03/10] RedfishClientPkg/ComputerSystemCollectionDxe: use HTTP cache lib Date: Thu, 4 Jan 2024 10:31:49 +0800 Message-ID: <20240104023149.10934-1-nicklew@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003441:EE_|DS7PR12MB8249:EE_ X-MS-Office365-Filtering-Correlation-Id: df0d339b-db80-44e3-7368-08dc0ccd54b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: oFTmrAB5dUEwf8PLG9KdFVLrskemWSQIockDcmIXcEYKNk7xKXwnUPSqLI1Y0p1xLz+xjt2JH0U7C/CtTOEGALhvn0BSGPyrFQr9mCAev0IrSnHvSZF6XNvgOifH7J5o14a1RaEBEn21G77eFT2ad0CYPExOb/e92xTPhoPvQth1E0BKUS+Kadfz2ouUVfw0U4LOnNl0lrHGKIJjJOEojeqGtNWjGOaBE+4CqeQAAnkIX2ueqjpkFNgEqZhBLyqT65jq9so/5FwooHxyPVNaWFwkOFy6idInXcbkgRxmLL62si6SMDE5NBtj+SSOTMo0T/PLes87SBJYkzl4GWkMKo/pXKEgn2Ua01SIlVxf1tiCWVVnONJlu7LS6dU5v/fnUpYEt6PhH1jMu81+KP9leMWLqCVghV6H3zPxsJcz1XqJCQgX4cyITYk87B9wA0IaNlentb+UPzLagh+QKNmt7yYXNXVzIy5EqVGQVfDf3HD3XZ7T05FTcqNUAokOrDzGXWDkEf7Mf+snno89TEQEukTEIwh7qncPbY/MI6b1dTqKd0hVDyFv6z77cJJ0HreP7SJ+4SYkn7qzDViVnKMWaptYwkbLyKLjrhk5Bb8Y/n/+bwTo+VrqA8Oikx+U5CSsUhfzFvG4HlENXg6GZIKQr1HnAGZepPqVLUzMBZMuQnU8mnOnNFiTRMIvnhx/xx90uwl9bIBQ/+WPOKa/2hl6OmrQF/ijoa/+48tQqU67IwoMXzIJgtL4wjl8wQsygi21 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2024 02:32:00.7564 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df0d339b-db80-44e3-7368-08dc0ccd54b8 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003441.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8249 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Mbu3c02R2y91iYZSvDdzkabZx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=KH14AQtb; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Use Redfish Http cache library to query Redfish service. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../ComputerSystemCollectionDxe.inf | 2 ++ .../ComputerSystemCollectionDxe.c | 26 +++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/Computer= SystemCollectionDxe.inf b/RedfishClientPkg/Features/ComputerSystemCollectio= nDxe/ComputerSystemCollectionDxe.inf index 107d6c07..b848f69f 100644 --- a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC= ollectionDxe.inf +++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC= ollectionDxe.inf @@ -3,6 +3,7 @@ # Redfish ComputerSystemCollection collection driver. # # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserve= d. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -40,6 +41,7 @@ UefiBootServicesTableLib EdkIIRedfishResourceConfigLib RedfishVersionLib + RedfishHttpCacheLib =20 [Protocols] gEdkIIRedfishConfigHandlerProtocolGuid ## CONSUMED diff --git a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/Computer= SystemCollectionDxe.c b/RedfishClientPkg/Features/ComputerSystemCollectionD= xe/ComputerSystemCollectionDxe.c index 74003406..05d74625 100644 --- a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC= ollectionDxe.c +++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemC= ollectionDxe.c @@ -3,7 +3,7 @@ Redfish feature driver implementation - ComputerSystemCollection =20 (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
- Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. + Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -256,17 +256,17 @@ ReleaseCollectionResource ( // // Release resource // - if (Private->RedResponse.Payload !=3D NULL) { + if (Private->Response.Payload !=3D NULL) { RedfishFreeResponse ( - Private->RedResponse.StatusCode, - Private->RedResponse.HeaderCount, - Private->RedResponse.Headers, - Private->RedResponse.Payload + Private->Response.StatusCode, + Private->Response.HeaderCount, + Private->Response.Headers, + Private->Response.Payload ); - Private->RedResponse.StatusCode =3D NULL; - Private->RedResponse.HeaderCount =3D 0; - Private->RedResponse.Headers =3D NULL; - Private->RedResponse.Payload =3D NULL; + Private->Response.StatusCode =3D NULL; + Private->Response.HeaderCount =3D 0; + Private->Response.Headers =3D NULL; + Private->Response.Payload =3D NULL; } =20 if (Private->CollectionJson !=3D NULL) { @@ -298,13 +298,13 @@ CollectionHandler ( // // Query collection from Redfish service. // - Status =3D GetResourceByUri (Private->RedfishService, Private->Collectio= nUri, &Private->RedResponse); + Status =3D RedfishHttpGetResource (Private->RedfishService, Private->Col= lectionUri, &Private->Response, TRUE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: unable to get resource from: %s :%r\n", __fu= nc__, Private->CollectionUri, Status)); goto ON_RELEASE; } =20 - Private->CollectionPayload =3D Private->RedResponse.Payload; + Private->CollectionPayload =3D Private->Response.Payload; ASSERT (Private->CollectionPayload !=3D NULL); =20 Private->CollectionJson =3D JsonDumpString (RedfishJsonInPayload (Privat= e->CollectionPayload), EDKII_JSON_COMPACT); @@ -370,7 +370,7 @@ RedfishCollectionFeatureCallback ( Private->InformationExchange =3D InformationExchange; =20 // - // Find Redfish version on BMC + // Find Redfish version on Redfish service. // Private->RedfishVersion =3D RedfishGetVersion (RedfishService); =20 --=20 2.34.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 (#113117): https://edk2.groups.io/g/devel/message/113117 Mute This Topic: https://groups.io/mt/103515961/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-