From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.51]) by mx.groups.io with SMTP id smtpd.web11.4524.1689240305302612666 for ; Thu, 13 Jul 2023 02:25:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=qlyQODuO; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.237.51, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=awzGG5wVWXGevYBeoS9nsMsRokd2Km+XWQNleqj7hQv9V4GnDBFVmDZ0SZrW/A5JiOR+hF1Y7xH6BplQUGGDcyMgk2LoKgONDzuv/2HQ4n/2RwMs5lyANSC7w17plVWYTOl35n7t9cYE2yUrkNXcEHKTvJuGD4lYL2YXvM8eSSrL6eMCqYFWr50vU7c89NbrYavV6iIF4578bK6bOb3dgGaATdPl2MUyVq/aN5gbb1VnD3XjeNnLQSVOW1j6PlF/NRHjKfqj9Iru2ZEJ9BHAv5Z6XivMS+9KhA+3a9mVcZFAOA2qo1uBnJP6fpZFu2vqieBGL3jHIVanoz4AHkN6xQ== 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=p7ROZZR1fBq1gRHW40MBd9JdBuglQtgD+ILpbMkNxq4=; b=Lv7RmHEbKECbTR0HDuCot9XOJrc/YXUZVe8am8rhiyDAfssNkmbbPDhrNGUVm/oUQ3m6UIWVwMBpdeQCypd6FnFZ0L/ABvfTpso0HHckYRsDIO3Ef2QEZPfkXcvCL6HVFiVj92beevkFF/aE307uQgVPMGEPHqcgRhO3MBB/BqxP0+QbT1uyb7JmMhObWh5hHcp49Z5UUI30e+SRgc1HGZlTf1kR1uq+0J2t3tT+BI+W6h81vzhFdB+6z73GnAAgddqKHqwY3mPo0/HtXffE0mHBLDSNBAQTEXv3ZUMxrS7PGF4jBFgQARQ2QQXAzwV2hk1SQmmVSiu8ZxrAHO/kAA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p7ROZZR1fBq1gRHW40MBd9JdBuglQtgD+ILpbMkNxq4=; b=qlyQODuOSqcp7Yj3PdgUhq+K3dqx3iuUK61qBbT2N1E6WM2PSz32kCxk3xpicApfKOuZoXlqBAyg6qA5VR1fMXekubepQgMHeTnmy7VWYAgZbPlFZwtSlZhd1i1vIdHNr3Nv6Ao76ExZbMueYRFAXaJ7ypCjMdXGVYg87jD1Se14+qriQflGjxyNJ1nNu0q2MRrrpKuyrWFJ2oRFZnKLUWv12EO+GCbda6BMk8IJRbZByCP+P6f7uYFQoA7nuh6IXnVdF6cNlqYrEalREz0Bt5IShV+v3eU1jXycjkrDA17CmEZlgnBbzlXzxEydm9OuCz/ACYLoZjd9lambFxtVMw== Received: from BN9PR03CA0740.namprd03.prod.outlook.com (2603:10b6:408:110::25) by IA1PR12MB8336.namprd12.prod.outlook.com (2603:10b6:208:3fc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.20; Thu, 13 Jul 2023 09:25:00 +0000 Received: from BN8NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:408:110:cafe::77) by BN9PR03CA0740.outlook.office365.com (2603:10b6:408:110::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.25 via Frontend Transport; Thu, 13 Jul 2023 09:25:00 +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 Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT049.mail.protection.outlook.com (10.13.177.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.24 via Frontend Transport; Thu, 13 Jul 2023 09:25:00 +0000 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.5; Thu, 13 Jul 2023 02:24:47 -0700 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.37; Thu, 13 Jul 2023 02:24:47 -0700 Received: from NV-CL38DL3.nvidia.com (10.127.8.11) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Thu, 13 Jul 2023 02:24:46 -0700 From: "Nickle Wang" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [PATCH] RedfishPkg/RedfishRestExDxe: reset session when TCP timeout happens Date: Thu, 13 Jul 2023 17:24:45 +0800 Message-ID: <20230713092446.14050-1-nicklew@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Return-Path: nicklew@nvidia.com X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT049:EE_|IA1PR12MB8336:EE_ X-MS-Office365-Filtering-Correlation-Id: e26dd507-ad80-4277-5065-08db83830835 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JgUah7m8RxhPq4LQlLIfLD5XHixAxGeVfw6OxyB3Q8+ZJn84Tqb4B/4lF3BQhJ2WXNCFQ8DG4lljoQvpi+hc/Kjmo6Yo438+JVFtiILt84UDrokrq3wZQSbdApdMdvcThIjKca0iNHXwK1yKY+Dk5v59jik1ZQLi3egRrr//loElu93aWcgt40EZO0lBgGifgJYZUv2pMaN6ZXn+NhyMnnS1c2W4NDfATZW++BIGvU3m9By3PqxqUVrJJQm4QzAb4pcnsU7BXNEppypHKihLtva/aq3KYsEfn+FhRS2wGNqlMiKwwbML38QBoQsGOn7V2fWTTWSMQ/NSoNtbORxKXt3vdUPHvC+UWJcpUCN0OsXJzxO6d4XAzsFTb1fbr/KDAFX6mnKi+5NVdzOS5ymM0lw9itxIqgnT7vSWfdcy2WdJtbl7DESWcNmKWLmcHrGtVeEwNch/hzd048yK0TuIB6K5QI4W9VU1VQ3mewhNFQ54QR/J9vePEGUxBcKb1htK+AKi+sz2Ogh2Qp1+I7APakT21aAi0/kvdw++rMIfSlce9xjo/+uTRXoIsaokLnSamVWyl8uCxA8QEtO2XLsiqEQ0Jx2sYJi/jkJDNF0FrTBw4JFUyoq24g69+xX8kr3nOji+b9YUS5G9XaS7UCtD0eS22NJFfM73ewliIKnii9KTM6kyaJMJLrKt1wpFW8k0a0g0TF8hnGSMkRyZ2Vc3jkVEnQYEOYjia0oonssnkDdWBwNIPjUsyIs9CIDmoX6X X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230028)(6029001)(4636009)(376002)(136003)(39860400002)(346002)(396003)(451199021)(40470700004)(46966006)(36840700001)(107886003)(40460700003)(8676002)(8936002)(36860700001)(47076005)(2906002)(83380400001)(426003)(336012)(2616005)(82740400003)(36756003)(356005)(7636003)(86362001)(82310400005)(40480700001)(5660300002)(26005)(1076003)(186003)(6916009)(4326008)(54906003)(70586007)(70206006)(7696005)(41300700001)(316002)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2023 09:25:00.2848 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e26dd507-ad80-4277-5065-08db83830835 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: BN8NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8336 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Call ResetHttpTslSession() to reset HTTP session when TCP timeout failure happens. So that application can perform retry to the same URI. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../RedfishRestExDxe/RedfishRestExInternal.h | 14 ++++++++++++++ RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 4 ++-- .../RedfishRestExDxe/RedfishRestExProtocol.c | 4 ++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExInternal.h b/RedfishP= kg/RedfishRestExDxe/RedfishRestExInternal.h index bca679e2ccc4..c146f4a647cb 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExInternal.h +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExInternal.h @@ -55,6 +55,20 @@ RedfishCheckHttpReceiveStatus ( IN EFI_STATUS HttpIoReceiveStatus ); =20 +/** + Create a new TLS session because the previous one is closed. + + @param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance= for a particular + REST service. + @retval EFI_SUCCESS operation succeeded. + @retval EFI_ERROR Other errors. + +**/ +EFI_STATUS +ResetHttpTslSession ( + IN RESTEX_INSTANCE *Instance + ); + /** This function send the HTTP request without body to see if the write to URL is permitted by Redfish service. This function diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c b/RedfishPkg/R= edfishRestExDxe/RedfishRestExImpl.c index 838e24f7e7ef..b2961424de80 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c @@ -4,6 +4,7 @@ Copyright (c) 2019, Intel Corporation. All rights reserved.
(C) Copyright 2020 Hewlett Packard Enterprise Development LP
Copyright (c) 2023, American Megatrends International LLC. + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved= . =20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -12,8 +13,7 @@ #include "RedfishRestExInternal.h" =20 /** - Create a new TLS session becuase the previous on is closed. - status. + Create a new TLS session because the previous one is closed. =20 @param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance= for a particular REST service. diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c b/RedfishP= kg/RedfishRestExDxe/RedfishRestExProtocol.c index d8f2c73f8ef0..90973619f2bc 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c @@ -188,6 +188,10 @@ ReSendRequest:; } =20 if (EFI_ERROR (Status)) { + // + // Communication failure happens. Reset the session. + // + ResetHttpTslSession (Instance); goto ON_EXIT; } =20 --=20 2.17.1