NetworkPkg: Increase HTTP buffer size and enable TCP window scaling

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4505
This gives something like ~3 fold throughput boost.

Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
Andrei Otcheretianski 2023-07-20 22:17:59 -07:00 committed by mergify[bot]
parent d4ae5df711
commit b240eab035
3 changed files with 27 additions and 25 deletions

View File

@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#ifndef __EFI_HTTP_BOOT_HTTP_H__ #ifndef __EFI_HTTP_BOOT_HTTP_H__
#define __EFI_HTTP_BOOT_HTTP_H__ #define __EFI_HTTP_BOOT_HTTP_H__
#define HTTP_BOOT_BLOCK_SIZE 1500 #define HTTP_BOOT_BLOCK_SIZE 32000
#define HTTP_USER_AGENT_EFI_HTTP_BOOT "UefiHttpBoot/1.0" #define HTTP_USER_AGENT_EFI_HTTP_BOOT "UefiHttpBoot/1.0"
#define HTTP_BOOT_AUTHENTICATION_INFO_MAX_LEN 255 #define HTTP_BOOT_AUTHENTICATION_INFO_MAX_LEN 255

View File

@ -1084,6 +1084,7 @@ HttpConfigureTcp4 (
Tcp4Option->KeepAliveTime = HTTP_KEEP_ALIVE_TIME; Tcp4Option->KeepAliveTime = HTTP_KEEP_ALIVE_TIME;
Tcp4Option->KeepAliveInterval = HTTP_KEEP_ALIVE_INTERVAL; Tcp4Option->KeepAliveInterval = HTTP_KEEP_ALIVE_INTERVAL;
Tcp4Option->EnableNagle = TRUE; Tcp4Option->EnableNagle = TRUE;
Tcp4Option->EnableWindowScaling = TRUE;
Tcp4CfgData->ControlOption = Tcp4Option; Tcp4CfgData->ControlOption = Tcp4Option;
if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) || if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) ||
@ -1167,6 +1168,7 @@ HttpConfigureTcp6 (
Tcp6Option->KeepAliveTime = HTTP_KEEP_ALIVE_TIME; Tcp6Option->KeepAliveTime = HTTP_KEEP_ALIVE_TIME;
Tcp6Option->KeepAliveInterval = HTTP_KEEP_ALIVE_INTERVAL; Tcp6Option->KeepAliveInterval = HTTP_KEEP_ALIVE_INTERVAL;
Tcp6Option->EnableNagle = TRUE; Tcp6Option->EnableNagle = TRUE;
Tcp6Option->EnableWindowScaling = TRUE;
if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) || if ((HttpInstance->State == HTTP_STATE_TCP_CONNECTED) ||
(HttpInstance->State == HTTP_STATE_TCP_CLOSED)) (HttpInstance->State == HTTP_STATE_TCP_CLOSED))

View File

@ -37,7 +37,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
// //
#define HTTP_TOS_DEAULT 8 #define HTTP_TOS_DEAULT 8
#define HTTP_TTL_DEAULT 255 #define HTTP_TTL_DEAULT 255
#define HTTP_BUFFER_SIZE_DEAULT 65535 #define HTTP_BUFFER_SIZE_DEAULT 0x200000
#define HTTP_MAX_SYN_BACK_LOG 5 #define HTTP_MAX_SYN_BACK_LOG 5
#define HTTP_CONNECTION_TIMEOUT 60 #define HTTP_CONNECTION_TIMEOUT 60
#define HTTP_DATA_RETRIES 12 #define HTTP_DATA_RETRIES 12