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 2098C941483 for ; Thu, 4 Jan 2024 08:16:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vkXxbeV/rccT3rCAFyE/MCO+0wMHYst/9WNO9AvUH5c=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1704356191; v=1; b=qI6MEZeuB3s3AjPu8d9zonuG6VamHV/HO1XiyZ4zweBF2jy4HGuWn3LY791b9JzMLrPxiLBp heUeTu7XPRYpjKaq6ynYpvdKMTMVq7NDPA92fVxmirmE2HYJTz/xUgHUKdSFZVlhcaqpFqgF7vS ZW4MyrIawvqnnmzvgPTQngVM= X-Received: by 127.0.0.2 with SMTP id OkwKYY7687511xmY4nFxrDiZ; Thu, 04 Jan 2024 00:16:31 -0800 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.79]) by mx.groups.io with SMTP id smtpd.web11.49626.1704356190641066527 for ; Thu, 04 Jan 2024 00:16:30 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nkePCouj0FLex+SjIrPTmJfMeHD2hS+YwyuDLubdNa4PGybqi6dxynTTpKt/hojaIxG3+PjBe3DC6bqsUAvCX+5apQ3goIu5S+QtGbJ76nzqTLU9mFjeWxnSNJaoPN5jMju0JfQ45PR/6kPsmPakXA4ACHofNJACGS5uiXq9uoWloNKEEGkZT+2JOT4w23gOsjuMGhcvN/4X8CaeaKvleMWJ3h6hnG8rkUcDptgVhkyiItv9X35L4TjLx7Y9UVN5P/CEshjBTI3L7GxJXJ8w+NdoGV7w93gd786tZ/0sTqHkE0qetXfIaXsZk3nEFuE4tQQ99KkSSHp2fILwFXlQCg== 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=ScWRnxUzMfO/tmdmHTkDKy59c1cx0ztPOCQjWEQj2VY=; b=RRmUhD2l3LnlXNTJ+RMuOL7swXhR4BzIiuefBscv1o9MAsPklusU3PcnWYu8zK+5aGzeZp/HGZrbfx0lZIvburmPikALy0wC3JQoEvKyVorhWBdtFyVc2tFCVsKBFy7MQRjaKsTLrQnlIjFPslvN1WgpmP/MvHWv7ZZ3NiRpkg4tnMMgbJhFXhde2a6IC/4ycGQiVMeK5fo4znJHjgVq98zhQmrD14qqf1kItOvTfCZG2kvBe/cLEC1pAuiCJ/9mx+w0d9rhjlhS6Qk3OaCvVlagIQLEuUq0Y924zgxMpno9bFRadr/M6eRjJY3Nbug2IgDl+F61E7kiR6vN4xBYtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by CY8PR12MB7194.namprd12.prod.outlook.com (2603:10b6:930:5a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.15; Thu, 4 Jan 2024 08:16:27 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05%5]) with mapi id 15.20.7159.013; Thu, 4 Jan 2024 08:16:26 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy , Nick Ramirez Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 1/4] RedfishClientPkg: add ETag to Redfish resource check function Thread-Topic: [edk2-redfish-client][PATCH 1/4] RedfishClientPkg: add ETag to Redfish resource check function Thread-Index: AQHaPsw311+BdM+xQEml6OLgw2HSUrDJTvbg Date: Thu, 4 Jan 2024 08:16:26 +0000 Message-ID: References: <20240104050917.70558-1-nicklew@nvidia.com> In-Reply-To: <20240104050917.70558-1-nicklew@nvidia.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=3f8edba3-a901-4aab-8793-3ea81886ef57;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2024-01-04T08:16:12Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|CY8PR12MB7194:EE_ x-ms-office365-filtering-correlation-id: b59bcce7-9bc5-4685-d9b4-08dc0cfd7220 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: kMFsCi80H/gBaacMirmi9kdAZpULaGaq6WlagML0nFNnz28WlCOQ+KOnYVcrkzVzDNzxzk5ctwLj6TK/eeKibjJ6tTBIEtiLW8euBn3wJUIn74YwQAlSBhhA6Q1SAT18GLt8rO4bMf1eFVJZHQf7j6WnT4PJuaQMbX33vwQoEwLTKUx2+lB6MzUq405NAzDc5h9YdLFCACyhXOneiDbKNa1uwX76OnZT43yGwULZw2HiyKfhqLwU7GiIthJwD36BmVqJxOCT/agwkkQY44+Jt6M4aQusDV2hnS9/5P/mNyAGCj+B8cdKroKniIdkaeZyn2VkBQc8QobVF9CETWI4WXKTJjt8B4xLr/YqyWlFANbntKy2Yw8HOLysrd9Q57wcJAryV7YaHw7/mPGbHr7iKXskCjYm5H6P3D94Yt76H6texmQKY+EnaADFqnCs9E8cUf1qbR7E2kkex2+Qio42bahJu+nsb8wEfjk4qCKuK97Ic/MF+jM6oMgneDguShfU52VSu7GrThsXeKBV9mtlHShwV6uv1D8/tVOi1DLp/vp0vW3f6hAp23Flmc/m0q1V05AVYoovG8qdN++n8ky0oPxkpZ9PSYv487mq71ihtMTE4LG+N3m9+ZqHHkySnlclKORKdHE89oV3aXg2m6pBcPOK6cL/DpCQcoEXR4AOBgY= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ukhvKF+mH9yXWJisFONARGZYlgAehsftOl4uszmHizRI756dS9BuBI9x0hMo?= =?us-ascii?Q?y6wNMsj+u1kHukgif4uHW6A5w9MFu7u9OeRhZIVsSpjFIP3LCEIyvE6RCRw6?= =?us-ascii?Q?TRa/GMYUS9OmHtzibDiyzfbR0Fr//NMGavo9v8MVrXO/OXAagzSuTNRjQfXK?= =?us-ascii?Q?b/UwuZUVIUsO/lz31NdgH7mFJyTctY44+5Jwi2JDuSLu2PNEcf8wMgYWUENk?= =?us-ascii?Q?HbTF4MYpPuDFEEzcGIcMdFoJrycRBx6UH2CBOyJz0dsBIDsmZKlD141YCG2F?= =?us-ascii?Q?xTao+e1rVMRGiuSV5B5nkWBItofqgPcRK3zqBo9aeRFO7eCgtheiNjD7kE6o?= =?us-ascii?Q?bCRwKiK7y75h64zpdOewViicbxqg5r5wxg8qnzTQ5OM/NKJAJuzYRG17eOLa?= =?us-ascii?Q?KX3RGJSey10QEcN+iRVVTTjyU4Z9q9xVNML4AyQzfhFfe++p0MoRaHZNKBAF?= =?us-ascii?Q?NN2BVAB4FRNqyX+07nzrlc1nfC1EqRkGXP2MEqb+5dwhIKbp+caBx/Eq5dZm?= =?us-ascii?Q?cqSrf654wILyasst77VrJox8vddUTWU34OjsHiLjGcAhA4GB1mcNTKY17hGA?= =?us-ascii?Q?5xufUPtFnQ+6at+ju+4G0bTI6FtyHU80bqFbdvUxL8exCHVP9emt++pKJmVc?= =?us-ascii?Q?aIUQ1fS7VPEJMUIRzYtvaNHL0l0uAyT+8GOnhhGIACBnNmR/GTaHkXXlD7ID?= =?us-ascii?Q?WVXJXoIpJQOQFFP5rgkBk25AxBeCTqBwEqwPgbZmq3SK45dSHo0PybRN5mai?= =?us-ascii?Q?7+eDt6V8rTc6+LRKQDxdruFTBQPCmOt2GWIsHO/d/+5HRwSKFUCIJhfd/KtM?= =?us-ascii?Q?6yHicC14OG1qFggURM8tBL3vIp1Q5Vyy4DHS4Gj3JvX7qvP1Eycwx2HAas4y?= =?us-ascii?Q?i++muiOX+z8ViyBbrDQmQyctN5CDdP4XXkQ533RbmpBdyEUY/mQSjwKmIn2S?= =?us-ascii?Q?vbuV83+H9U1jzk3904X1wfHZbB0hQ5D6jRPIz0lnbV5Uo54mTern2ZT74pYX?= =?us-ascii?Q?KVgeLzc7BIaiqLdSWU6XOnrxRU5ULYFttVhrySGMD2uJ3C+A5sF77FcfzNOe?= =?us-ascii?Q?SIbbQtAI+nyGmcNSkKEs3bRoXzXhDiKVzYkXZ56RqGAC75bI/wOOFb37wsF1?= =?us-ascii?Q?4JOaSgTjaHfLmUMBUrcveEbeaqE6Mf5rPaJe7gu3bkhSMkx6M4BhHuG8gMLU?= =?us-ascii?Q?E0wM3jgiitQ+S+mNRZq2JH+hbnOjQ+ovOHuDrMRVHJp8Q+9Xs2h6Ysedzs2h?= =?us-ascii?Q?9/OvsqBBTLiJJVkUdScsVYLccSIOadqz+EBQpWetwrpIgPjurruCnVr/XU0T?= =?us-ascii?Q?ju4iwoKgRuShCazcwjq4b5s9jiIYzNyxLSGXE0T/qSDRg1KhHxyf2p1PvoFN?= =?us-ascii?Q?14dCW/8R2AptAk6ipGBQ0pB4h4y68u6TDYAzWIEZKP9OKeFM8EOY44iYG+BE?= =?us-ascii?Q?kR54EH03arZXgja0blT2oJtjQBlxOtqXeZmPL3a1obwvdUw8xI+rCXJEYS5e?= =?us-ascii?Q?oLYSff3vi/9S+wHyQ6ERNnRjzQnCsdsGzqdnO1HV2Tfc5ZUpja9ONkhCdmEF?= =?us-ascii?Q?TnDtPvX0UI8aLKE4bqM=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b59bcce7-9bc5-4685-d9b4-08dc0cfd7220 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2024 08:16:26.0738 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: C8chcnKc8PP17367PXzc+2GwSVsdm5TTrujVyjc7wDr2rCuu1eRfvJAazyheKSnXfgUCJ3WroYwNqexWbBXK9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7194 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: FJiZ3fNJnGwog7fvJjjZPS6Vx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=qI6MEZeu; 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 [AMD Official Use Only - General] Reviewed-by: Abner Chang > -----Original Message----- > From: Nickle Wang > Sent: Thursday, January 4, 2024 1:09 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > ; Nick Ramirez > Subject: [edk2-redfish-client][PATCH 1/4] RedfishClientPkg: add ETag to > Redfish resource check function > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Add ETag parameter to RedfishCheckResourceCommon(). When the ETag > from Redfish resource is not changed, feature driver can skip the > check function. This helps to improve the feature driver performance. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nick Ramirez > --- > RedfishClientPkg/Include/RedfishResourceCommon.h | 4 +++- > .../Features/Bios/v1_0_9/Common/BiosCommon.c | 15 > ++++++++++++++- > .../Features/Bios/v1_0_9/Dxe/BiosDxe.c | 12 +++++++++++- > .../v1_5_0/Common/ComputerSystemCommon.c | 15 > ++++++++++++++- > .../ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c | 12 > +++++++++++- > .../Features/Memory/V1_7_1/Common/MemoryCommon.c | 15 > ++++++++++++++- > .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c | 12 +++++++++++- > 7 files changed, 78 insertions(+), 7 deletions(-) > > diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h > b/RedfishClientPkg/Include/RedfishResourceCommon.h > index d354d3b0..c1286adc 100644 > --- a/RedfishClientPkg/Include/RedfishResourceCommon.h > +++ b/RedfishClientPkg/Include/RedfishResourceCommon.h > @@ -106,6 +106,7 @@ RedfishProvisioningResourceCommon ( > > @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > @param[in] Json The JSON to consume. > + @param[in] HeaderEtag The Etag string returned in HTTP head= er. > > @retval EFI_SUCCESS Value is returned successfully. > @retval Others Some error happened. > @@ -114,7 +115,8 @@ RedfishProvisioningResourceCommon ( > EFI_STATUS > RedfishCheckResourceCommon ( > IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > - IN CHAR8 *Json > + IN CHAR8 *Json, > + IN CHAR8 *HeaderEtag OPTIONAL > ); > > /** > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > index a26a1083..0ae84149 100644 > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c > @@ -530,6 +530,7 @@ RedfishProvisioningResourceCommon ( > > @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > @param[in] Json The JSON to consume. > + @param[in] HeaderEtag The Etag string returned in HTTP head= er. > > @retval EFI_SUCCESS Value is returned successfully. > @retval Others Some error happened. > @@ -538,7 +539,8 @@ RedfishProvisioningResourceCommon ( > EFI_STATUS > RedfishCheckResourceCommon ( > IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > - IN CHAR8 *Json > + IN CHAR8 *Json, > + IN CHAR8 *HeaderEtag OPTIONAL > ) > { > UINTN Index; > @@ -551,6 +553,17 @@ RedfishCheckResourceCommon ( > return EFI_INVALID_PARAMETER; > } > > + // > + // Check ETAG to see if we need to check this resource again or not. > + // > + if (CheckEtag (Private->Uri, HeaderEtag, NULL)) { > + // > + // No change > + // > + DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore > check action\n", __func__, Private->Uri)); > + return EFI_SUCCESS; > + } > + > Status =3D RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, > &ConfigureLangList, &Count); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, RedfishPlatformConfigGetConfigureLang > failed: %r\n", __func__, Status)); > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > index 64b9d562..2a49c5cd 100644 > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c > @@ -336,6 +336,7 @@ RedfishResourceCheck ( > REDFISH_RESOURCE_COMMON_PRIVATE *Private; > EFI_STATUS Status; > REDFISH_RESPONSE Response; > + CHAR8 *Etag; > > if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > @@ -361,7 +362,16 @@ RedfishResourceCheck ( > Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); > ASSERT (Private->Json !=3D NULL); > > - Status =3D RedfishCheckResourceCommon (Private, Private->Json); > + // > + // Find etag in HTTP response header > + // > + Etag =3D NULL; > + Status =3D GetEtagAndLocation (&Response, &Etag, NULL); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > + Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", > __func__, Uri, Status)); > } > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.c > index 979d49f7..3ace03bd 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.c > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer > SystemCommon.c > @@ -1434,6 +1434,7 @@ RedfishProvisioningResourceCommon ( > > @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > @param[in] Json The JSON to consume. > + @param[in] HeaderEtag The Etag string returned in HTTP head= er. > > @retval EFI_SUCCESS Value is returned successfully. > @retval Others Some error happened. > @@ -1442,7 +1443,8 @@ RedfishProvisioningResourceCommon ( > EFI_STATUS > RedfishCheckResourceCommon ( > IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > - IN CHAR8 *Json > + IN CHAR8 *Json, > + IN CHAR8 *HeaderEtag OPTIONAL > ) > { > UINTN Index; > @@ -1455,6 +1457,17 @@ RedfishCheckResourceCommon ( > return EFI_INVALID_PARAMETER; > } > > + // > + // Check ETAG to see if we need to check this resource again or not. > + // > + if (CheckEtag (Private->Uri, HeaderEtag, NULL)) { > + // > + // No change > + // > + DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore > check action\n", __func__, Private->Uri)); > + return EFI_SUCCESS; > + } > + > Status =3D RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, > &ConfigureLangList, &Count); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, RedfishPlatformConfigGetConfigureLang > failed: %r\n", __func__, Status)); > diff --git > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.c > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.c > index f89a4282..0bbaa92b 100644 > --- > a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.c > +++ > b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste > mDxe.c > @@ -330,6 +330,7 @@ RedfishResourceCheck ( > REDFISH_RESOURCE_COMMON_PRIVATE *Private; > EFI_STATUS Status; > REDFISH_RESPONSE Response; > + CHAR8 *Etag; > > if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > @@ -355,7 +356,16 @@ RedfishResourceCheck ( > Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); > ASSERT (Private->Json !=3D NULL); > > - Status =3D RedfishCheckResourceCommon (Private, Private->Json); > + // > + // Find etag in HTTP response header > + // > + Etag =3D NULL; > + Status =3D GetEtagAndLocation (&Response, &Etag, NULL); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > + Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", > __func__, Uri, Status)); > } > diff --git > a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c > b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon. > c > index 14c26301..eb52c68c 100644 > --- > a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c > +++ > b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon. > c > @@ -2350,6 +2350,7 @@ RedfishProvisioningResourceCommon ( > > @param[in] This Pointer to > REDFISH_RESOURCE_COMMON_PRIVATE instance. > @param[in] Json The JSON to consume. > + @param[in] HeaderEtag The Etag string returned in HTTP head= er. > > @retval EFI_SUCCESS Value is returned successfully. > @retval Others Some error happened. > @@ -2358,7 +2359,8 @@ RedfishProvisioningResourceCommon ( > EFI_STATUS > RedfishCheckResourceCommon ( > IN REDFISH_RESOURCE_COMMON_PRIVATE *Private, > - IN CHAR8 *Json > + IN CHAR8 *Json, > + IN CHAR8 *HeaderEtag OPTIONAL > ) > { > UINTN Index; > @@ -2371,6 +2373,17 @@ RedfishCheckResourceCommon ( > return EFI_INVALID_PARAMETER; > } > > + // > + // Check ETAG to see if we need to check this resource again or not. > + // > + if (CheckEtag (Private->Uri, HeaderEtag, NULL)) { > + // > + // No change > + // > + DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore > check action\n", __func__, Private->Uri)); > + return EFI_SUCCESS; > + } > + > Status =3D RedfishPlatformConfigGetConfigureLang (RESOURCE_SCHEMA, > RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, > &ConfigureLangList, &Count); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, RedfishPlatformConfigGetConfigureLang > failed: %r\n", __func__, Status)); > diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > index 450170e1..92300780 100644 > --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c > @@ -330,6 +330,7 @@ RedfishResourceCheck ( > REDFISH_RESOURCE_COMMON_PRIVATE *Private; > EFI_STATUS Status; > REDFISH_RESPONSE Response; > + CHAR8 *Etag; > > if ((This =3D=3D NULL) || IS_EMPTY_STRING (Uri)) { > return EFI_INVALID_PARAMETER; > @@ -355,7 +356,16 @@ RedfishResourceCheck ( > Private->Json =3D JsonDumpString (RedfishJsonInPayload (Private->Paylo= ad), > EDKII_JSON_COMPACT); > ASSERT (Private->Json !=3D NULL); > > - Status =3D RedfishCheckResourceCommon (Private, Private->Json); > + // > + // Find etag in HTTP response header > + // > + Etag =3D NULL; > + Status =3D GetEtagAndLocation (&Response, &Etag, NULL); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: failed to get ETag from HTTP header\n", > __func__)); > + } > + > + Status =3D RedfishCheckResourceCommon (Private, Private->Json, Etag); > if (EFI_ERROR (Status)) { > DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n", > __func__, Uri, Status)); > } > -- > 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 (#113143): https://edk2.groups.io/g/devel/message/113143 Mute This Topic: https://groups.io/mt/103517651/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-