From: "Chang, Abner" <abner.chang@amd.com>
To: Nickle Wang <nicklew@nvidia.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Igor Kulchytskyy <igork@ami.com>, Nick Ramirez <nramirez@nvidia.com>
Subject: Re: [PATCH] RedfishPkg/RedfishRestExDxe: reset session when TCP timeout happens
Date: Fri, 14 Jul 2023 14:09:12 +0000 [thread overview]
Message-ID: <MN2PR12MB3966C03BD8EC831BE0535675EA34A@MN2PR12MB3966.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20230713092446.14050-1-nicklew@nvidia.com>
[AMD Official Use Only - General]
Reviewed-by: Abner Chang <abner.chang@amd.com>
> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Thursday, July 13, 2023 5:25 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: [PATCH] RedfishPkg/RedfishRestExDxe: reset session when TCP
> timeout happens
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> 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 <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nick Ramirez <nramirez@nvidia.com>
> ---
> .../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/RedfishPkg/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
> );
>
> +/**
> + 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/RedfishRestExDxe/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.<BR>
> (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> Copyright (c) 2023, American Megatrends International LLC.
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -12,8 +13,7 @@
> #include "RedfishRestExInternal.h"
>
> /**
> - Create a new TLS session becuase the previous on is closed.
> - status.
> + 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.
> diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c
> b/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c
> index d8f2c73f8ef0..90973619f2bc 100644
> --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c
> +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c
> @@ -188,6 +188,10 @@ ReSendRequest:;
> }
>
> if (EFI_ERROR (Status)) {
> + //
> + // Communication failure happens. Reset the session.
> + //
> + ResetHttpTslSession (Instance);
> goto ON_EXIT;
> }
>
> --
> 2.17.1
prev parent reply other threads:[~2023-07-14 14:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 9:24 [PATCH] RedfishPkg/RedfishRestExDxe: reset session when TCP timeout happens Nickle Wang
2023-07-14 14:09 ` Chang, Abner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MN2PR12MB3966C03BD8EC831BE0535675EA34A@MN2PR12MB3966.namprd12.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox