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 05A0074004D for ; Wed, 3 Jan 2024 12:00:45 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=4D73EG20Smcf6U6YAkMCbWCnOYDZF024VmEUeAxgggg=; 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=1704283244; v=1; b=pGsjCb0vvl5+ULWf9CWsaEGtoA1Hfb7dQSF31rxrb+3Sur1nkCfD73pNhtNJc4k76tYuB5A9 vWYCaqE1ovRq8KpilIT3WZseGWBivufa1iijyCys7hzoBOtZA0JWVP5S1/PhaFCBC22yUPlRPQ/ cYH3KBHghYXjPrn68vkQw0fY= X-Received: by 127.0.0.2 with SMTP id dnOIYY7687511xgine8RslTf; Wed, 03 Jan 2024 04:00:44 -0800 X-Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.79]) by mx.groups.io with SMTP id smtpd.web10.15981.1704283244114720240 for ; Wed, 03 Jan 2024 04:00:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c1G9kIKF0rGt3NYTFCV0knzBiCsuv8SjTl6nBKIdO/zYTEK2EaENCL3pXcEl3EIddFBDi3cuz1a6ebv+xu/AO4pa9JlB+Pil+27Q5+rmWge3Mqh5VGuvU/kD19PjosTAnlKfosZiiZSEt4R+CWXq5Efn8MO0xAs7/w1WBM25Rup/Mx3WrPk6Yw+4jwXjDHF614JUBo6llIlUgVe3EvMKupnZ8pdS9Flq4RsDNIC7iyWMhFiFVts2ENUXFNrGCBgs+6m07ey4N8XjYZCfiNYxyW0R+BPRqvdB1ceju+WohS3OZv1vbMwlzwQS7V37pl3eR/58eCMCKxCEniXlen+k+w== 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=woODjhgHlNBiD3Xc5ZTgJRq0+rxyb/M5bpDmcSbWYg0=; b=dcbkoEhg6XFSZnKJ3wUV8TcRKyoII4nZ4ZzvPG4ghl2oLLkpKbOi6ec3RDat9SvRpkAiBt2WCIiocW9XjNSEq2qhhiWfcl4xwidD20/bPkZD3fiG5xzKUzhIFf9gvpKx2sEo3xcq5dZ6+Z5Yzf9ke4Xa9pV3poLRASmIaFwlCZAy7/XDoZVMs3j4AFcy01kpIZiyBAoAao2q119LMtqcWQuWZk+3o8ydGFdA5n09SpAxJoBu/viZuK+AnCA9MxYgkh6nDAiC096t6MkO0P/ld3TFQ5DHAg90gMM+F/o83seOR4pcV/jNWIkXaCNCT0v+wt6BgtTCH8pE5Ctoe7Dyyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 MN2PR14CA0025.namprd14.prod.outlook.com (2603:10b6:208:23e::30) by MW4PR12MB7263.namprd12.prod.outlook.com (2603:10b6:303:226::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.14; Wed, 3 Jan 2024 12:00:39 +0000 X-Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:23e:cafe::9a) by MN2PR14CA0025.outlook.office365.com (2603:10b6:208:23e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.24 via Frontend Transport; Wed, 3 Jan 2024 12:00:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.160) by BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.9 via Frontend Transport; Wed, 3 Jan 2024 12:00:38 +0000 X-Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) 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 04:00:18 -0800 X-Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail203.nvidia.com (10.129.68.9) 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 04:00:18 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Wed, 3 Jan 2024 04:00:17 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH 03/10] RedfishClientPkg/ComputerSystemCollectionDxe: use HTTP cache lib Date: Wed, 3 Jan 2024 20:00:16 +0800 Message-ID: <20240103120016.61862-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: BL6PEPF0001AB4B:EE_|MW4PR12MB7263:EE_ X-MS-Office365-Filtering-Correlation-Id: d1380d26-4921-40b7-73f2-08dc0c5399ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: /jGcHjt2o/nMy90C6Hk9WhSQOXJn3RogRbfhwUUBVVMkEbwvmTTgx7OKBVXh5W6Nh6K833k3qAWWnUeDiLffIB/gA5yi5JvhBc8X42zXV8mQZ/PM3FRp2k53qmkiQyFnKcUiuu0sFTkXUJ0A/91O5b4Kwl0kYwy2uyri3r+/fLP3vyiI5uPDw80Hd3r3DTmaGH92G4wNwYRVmnYqg6za2md5HgTQK2S0BEpqtGFggLEaEbqOTWP1o8yS/6nodAjAJ3XL/IDOwcR4DpSfrCYmLq2zZ0D4ytk1NXMKE5/5hpOKEgpySnJM7FpnGD+O19qRLlohds+8hmCDA+fyLIWOvX1LNFrDhVlN9wHzuVkgZcHKffPEifLh0GCm37YDNWfVtFNBjkWa/3+bkRyRDa+oFQtekSQ5nOGqjtoAXt7FCUlz6lkzvFsSxhOHVruJU/dWGTu9Y0v4QxI2uswxqSlrc99O7TMALLqvXKi//V1hZKKASFhBMFyWKYhCLOIin7jfq80R5KuHgpKao9ge1n+yeirCdVPJImkRcdvBNnj94lYPylsSgHKFZLOhmUZ8IGnVBUo0TCbLAhwzUdPp03BxAYWgSW0emGBeWbo8w8rfit85+AG4ZRDMUgmR/GRRNpRGhiWo9ZFFcAO++Gz1CBwGmrcoyu0GxnyRoxcHHTQ6GDb64LB0pmnEVRJkLsjvWonDce05GWeyQH8Q+5JKoVL1beaNR94JduR4DVpRmX0da64= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 12:00:38.2121 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1380d26-4921-40b7-73f2-08dc0c5399ec 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.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7263 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: YWXTMLuLR18FDon1KrNWx30jx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Spam-Flag: yes X-Spam-Level: ************ X-GND-Spam-Score: 190 X-GND-Status: SPAM Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=pGsjCb0v; 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; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") 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 | 24 +++++++++---------- 2 files changed, 14 insertions(+), 12 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..7e2e1d2e 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); --=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 (#113073): https://edk2.groups.io/g/devel/message/113073 Mute This Topic: https://groups.io/mt/103500376/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-