diff options
author | Zachary Clark-Williams <zachary.clark-williams@intel.com> | 2021-07-28 20:16:13 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-07-28 16:19:19 +0000 |
commit | ac70e71b1ffc823e5eec80b0cba04750860728b7 (patch) | |
tree | 85977eeb3eb6b3ed26ff240659bebb3411d78b34 /NetworkPkg/HttpBootDxe | |
parent | 147f34b56ce0e2e18285ef7d0695753ac0aa5085 (diff) | |
download | edk2-ac70e71b1ffc823e5eec80b0cba04750860728b7.zip edk2-ac70e71b1ffc823e5eec80b0cba04750860728b7.tar.gz edk2-ac70e71b1ffc823e5eec80b0cba04750860728b7.tar.bz2 |
NetworkPkg: Making the HTTP IO timeout value programmable with PCD
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3507
HTTP boot has a default set forced timeout value of 5 seconds
for getting the recovery image from a remote source.
This change allows the HTTP boot flow to get the IO timeout value
from the PcdHttpIoTimeout.
PcdHttpIoTimeout value is set in platform code.
Signed-off-by: Zachary Clark-Williams <zachary.clark-williams@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Diffstat (limited to 'NetworkPkg/HttpBootDxe')
-rw-r--r-- | NetworkPkg/HttpBootDxe/HttpBootClient.c | 12 | ||||
-rw-r--r-- | NetworkPkg/HttpBootDxe/HttpBootClient.h | 7 | ||||
-rw-r--r-- | NetworkPkg/HttpBootDxe/HttpBootDxe.inf | 3 |
3 files changed, 12 insertions, 10 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c b/NetworkPkg/HttpBootDxe/HttpBootClient.c index 8f21f77..aa0a153 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootClient.c +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c @@ -1,7 +1,7 @@ /** @file
Implementation of the boot file download function.
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -596,19 +596,25 @@ HttpBootCreateHttpIo ( HTTP_IO_CONFIG_DATA ConfigData;
EFI_STATUS Status;
EFI_HANDLE ImageHandle;
+ UINT32 TimeoutValue;
ASSERT (Private != NULL);
+ //
+ // Get HTTP timeout value
+ //
+ TimeoutValue = PcdGet32 (PcdHttpIoTimeout);
+
ZeroMem (&ConfigData, sizeof (HTTP_IO_CONFIG_DATA));
if (!Private->UsingIpv6) {
ConfigData.Config4.HttpVersion = HttpVersion11;
- ConfigData.Config4.RequestTimeOut = HTTP_BOOT_REQUEST_TIMEOUT;
+ ConfigData.Config4.RequestTimeOut = TimeoutValue;
IP4_COPY_ADDRESS (&ConfigData.Config4.LocalIp, &Private->StationIp.v4);
IP4_COPY_ADDRESS (&ConfigData.Config4.SubnetMask, &Private->SubnetMask.v4);
ImageHandle = Private->Ip4Nic->ImageHandle;
} else {
ConfigData.Config6.HttpVersion = HttpVersion11;
- ConfigData.Config6.RequestTimeOut = HTTP_BOOT_REQUEST_TIMEOUT;
+ ConfigData.Config6.RequestTimeOut = TimeoutValue;
IP6_COPY_ADDRESS (&ConfigData.Config6.LocalIp, &Private->StationIp.v6);
ImageHandle = Private->Ip6Nic->ImageHandle;
}
diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.h b/NetworkPkg/HttpBootDxe/HttpBootClient.h index 971b2dc..3a98f0f 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootClient.h +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.h @@ -1,7 +1,7 @@ /** @file
Declaration of the boot file download function.
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -10,12 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef __EFI_HTTP_BOOT_HTTP_H__
#define __EFI_HTTP_BOOT_HTTP_H__
-#define HTTP_BOOT_REQUEST_TIMEOUT 5000 // 5 seconds in uints of millisecond.
-#define HTTP_BOOT_RESPONSE_TIMEOUT 5000 // 5 seconds in uints of millisecond.
#define HTTP_BOOT_BLOCK_SIZE 1500
-
-
-
#define HTTP_USER_AGENT_EFI_HTTP_BOOT "UefiHttpBoot/1.0"
//
diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.inf b/NetworkPkg/HttpBootDxe/HttpBootDxe.inf index a27a561..cffa642 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDxe.inf +++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.inf @@ -1,7 +1,7 @@ ## @file
# This modules produce the Load File Protocol for UEFI HTTP boot.
#
-# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2020 Hewlett-Packard Development Company, L.P.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -96,6 +96,7 @@ [Pcd]
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES
+ gEfiNetworkPkgTokenSpaceGuid.PcdHttpIoTimeout ## CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
HttpBootDxeExtra.uni
|