From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 62BBF21138ABF for ; Sun, 16 Sep 2018 22:43:59 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2018 22:43:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,384,1531810800"; d="scan'208";a="263181536" Received: from jiaxinwu-mobl.ccr.corp.intel.com ([10.239.192.143]) by fmsmga005.fm.intel.com with ESMTP; 16 Sep 2018 22:43:57 -0700 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Ye Ting , Fu Siyuan , Shao Ming , Wu Jiaxin Date: Mon, 17 Sep 2018 13:43:48 +0800 Message-Id: <20180917054348.19228-6-Jiaxin.wu@intel.com> X-Mailer: git-send-email 2.17.1.windows.2 In-Reply-To: <20180917054348.19228-1-Jiaxin.wu@intel.com> References: <20180917054348.19228-1-Jiaxin.wu@intel.com> Subject: [Patch 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 05:43:59 -0000 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886 This patch is to use the specified MTFTP windowsize to benefit the PXE download performance. Cc: Ye Ting Cc: Fu Siyuan Cc: Shao Ming Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Wu Jiaxin --- NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c | 10 +- NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c | 137 +++++++++++++++++------ NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h | 6 +- NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf | 2 + 4 files changed, 120 insertions(+), 35 deletions(-) diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c index 13396903f5..db463d1b11 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c @@ -847,11 +847,11 @@ EfiPxeBcMtftp ( EFI_MTFTP4_CONFIG_DATA Mtftp4Config; EFI_MTFTP6_CONFIG_DATA Mtftp6Config; VOID *Config; EFI_STATUS Status; EFI_PXE_BASE_CODE_IP_FILTER IpFilter; - + UINTN WindowSize; if ((This == NULL) || (Filename == NULL) || (BufferSize == NULL) || (ServerIp == NULL) || @@ -871,10 +871,15 @@ EfiPxeBcMtftp ( Config = NULL; Status = EFI_DEVICE_ERROR; Private = PXEBC_PRIVATE_DATA_FROM_PXEBC (This); Mode = Private->PxeBc.Mode; + // + // Get PcdTftpWindowSize. + // + WindowSize = (UINTN) PcdGet64 (PcdTftpWindowSize); + if (Mode->UsingIpv6) { if (!NetIp6IsValidUnicast (&ServerIp->v6)) { return EFI_INVALID_PARAMETER; } } else { @@ -928,10 +933,11 @@ EfiPxeBcMtftp ( Status = PxeBcTftpGetFileSize ( Private, Config, Filename, BlockSize, + (WindowSize > 1) ? &WindowSize : NULL, BufferSize ); break; @@ -942,10 +948,11 @@ EfiPxeBcMtftp ( Status = PxeBcTftpReadFile ( Private, Config, Filename, BlockSize, + (WindowSize > 1) ? &WindowSize : NULL, BufferPtr, BufferSize, DontUseBuffer ); @@ -974,10 +981,11 @@ EfiPxeBcMtftp ( Status = PxeBcTftpReadDirectory ( Private, Config, Filename, BlockSize, + (WindowSize > 1) ? &WindowSize : NULL, BufferPtr, BufferSize, DontUseBuffer ); diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c index 270190d42e..9725fb40dd 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c @@ -17,11 +17,12 @@ CHAR8 *mMtftpOptions[PXE_MTFTP_OPTION_MAXIMUM_INDEX] = { "blksize", "timeout", "tsize", - "multicast" + "multicast", + "windowsize" }; /** This is a callback function when packets are received or transmitted in Mtftp driver. @@ -120,28 +121,31 @@ EFI_STATUS PxeBcMtftp6GetFileSize ( IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP6_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN OUT UINT64 *BufferSize ) { EFI_MTFTP6_PROTOCOL *Mtftp6; - EFI_MTFTP6_OPTION ReqOpt[2]; + EFI_MTFTP6_OPTION ReqOpt[3]; EFI_MTFTP6_PACKET *Packet; EFI_MTFTP6_OPTION *Option; UINT32 PktLen; - UINT8 OptBuf[128]; + UINT8 OptBuf[PXE_MTFTP_OPTBUF_MAXNUM_INDEX]; + UINTN OptBufSize; UINT32 OptCnt; EFI_STATUS Status; *BufferSize = 0; Status = EFI_DEVICE_ERROR; Mtftp6 = Private->Mtftp6; Packet = NULL; Option = NULL; PktLen = 0; + OptBufSize = PXE_MTFTP_OPTBUF_MAXNUM_INDEX; OptCnt = 1; Config->InitialServerPort = PXEBC_BS_DOWNLOAD_PORT; Status = Mtftp6->Configure (Mtftp6, Config); if (EFI_ERROR (Status)) { @@ -150,17 +154,26 @@ PxeBcMtftp6GetFileSize ( // // Build the required options for get info. // ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_TSIZE_INDEX]; - PxeBcUintnToAscDec (0, OptBuf, PXE_MTFTP_OPTBUF_MAXNUM_INDEX); + PxeBcUintnToAscDec (0, OptBuf, OptBufSize); ReqOpt[0].ValueStr = OptBuf; if (BlockSize != NULL) { - ReqOpt[1].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; - ReqOpt[1].ValueStr = (UINT8 *) (ReqOpt[0].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1); - PxeBcUintnToAscDec (*BlockSize, ReqOpt[1].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX - (AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1)); + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, OptBufSize); + OptCnt++; + } + + if (WindowSize != NULL) { + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, OptBufSize); OptCnt++; } Status = Mtftp6->GetInfo ( Mtftp6, @@ -248,20 +261,22 @@ EFI_STATUS PxeBcMtftp6ReadFile ( IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP6_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ) { EFI_MTFTP6_PROTOCOL *Mtftp6; EFI_MTFTP6_TOKEN Token; - EFI_MTFTP6_OPTION ReqOpt[1]; + EFI_MTFTP6_OPTION ReqOpt[2]; UINT32 OptCnt; - UINT8 OptBuf[128]; + UINT8 BlksizeBuf[10]; + UINT8 WindowsizeBuf[10]; EFI_STATUS Status; Status = EFI_DEVICE_ERROR; Mtftp6 = Private->Mtftp6; OptCnt = 0; @@ -271,16 +286,24 @@ PxeBcMtftp6ReadFile ( if (EFI_ERROR (Status)) { return Status; } if (BlockSize != NULL) { - ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; - ReqOpt[0].ValueStr = OptBuf; - PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX); + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = BlksizeBuf; + PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf)); OptCnt++; } + if (WindowSize != NULL) { + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = WindowsizeBuf; + PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf)); + OptCnt++; + } + + Token.Event = NULL; Token.OverrideData = NULL; Token.Filename = Filename; Token.ModeStr = NULL; Token.OptionCount = OptCnt; @@ -406,20 +429,22 @@ EFI_STATUS PxeBcMtftp6ReadDirectory ( IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP6_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ) { EFI_MTFTP6_PROTOCOL *Mtftp6; EFI_MTFTP6_TOKEN Token; - EFI_MTFTP6_OPTION ReqOpt[1]; + EFI_MTFTP6_OPTION ReqOpt[2]; UINT32 OptCnt; - UINT8 OptBuf[128]; + UINT8 BlksizeBuf[10]; + UINT8 WindowsizeBuf[10]; EFI_STATUS Status; Status = EFI_DEVICE_ERROR; Mtftp6 = Private->Mtftp6; OptCnt = 0; @@ -429,13 +454,20 @@ PxeBcMtftp6ReadDirectory ( if (EFI_ERROR (Status)) { return Status; } if (BlockSize != NULL) { - ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; - ReqOpt[0].ValueStr = OptBuf; - PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX); + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = BlksizeBuf; + PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf)); + OptCnt++; + } + + if (WindowSize != NULL) { + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = WindowsizeBuf; + PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf)); OptCnt++; } Token.Event = NULL; Token.OverrideData = NULL; @@ -566,28 +598,31 @@ EFI_STATUS PxeBcMtftp4GetFileSize ( IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP4_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN OUT UINT64 *BufferSize ) { EFI_MTFTP4_PROTOCOL *Mtftp4; - EFI_MTFTP4_OPTION ReqOpt[2]; + EFI_MTFTP4_OPTION ReqOpt[3]; EFI_MTFTP4_PACKET *Packet; EFI_MTFTP4_OPTION *Option; UINT32 PktLen; - UINT8 OptBuf[128]; + UINT8 OptBuf[PXE_MTFTP_OPTBUF_MAXNUM_INDEX]; + UINTN OptBufSize; UINT32 OptCnt; EFI_STATUS Status; *BufferSize = 0; Status = EFI_DEVICE_ERROR; Mtftp4 = Private->Mtftp4; Packet = NULL; Option = NULL; PktLen = 0; + OptBufSize = PXE_MTFTP_OPTBUF_MAXNUM_INDEX; OptCnt = 1; Config->InitialServerPort = PXEBC_BS_DOWNLOAD_PORT; Status = Mtftp4->Configure (Mtftp4, Config); if (EFI_ERROR (Status)) { @@ -596,17 +631,26 @@ PxeBcMtftp4GetFileSize ( // // Build the required options for get info. // ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_TSIZE_INDEX]; - PxeBcUintnToAscDec (0, OptBuf, PXE_MTFTP_OPTBUF_MAXNUM_INDEX); + PxeBcUintnToAscDec (0, OptBuf, OptBufSize); ReqOpt[0].ValueStr = OptBuf; if (BlockSize != NULL) { - ReqOpt[1].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; - ReqOpt[1].ValueStr = (UINT8 *) (ReqOpt[0].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1); - PxeBcUintnToAscDec (*BlockSize, ReqOpt[1].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX - (AsciiStrLen ((CHAR8 *) ReqOpt[0].ValueStr) + 1)); + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, OptBufSize); + OptCnt++; + } + + if (WindowSize != NULL) { + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = (UINT8 *) (ReqOpt[OptCnt-1].ValueStr + AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + OptBufSize -= (AsciiStrLen ((CHAR8 *) ReqOpt[OptCnt-1].ValueStr) + 1); + PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, OptBufSize); OptCnt++; } Status = Mtftp4->GetInfo ( Mtftp4, @@ -694,20 +738,22 @@ EFI_STATUS PxeBcMtftp4ReadFile ( IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP4_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ) { EFI_MTFTP4_PROTOCOL *Mtftp4; EFI_MTFTP4_TOKEN Token; - EFI_MTFTP4_OPTION ReqOpt[1]; + EFI_MTFTP4_OPTION ReqOpt[2]; UINT32 OptCnt; - UINT8 OptBuf[128]; + UINT8 BlksizeBuf[10]; + UINT8 WindowsizeBuf[10]; EFI_STATUS Status; Status = EFI_DEVICE_ERROR; Mtftp4 = Private->Mtftp4; OptCnt = 0; @@ -717,13 +763,20 @@ PxeBcMtftp4ReadFile ( if (EFI_ERROR (Status)) { return Status; } if (BlockSize != NULL) { - ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; - ReqOpt[0].ValueStr = OptBuf; - PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX); + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = BlksizeBuf; + PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf)); + OptCnt++; + } + + if (WindowSize != NULL) { + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = WindowsizeBuf; + PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf)); OptCnt++; } Token.Event = NULL; Token.OverrideData = NULL; @@ -852,20 +905,22 @@ EFI_STATUS PxeBcMtftp4ReadDirectory ( IN PXEBC_PRIVATE_DATA *Private, IN EFI_MTFTP4_CONFIG_DATA *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ) { EFI_MTFTP4_PROTOCOL *Mtftp4; EFI_MTFTP4_TOKEN Token; - EFI_MTFTP4_OPTION ReqOpt[1]; + EFI_MTFTP4_OPTION ReqOpt[2]; UINT32 OptCnt; - UINT8 OptBuf[128]; + UINT8 BlksizeBuf[10]; + UINT8 WindowsizeBuf[10]; EFI_STATUS Status; Status = EFI_DEVICE_ERROR; Mtftp4 = Private->Mtftp4; OptCnt = 0; @@ -875,13 +930,20 @@ PxeBcMtftp4ReadDirectory ( if (EFI_ERROR (Status)) { return Status; } if (BlockSize != NULL) { - ReqOpt[0].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; - ReqOpt[0].ValueStr = OptBuf; - PxeBcUintnToAscDec (*BlockSize, ReqOpt[0].ValueStr, PXE_MTFTP_OPTBUF_MAXNUM_INDEX); + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_BLKSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = BlksizeBuf; + PxeBcUintnToAscDec (*BlockSize, ReqOpt[OptCnt].ValueStr, sizeof (BlksizeBuf)); + OptCnt++; + } + + if (WindowSize != NULL) { + ReqOpt[OptCnt].OptionStr = (UINT8 *) mMtftpOptions[PXE_MTFTP_OPTION_WINDOWSIZE_INDEX]; + ReqOpt[OptCnt].ValueStr = WindowsizeBuf; + PxeBcUintnToAscDec (*WindowSize, ReqOpt[OptCnt].ValueStr, sizeof (WindowsizeBuf)); OptCnt++; } Token.Event = NULL; Token.OverrideData = NULL; @@ -934,27 +996,30 @@ EFI_STATUS PxeBcTftpGetFileSize ( IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN OUT UINT64 *BufferSize ) { if (Private->PxeBc.Mode->UsingIpv6) { return PxeBcMtftp6GetFileSize ( Private, (EFI_MTFTP6_CONFIG_DATA *) Config, Filename, BlockSize, + WindowSize, BufferSize ); } else { return PxeBcMtftp4GetFileSize ( Private, (EFI_MTFTP4_CONFIG_DATA *) Config, Filename, BlockSize, + WindowSize, BufferSize ); } } @@ -979,10 +1044,11 @@ EFI_STATUS PxeBcTftpReadFile ( IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ) { @@ -990,20 +1056,22 @@ PxeBcTftpReadFile ( return PxeBcMtftp6ReadFile ( Private, (EFI_MTFTP6_CONFIG_DATA *) Config, Filename, BlockSize, + WindowSize, BufferPtr, BufferSize, DontUseBuffer ); } else { return PxeBcMtftp4ReadFile ( Private, (EFI_MTFTP4_CONFIG_DATA *) Config, Filename, BlockSize, + WindowSize, BufferPtr, BufferSize, DontUseBuffer ); } @@ -1081,10 +1149,11 @@ EFI_STATUS PxeBcTftpReadDirectory ( IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ) { @@ -1092,20 +1161,22 @@ PxeBcTftpReadDirectory ( return PxeBcMtftp6ReadDirectory ( Private, (EFI_MTFTP6_CONFIG_DATA *) Config, Filename, BlockSize, + WindowSize, BufferPtr, BufferSize, DontUseBuffer ); } else { return PxeBcMtftp4ReadDirectory ( Private, (EFI_MTFTP4_CONFIG_DATA *) Config, Filename, BlockSize, + WindowSize, BufferPtr, BufferSize, DontUseBuffer ); } diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h index f1150762c6..edd8decbd8 100644 --- a/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h @@ -18,11 +18,12 @@ #define PXE_MTFTP_OPTION_BLKSIZE_INDEX 0 #define PXE_MTFTP_OPTION_TIMEOUT_INDEX 1 #define PXE_MTFTP_OPTION_TSIZE_INDEX 2 #define PXE_MTFTP_OPTION_MULTICAST_INDEX 3 -#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 4 +#define PXE_MTFTP_OPTION_WINDOWSIZE_INDEX 4 +#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 5 #define PXE_MTFTP_OPTBUF_MAXNUM_INDEX 128 #define PXE_MTFTP_ERROR_STRING_LENGTH 127 // refer to definition of struct EFI_PXE_BASE_CODE_TFTP_ERROR. #define PXE_MTFTP_DEFAULT_BLOCK_SIZE 512 // refer to rfc-1350. @@ -46,10 +47,11 @@ EFI_STATUS PxeBcTftpGetFileSize ( IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN OUT UINT64 *BufferSize ); /** @@ -72,10 +74,11 @@ EFI_STATUS PxeBcTftpReadFile ( IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ); @@ -128,10 +131,11 @@ EFI_STATUS PxeBcTftpReadDirectory ( IN PXEBC_PRIVATE_DATA *Private, IN VOID *Config, IN UINT8 *Filename, IN UINTN *BlockSize, + IN UINTN *WindowSize, IN UINT8 *BufferPtr, IN OUT UINT64 *BufferSize, IN BOOLEAN DontUseBuffer ); #endif diff --git a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf index 55fa2b3c8c..949596c029 100644 --- a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf +++ b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf @@ -105,7 +105,9 @@ [Guids] gEfiAdapterInfoUndiIpv6SupportGuid ## SOMETIMES_CONSUMES ## GUID [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdTftpWindowSize ## SOMETIMES_CONSUMES + [UserExtensions.TianoCore."ExtraFiles"] UefiPxeBcDxeExtra.uni -- 2.17.1.windows.2