From nobody Fri Nov 1 01:05:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+107122+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107122+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1689916692; cv=none; d=zohomail.com; s=zohoarc; b=Q4eEmiQnlktk+p68FcKsHUV9emoLHbIBJypksD1MN1El7kG/R6TYLOiNhDRtPIsl0BeoJBFNWWr/E0tcLCRJhG1+qBEsbpaCrv8+rN5mkwnk/cp34MfHnhhB0yWad1IMlGEhZVx03erX8nf/Ge9tJsuGw6BzDDoPfg9iGoxd9DM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689916692; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=2pogiG3JlfmP63x/THrZhS+7N1jnNEFXxIO2RsNpa8A=; b=BubRp9VPrUUSup6yDp1cdVM3Pc4DsbQihmgESiQ0Bc/BIVSfjNf9zqbwznYOTYQk80soCOTbwlXz9dUcs58IMsADL1tx6NYIs7PK9v3GtrIpmNO/+3auTGEYQBMwCr+XbTZvn7LUcBYSuLMzm5UTugFI5ueu8MQ6mtnZ0Tf47Go= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107122+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1689916692384537.427598384817; Thu, 20 Jul 2023 22:18:12 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=HedzsZRWO5XE4x6xpplq9SURwdZAFGpeN7YE/v8Aots=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-IronPort-AV:X-IronPort-AV:X-Received:X-ExtLoop1:X-IronPort-AV:X-Received:From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1689916692; v=1; b=s2HXSZuvA/+vbIA8Fp/LB0oycogWCGOqTieeYraFja0thZ2f98T071zmEhSXKtcnlr2gGlEw T6RsHpbbXxnJtJXOGGG8GgLTLvo/RnqjI5xt+BoO3GPO/0El0DzoixYRsVljfxnowJQ41wTaBBf fxRneBxp8IpWm2xkjsE2XrEk= X-Received: by 127.0.0.2 with SMTP id XvzqYY1788612x2ysBlETYfi; Thu, 20 Jul 2023 22:18:12 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.1003.1689916691095634580 for ; Thu, 20 Jul 2023 22:18:11 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10777"; a="366975759" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="366975759" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 22:18:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="868101832" X-Received: from liyi4-desktop.ccr.corp.intel.com ([10.239.153.10]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 22:18:09 -0700 From: "Li, Yi" To: devel@edk2.groups.io Cc: Yi Li , Andrei Otcheretianski , Saloni Kasbekar , Zachary Clark-williams Subject: [edk2-devel] [PATCH] NetworkPkg: Increase HTTP buffer size and enable TCP window scaling Date: Fri, 21 Jul 2023 13:17:59 +0800 Message-Id: <20230721051759.7021-1-yi1.li@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,yi1.li@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: R3MpzNqkSwqT9Rx3YIdn33l2x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1689916693762100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4505 This gives something like ~3 fold throughput boost. Signed-off-by: Andrei Otcheretianski Cc: Saloni Kasbekar Cc: Zachary Clark-williams Acked-by: Michael D Kinney Reviewed-by: Saloni Kasbekar --- NetworkPkg/HttpBootDxe/HttpBootClient.h | 2 +- NetworkPkg/HttpDxe/HttpProto.c | 48 +++++++++++++------------ NetworkPkg/HttpDxe/HttpProto.h | 2 +- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.h b/NetworkPkg/HttpBootD= xe/HttpBootClient.h index 2fba713679..86a28bc91a 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootClient.h +++ b/NetworkPkg/HttpBootDxe/HttpBootClient.h @@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef __EFI_HTTP_BOOT_HTTP_H__ #define __EFI_HTTP_BOOT_HTTP_H__ =20 -#define HTTP_BOOT_BLOCK_SIZE 1500 +#define HTTP_BOOT_BLOCK_SIZE 32000 #define HTTP_USER_AGENT_EFI_HTTP_BOOT "UefiHttpBoot/1.0" #define HTTP_BOOT_AUTHENTICATION_INFO_MAX_LEN 255 =20 diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c index 33ae622c3f..7dfb82dd2e 100644 --- a/NetworkPkg/HttpDxe/HttpProto.c +++ b/NetworkPkg/HttpDxe/HttpProto.c @@ -1073,18 +1073,19 @@ HttpConfigureTcp4 ( Tcp4AP->ActiveFlag =3D TRUE; IP4_COPY_ADDRESS (&Tcp4AP->RemoteAddress, &HttpInstance->RemoteAddr); =20 - Tcp4Option =3D Tcp4CfgData->ControlOption; - Tcp4Option->ReceiveBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; - Tcp4Option->SendBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; - Tcp4Option->MaxSynBackLog =3D HTTP_MAX_SYN_BACK_LOG; - Tcp4Option->ConnectionTimeout =3D HTTP_CONNECTION_TIMEOUT; - Tcp4Option->DataRetries =3D HTTP_DATA_RETRIES; - Tcp4Option->FinTimeout =3D HTTP_FIN_TIMEOUT; - Tcp4Option->KeepAliveProbes =3D HTTP_KEEP_ALIVE_PROBES; - Tcp4Option->KeepAliveTime =3D HTTP_KEEP_ALIVE_TIME; - Tcp4Option->KeepAliveInterval =3D HTTP_KEEP_ALIVE_INTERVAL; - Tcp4Option->EnableNagle =3D TRUE; - Tcp4CfgData->ControlOption =3D Tcp4Option; + Tcp4Option =3D Tcp4CfgData->ControlOption; + Tcp4Option->ReceiveBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; + Tcp4Option->SendBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; + Tcp4Option->MaxSynBackLog =3D HTTP_MAX_SYN_BACK_LOG; + Tcp4Option->ConnectionTimeout =3D HTTP_CONNECTION_TIMEOUT; + Tcp4Option->DataRetries =3D HTTP_DATA_RETRIES; + Tcp4Option->FinTimeout =3D HTTP_FIN_TIMEOUT; + Tcp4Option->KeepAliveProbes =3D HTTP_KEEP_ALIVE_PROBES; + Tcp4Option->KeepAliveTime =3D HTTP_KEEP_ALIVE_TIME; + Tcp4Option->KeepAliveInterval =3D HTTP_KEEP_ALIVE_INTERVAL; + Tcp4Option->EnableNagle =3D TRUE; + Tcp4Option->EnableWindowScaling =3D TRUE; + Tcp4CfgData->ControlOption =3D Tcp4Option; =20 if ((HttpInstance->State =3D=3D HTTP_STATE_TCP_CONNECTED) || (HttpInstance->State =3D=3D HTTP_STATE_TCP_CLOSED)) @@ -1156,17 +1157,18 @@ HttpConfigureTcp6 ( IP6_COPY_ADDRESS (&Tcp6Ap->StationAddress, &HttpInstance->Ipv6Node.Local= Address); IP6_COPY_ADDRESS (&Tcp6Ap->RemoteAddress, &HttpInstance->RemoteIpv6Addr); =20 - Tcp6Option =3D Tcp6CfgData->ControlOption; - Tcp6Option->ReceiveBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; - Tcp6Option->SendBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; - Tcp6Option->MaxSynBackLog =3D HTTP_MAX_SYN_BACK_LOG; - Tcp6Option->ConnectionTimeout =3D HTTP_CONNECTION_TIMEOUT; - Tcp6Option->DataRetries =3D HTTP_DATA_RETRIES; - Tcp6Option->FinTimeout =3D HTTP_FIN_TIMEOUT; - Tcp6Option->KeepAliveProbes =3D HTTP_KEEP_ALIVE_PROBES; - Tcp6Option->KeepAliveTime =3D HTTP_KEEP_ALIVE_TIME; - Tcp6Option->KeepAliveInterval =3D HTTP_KEEP_ALIVE_INTERVAL; - Tcp6Option->EnableNagle =3D TRUE; + Tcp6Option =3D Tcp6CfgData->ControlOption; + Tcp6Option->ReceiveBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; + Tcp6Option->SendBufferSize =3D HTTP_BUFFER_SIZE_DEAULT; + Tcp6Option->MaxSynBackLog =3D HTTP_MAX_SYN_BACK_LOG; + Tcp6Option->ConnectionTimeout =3D HTTP_CONNECTION_TIMEOUT; + Tcp6Option->DataRetries =3D HTTP_DATA_RETRIES; + Tcp6Option->FinTimeout =3D HTTP_FIN_TIMEOUT; + Tcp6Option->KeepAliveProbes =3D HTTP_KEEP_ALIVE_PROBES; + Tcp6Option->KeepAliveTime =3D HTTP_KEEP_ALIVE_TIME; + Tcp6Option->KeepAliveInterval =3D HTTP_KEEP_ALIVE_INTERVAL; + Tcp6Option->EnableNagle =3D TRUE; + Tcp6Option->EnableWindowScaling =3D TRUE; =20 if ((HttpInstance->State =3D=3D HTTP_STATE_TCP_CONNECTED) || (HttpInstance->State =3D=3D HTTP_STATE_TCP_CLOSED)) diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h index 620eb39158..012f1f4b46 100644 --- a/NetworkPkg/HttpDxe/HttpProto.h +++ b/NetworkPkg/HttpDxe/HttpProto.h @@ -37,7 +37,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // #define HTTP_TOS_DEAULT 8 #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_CONNECTION_TIMEOUT 60 #define HTTP_DATA_RETRIES 12 --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107122): https://edk2.groups.io/g/devel/message/107122 Mute This Topic: https://groups.io/mt/100271527/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-