diff options
-rwxr-xr-x | BaseTools/Conf/tools_def.template | 4 | ||||
-rwxr-xr-x | BaseTools/Scripts/efi_debugging.py | 36 | ||||
-rw-r--r-- | NetworkPkg/HttpDxe/HttpDriver.h | 2 | ||||
-rw-r--r-- | NetworkPkg/HttpDxe/HttpDxe.inf | 3 | ||||
-rw-r--r-- | NetworkPkg/HttpDxe/HttpProto.c | 9 | ||||
-rw-r--r-- | NetworkPkg/HttpDxe/HttpProto.h | 2 | ||||
-rw-r--r-- | NetworkPkg/NetworkPkg.dec | 7 | ||||
-rw-r--r-- | NetworkPkg/NetworkPkg.uni | 8 |
8 files changed, 62 insertions, 9 deletions
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 11be436e73..04a39e268d 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -1,5 +1,5 @@ #
-# Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2025, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
@@ -943,7 +943,7 @@ DEFINE GCC_LOONGARCH64_ASLDLINK_FLAGS = DEF(GCC_LOONGARCH64_DLINK_FLAGS) -Wl,--e DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h
DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h
-DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h
+DEFINE GCC_VFRPP_FLAGS = -x c -E -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h
DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h
DEFINE GCC_ASLCC_FLAGS = -x c
DEFINE GCC_WINDRES_FLAGS = -J rc -O coff
diff --git a/BaseTools/Scripts/efi_debugging.py b/BaseTools/Scripts/efi_debugging.py index 9848cd5968..1c1446a878 100755 --- a/BaseTools/Scripts/efi_debugging.py +++ b/BaseTools/Scripts/efi_debugging.py @@ -33,6 +33,7 @@ import os import uuid
import struct
import re
+import zlib
from ctypes import c_char, c_uint8, c_uint16, c_uint32, c_uint64, c_void_p
from ctypes import ARRAY, sizeof
from ctypes import Structure, LittleEndianStructure
@@ -1770,8 +1771,10 @@ class EfiConfigurationTable: def __init__(self, file, gST_addr=None):
self._file = file
if gST_addr is None:
- # ToDo add code to search for gST via EFI_SYSTEM_TABLE_POINTER
- return
+ # search for gST via EFI_SYSTEM_TABLE_POINTER
+ system_table_pointer = self._get_system_table_pointer()
+ if not system_table_pointer is None:
+ gST_addr = system_table_pointer.EfiSystemTableBase
gST = self._ctype_read(EFI_SYSTEM_TABLE, gST_addr)
self.read_efi_config_table(gST.NumberOfTableEntries,
@@ -1796,6 +1799,35 @@ class EfiConfigurationTable: data = self._file.read(sizeof(ctype_struct))
return ctype_struct.from_buffer(bytearray(data))
+ def _get_system_table_pointer(self):
+ start_addr = 0x0
+ end_addr = 0xf0000000
+ alignment = 0x00400000
+ # The translation of "IBI SYST" for the signature of EFI_SYSTEM_TABLE
+ efi_system_table_signature = 0x5453595320494249
+
+ system_table_pointer = None
+
+ current_addr = start_addr
+ while current_addr < end_addr:
+ try:
+ self._file.seek(current_addr)
+ data = self._file.read(sizeof(EFI_SYSTEM_TABLE_POINTER))
+ except:
+ current_addr = current_addr + alignment
+ continue
+
+ system_table_pointer = EFI_SYSTEM_TABLE_POINTER.from_buffer(bytearray(data))
+ if system_table_pointer.Signature == efi_system_table_signature:
+ buf1 = bytearray(system_table_pointer)[:16]
+ crc32_value = zlib.crc32(buf1)
+ crc32_value = zlib.crc32(b'\0' * (sizeof(EFI_SYSTEM_TABLE_POINTER) - len(buf1)), crc32_value)
+ if crc32_value == system_table_pointer.Crc32:
+ break
+ system_table_pointer = None
+ current_addr = current_addr + alignment
+ return system_table_pointer
+
@ classmethod
def read_efi_config_table(cls, table_cnt, table_ptr, ctype_read):
'''Create a dictionary of EFI Configuration table entries'''
diff --git a/NetworkPkg/HttpDxe/HttpDriver.h b/NetworkPkg/HttpDxe/HttpDriver.h index e0917f431e..ddee0b7e0c 100644 --- a/NetworkPkg/HttpDxe/HttpDriver.h +++ b/NetworkPkg/HttpDxe/HttpDriver.h @@ -3,6 +3,7 @@ Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
+ (c) Copyright 2025 HP Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -27,6 +28,7 @@ #include <Library/HttpLib.h>
#include <Library/DpcLib.h>
#include <Library/PrintLib.h>
+#include <Library/PcdLib.h>
//
// UEFI Driver Model Protocols
diff --git a/NetworkPkg/HttpDxe/HttpDxe.inf b/NetworkPkg/HttpDxe/HttpDxe.inf index 30b7de1951..865f11b252 100644 --- a/NetworkPkg/HttpDxe/HttpDxe.inf +++ b/NetworkPkg/HttpDxe/HttpDxe.inf @@ -2,6 +2,7 @@ # Implementation of EFI HTTP protocol interfaces.
#
# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
+# (c) Copyright 2025 HP Development Company, L.P.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -48,6 +49,7 @@ HttpLib
DpcLib
PrintLib
+ PcdLib
[Protocols]
gEfiHttpServiceBindingProtocolGuid ## BY_START
@@ -78,6 +80,7 @@ gEfiNetworkPkgTokenSpaceGuid.PcdHttpIoTimeout ## CONSUMES
gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryInterval ## CONSUMES
gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryCount ## CONSUMES
+ gEfiNetworkPkgTokenSpaceGuid.PcdHttpTransferBufferSize ## CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
HttpDxeExtra.uni
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index 1e53811ca7..312ba21789 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -4,6 +4,7 @@ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
+(c) Copyright 2025 HP Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -1090,8 +1091,8 @@ HttpConfigureTcp4 ( IP4_COPY_ADDRESS (&Tcp4AP->RemoteAddress, &HttpInstance->RemoteAddr);
Tcp4Option = Tcp4CfgData->ControlOption;
- Tcp4Option->ReceiveBufferSize = HTTP_BUFFER_SIZE_DEAULT;
- Tcp4Option->SendBufferSize = HTTP_BUFFER_SIZE_DEAULT;
+ Tcp4Option->ReceiveBufferSize = PcdGet32 (PcdHttpTransferBufferSize);
+ Tcp4Option->SendBufferSize = PcdGet32 (PcdHttpTransferBufferSize);
Tcp4Option->MaxSynBackLog = HTTP_MAX_SYN_BACK_LOG;
Tcp4Option->ConnectionTimeout = HTTP_CONNECTION_TIMEOUT;
Tcp4Option->DataRetries = HTTP_DATA_RETRIES;
@@ -1174,8 +1175,8 @@ HttpConfigureTcp6 ( IP6_COPY_ADDRESS (&Tcp6Ap->RemoteAddress, &HttpInstance->RemoteIpv6Addr);
Tcp6Option = Tcp6CfgData->ControlOption;
- Tcp6Option->ReceiveBufferSize = HTTP_BUFFER_SIZE_DEAULT;
- Tcp6Option->SendBufferSize = HTTP_BUFFER_SIZE_DEAULT;
+ Tcp6Option->ReceiveBufferSize = PcdGet32 (PcdHttpTransferBufferSize);
+ Tcp6Option->SendBufferSize = PcdGet32 (PcdHttpTransferBufferSize);
Tcp6Option->MaxSynBackLog = HTTP_MAX_SYN_BACK_LOG;
Tcp6Option->ConnectionTimeout = HTTP_CONNECTION_TIMEOUT;
Tcp6Option->DataRetries = HTTP_DATA_RETRIES;
diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h index 953c464fe9..29828ac448 100644 --- a/NetworkPkg/HttpDxe/HttpProto.h +++ b/NetworkPkg/HttpDxe/HttpProto.h @@ -4,6 +4,7 @@ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
+(c) Copyright 2025 HP Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -38,7 +39,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent //
#define HTTP_TOS_DEAULT 8
#define HTTP_TTL_DEAULT 255
-#define HTTP_BUFFER_SIZE_DEAULT 0x200000
#define HTTP_MAX_SYN_BACK_LOG 5
#define HTTP_CONNECTION_TIMEOUT 60
#define HTTP_DATA_RETRIES 12
diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec index 5db7aa137a..2158dc3f8a 100644 --- a/NetworkPkg/NetworkPkg.dec +++ b/NetworkPkg/NetworkPkg.dec @@ -6,6 +6,7 @@ # Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2015-2020 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) Microsoft Corporation
+# (c) Copyright 2025 HP Development Company, L.P.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -186,5 +187,11 @@ # @Prompt The value of Retry Count, Default value is 0.
gEfiNetworkPkgTokenSpaceGuid.PcdHttpDnsRetryCount|0|UINT32|0x00000011
+ ## The default size of the HTTP transfer data buffer in bytes.
+ # This size is used for HTTP transfers, with a default value of 2MB.
+ # Increasing the buffer size can enhance performance for high-bandwidth connections.
+ # However, reducing the buffer size can reduce packet loss in low-bandwidth scenarios.
+ gEfiNetworkPkgTokenSpaceGuid.PcdHttpTransferBufferSize|0x200000|UINT32|0x00000014
+
[UserExtensions.TianoCore."ExtraFiles"]
NetworkPkgExtra.uni
diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni index c0bbbd3ee1..580449b4d5 100644 --- a/NetworkPkg/NetworkPkg.uni +++ b/NetworkPkg/NetworkPkg.uni @@ -4,6 +4,7 @@ // This package provides network modules that conform to UEFI 2.4 specification.
//
// Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
+// (c) Copyright 2025 HP Development Company, L.P.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
@@ -122,3 +123,10 @@ #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpDnsRetryCount_HELP #language en-US "This value is used to configure the Retry Count of HTTP DNS if "
"no DNS response received after Retry Interval. The default value set is 0."
+
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpTransferBufferSize_PROMPT #language en-US "HTTP default transfer buffer size"
+
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdHttpTransferBufferSize_HELP #language en-US "This value is used to configure the default transfer buffer size for HTTP."
+ "The default value set is 2MB. Larger buffer sizes can improve performance "
+ "for high-bandwidth connections. However, smaller buffer size can reduce packet loss "
+ "in low-bandwidth scenarios."
|