public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance.
@ 2018-09-25  1:11 Jiaxin Wu
  2018-09-25  1:11 ` [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize Jiaxin Wu
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Jiaxin Wu @ 2018-09-25  1:11 UTC (permalink / raw)
  To: edk2-devel
  Cc: Ye Ting, Fu Siyuan, Carsey Jaben, Shao Ming, Laszlo Ersek,
	Wu Jiaxin

*v2: The first three patches(1/2/3) are the same with version 1, just update the last two
patches (4/5):
I) <MdeModulePkg/MdeModulePkg.dec: Define one PCD for PXE to specify MTFTP windowsize.>
This patch has been discarded since we rename and redefine the PCD in NetworkPkg instead 
of MdeModulePkg. The replacement is: 
[PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
II) <NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.>
Since the new PCD (PcdPxeTftpWindowSize) was renamed/defined in NetworkPkg instead of 
MdeModulePkg, we udpate the consuming PXE driver. The new version patch is:
[PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886

The series patches are to support the TFTP windowsize option described in RFC 7440.
TFTP shell command and UEFI PXE driver will use the feature to benefit the download 
performance.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Shao Ming <ming.shao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>

Jiaxin Wu (5):
  MdeModulePke/Mtftp4Dxe: Support windowsize in read request operation.
  NetworkPkg/Mtftp6Dxe: Support windowsize in read request operation.
  ShellPkg/TftpDynamicCommand: Add one option for tftp command to
    specify windowsize.
  NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
  NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.

 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   5 +
 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.h  |  10 ++
 .../Network/Mtftp4Dxe/Mtftp4Option.c          |  25 +++-
 .../Network/Mtftp4Dxe/Mtftp4Option.h          |   8 +-
 .../Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c   |  55 +++++--
 .../Network/Mtftp4Dxe/Mtftp4Support.c         |   8 +-
 .../Network/Mtftp4Dxe/Mtftp4Support.h         |  13 --
 .../Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c   |   2 +-
 NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h             |  13 +-
 NetworkPkg/Mtftp6Dxe/Mtftp6Option.c           |  22 ++-
 NetworkPkg/Mtftp6Dxe/Mtftp6Option.h           |  14 +-
 NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c              |  53 +++++--
 NetworkPkg/Mtftp6Dxe/Mtftp6Support.c          |  10 ++
 NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c              |   2 +-
 NetworkPkg/NetworkPkg.dec                     |   6 +
 NetworkPkg/NetworkPkg.uni                     |   6 +
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c           |  10 +-
 NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c          | 137 +++++++++++++-----
 NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h          |   6 +-
 NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf      |   3 +
 .../DynamicCommand/TftpDynamicCommand/Tftp.c  |  65 +++++++--
 .../TftpDynamicCommand/Tftp.uni               |   6 +-
 22 files changed, 371 insertions(+), 108 deletions(-)

-- 
2.17.1.windows.2



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
  2018-09-25  1:11 [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Jiaxin Wu
@ 2018-09-25  1:11 ` Jiaxin Wu
  2018-09-25 20:12   ` Laszlo Ersek
  2018-09-25  1:11 ` [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified " Jiaxin Wu
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Jiaxin Wu @ 2018-09-25  1:11 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Shao Ming, Laszlo Ersek, Wu Jiaxin

*v2: Rename and redefine the PCD in NetworkPkg instead of MdeModulePkg.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886

This patch is to define one new PCD for PXE driver to specify MTFTP windowsize so as
to improve the PXE download performance. The default value is set to 4.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Shao Ming <ming.shao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 NetworkPkg/NetworkPkg.dec | 6 ++++++
 NetworkPkg/NetworkPkg.uni | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index aae36226d5..aa721d8315 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -90,10 +90,16 @@
   # TRUE  - HTTP connections are allowed. Both the "https://" and "http://" URI schemes are permitted.
   # FALSE - HTTP connections are denied. Only the "https://" URI scheme is permitted.
   # @Prompt Indicates whether HTTP connections are permitted or not.
   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|FALSE|BOOLEAN|0x00000008
 
+  ## This setting is to specify the MTFTP windowsize used by UEFI PXE driver. 
+  # A value of 0 indicates the default value of windowsize(1). 
+  # A non-zero value will be used as windowsize.
+  # @Prompt PXE TFTP windowsize.
+  gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize|0x4|UINT64|0x10000008  
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## IPv6 DHCP Unique Identifier (DUID) Type configuration (From RFCs 3315 and 6355).
   # 01 = DUID Based on Link-layer Address Plus Time [DUID-LLT]
   # 04 = UUID-Based DHCPv6 Unique Identifier (DUID-UUID)
   # 02 = DUID Assigned by Vendor Based on Enterprise Number [DUID-EN] (not supported)
diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni
index 5604b1bf32..07585680e3 100644
--- a/NetworkPkg/NetworkPkg.uni
+++ b/NetworkPkg/NetworkPkg.uni
@@ -53,10 +53,16 @@
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_HELP  #language en-US "Indicates whether HTTP connections are permitted or not.\n"
                                                                                        "TRUE  - HTTP connections are allowed.\n"
                                                                                        "FALSE - HTTP connections are denied."
 
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdPxeTftpWindowSize_PROMPT  #language en-US "This setting is to specify the MTFTP windowsize used by UEFI PXE driver."
+
+#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdPxeTftpWindowSize_HELP  #language en-US "Specify MTFTP windowsize used by UEFI PXE driver.\n"
+                                                                                    "A value of 0 indicates the default value of windowsize(1).\n"
+                                                                                    "A non-zero value will be used as windowsize."                                                                                       
+
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_PROMPT  #language en-US "Enable IPsec IKEv2 Certificate Authentication."
 
 #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_HELP  #language en-US "Indicates if the IPsec IKEv2 Certificate Authentication feature is enabled or not.<BR><BR>\n"
                                                                                           "TRUE  - Certificate Authentication feature is enabled.<BR>\n"
                                                                                           "FALSE - Does not support Certificate Authentication.<BR>"
-- 
2.17.1.windows.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.
  2018-09-25  1:11 [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Jiaxin Wu
  2018-09-25  1:11 ` [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize Jiaxin Wu
@ 2018-09-25  1:11 ` Jiaxin Wu
  2018-09-25 20:23   ` Laszlo Ersek
  2018-09-25  1:40 ` [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Fu, Siyuan
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Jiaxin Wu @ 2018-09-25  1:11 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Shao Ming, Laszlo Ersek, Wu Jiaxin

*v2: Since the new PCD (PcdPxeTftpWindowSize) was renamed/defined in
NetworkPkg instead of MdeModulePkg, this new version is to update the
consuming PXE driver.

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 <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Shao Ming <ming.shao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c      |  10 +-
 NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c     | 137 +++++++++++++++++------
 NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h     |   6 +-
 NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf |   3 +
 4 files changed, 121 insertions(+), 35 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
index 13396903f5..468b38d887 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 PcdPxeTftpWindowSize.
+  //
+  WindowSize = (UINTN) PcdGet64 (PcdPxeTftpWindowSize);
+
   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..e2a0eb44b1 100644
--- a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+++ b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
@@ -53,10 +53,11 @@
 
 
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
+  NetworkPkg/NetworkPkg.dec
 
 
 [LibraryClasses]
   BaseLib
   UefiLib
@@ -105,7 +106,9 @@
 [Guids]
   gEfiAdapterInfoUndiIpv6SupportGuid                   ## SOMETIMES_CONSUMES ## GUID
 
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize      ## SOMETIMES_CONSUMES
+  gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize    ## SOMETIMES_CONSUMES
+
 [UserExtensions.TianoCore."ExtraFiles"]
   UefiPxeBcDxeExtra.uni
-- 
2.17.1.windows.2



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance.
  2018-09-25  1:11 [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Jiaxin Wu
  2018-09-25  1:11 ` [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize Jiaxin Wu
  2018-09-25  1:11 ` [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified " Jiaxin Wu
@ 2018-09-25  1:40 ` Fu, Siyuan
  2018-09-25  8:40 ` Ye, Ting
  2018-09-25 20:07 ` Laszlo Ersek
  4 siblings, 0 replies; 10+ messages in thread
From: Fu, Siyuan @ 2018-09-25  1:40 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org
  Cc: Ye, Ting, Carsey, Jaben, Shao, Ming, Laszlo Ersek

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Tuesday, September 25, 2018 9:12 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Carsey,
> Jaben <jaben.carsey@intel.com>; Shao, Ming <ming.shao@intel.com>; Laszlo
> Ersek <lersek@redhat.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
> Subject: [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download
> performance.
> 
> *v2: The first three patches(1/2/3) are the same with version 1, just
> update the last two
> patches (4/5):
> I) <MdeModulePkg/MdeModulePkg.dec: Define one PCD for PXE to specify MTFTP
> windowsize.>
> This patch has been discarded since we rename and redefine the PCD in
> NetworkPkg instead
> of MdeModulePkg. The replacement is:
> [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP
> windowsize.
> II) <NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.>
> Since the new PCD (PcdPxeTftpWindowSize) was renamed/defined in NetworkPkg
> instead of
> MdeModulePkg, we udpate the consuming PXE driver. The new version patch is:
> [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886
> 
> The series patches are to support the TFTP windowsize option described in
> RFC 7440.
> TFTP shell command and UEFI PXE driver will use the feature to benefit the
> download
> performance.
> 
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Carsey Jaben <jaben.carsey@intel.com>
> Cc: Shao Ming <ming.shao@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
> 
> Jiaxin Wu (5):
>   MdeModulePke/Mtftp4Dxe: Support windowsize in read request operation.
>   NetworkPkg/Mtftp6Dxe: Support windowsize in read request operation.
>   ShellPkg/TftpDynamicCommand: Add one option for tftp command to
>     specify windowsize.
>   NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
>   NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.
> 
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   5 +
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.h  |  10 ++
>  .../Network/Mtftp4Dxe/Mtftp4Option.c          |  25 +++-
>  .../Network/Mtftp4Dxe/Mtftp4Option.h          |   8 +-
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c   |  55 +++++--
>  .../Network/Mtftp4Dxe/Mtftp4Support.c         |   8 +-
>  .../Network/Mtftp4Dxe/Mtftp4Support.h         |  13 --
>  .../Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c   |   2 +-
>  NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h             |  13 +-
>  NetworkPkg/Mtftp6Dxe/Mtftp6Option.c           |  22 ++-
>  NetworkPkg/Mtftp6Dxe/Mtftp6Option.h           |  14 +-
>  NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c              |  53 +++++--
>  NetworkPkg/Mtftp6Dxe/Mtftp6Support.c          |  10 ++
>  NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c              |   2 +-
>  NetworkPkg/NetworkPkg.dec                     |   6 +
>  NetworkPkg/NetworkPkg.uni                     |   6 +
>  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c           |  10 +-
>  NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c          | 137 +++++++++++++-----
>  NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h          |   6 +-
>  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf      |   3 +
>  .../DynamicCommand/TftpDynamicCommand/Tftp.c  |  65 +++++++--
>  .../TftpDynamicCommand/Tftp.uni               |   6 +-
>  22 files changed, 371 insertions(+), 108 deletions(-)
> 
> --
> 2.17.1.windows.2



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance.
  2018-09-25  1:11 [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Jiaxin Wu
                   ` (2 preceding siblings ...)
  2018-09-25  1:40 ` [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Fu, Siyuan
@ 2018-09-25  8:40 ` Ye, Ting
  2018-09-25 20:07 ` Laszlo Ersek
  4 siblings, 0 replies; 10+ messages in thread
From: Ye, Ting @ 2018-09-25  8:40 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org
  Cc: Fu, Siyuan, Carsey, Jaben, Shao, Ming, Laszlo Ersek

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Wu, Jiaxin 
Sent: Tuesday, September 25, 2018 9:12 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>; Shao, Ming <ming.shao@intel.com>; Laszlo Ersek <lersek@redhat.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance.

*v2: The first three patches(1/2/3) are the same with version 1, just update the last two patches (4/5):
I) <MdeModulePkg/MdeModulePkg.dec: Define one PCD for PXE to specify MTFTP windowsize.> This patch has been discarded since we rename and redefine the PCD in NetworkPkg instead of MdeModulePkg. The replacement is: 
[PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
II) <NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.> Since the new PCD (PcdPxeTftpWindowSize) was renamed/defined in NetworkPkg instead of MdeModulePkg, we udpate the consuming PXE driver. The new version patch is:
[PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886

The series patches are to support the TFTP windowsize option described in RFC 7440.
TFTP shell command and UEFI PXE driver will use the feature to benefit the download performance.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Carsey Jaben <jaben.carsey@intel.com>
Cc: Shao Ming <ming.shao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>

Jiaxin Wu (5):
  MdeModulePke/Mtftp4Dxe: Support windowsize in read request operation.
  NetworkPkg/Mtftp6Dxe: Support windowsize in read request operation.
  ShellPkg/TftpDynamicCommand: Add one option for tftp command to
    specify windowsize.
  NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
  NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.

 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c  |   5 +
 .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.h  |  10 ++
 .../Network/Mtftp4Dxe/Mtftp4Option.c          |  25 +++-
 .../Network/Mtftp4Dxe/Mtftp4Option.h          |   8 +-
 .../Universal/Network/Mtftp4Dxe/Mtftp4Rrq.c   |  55 +++++--
 .../Network/Mtftp4Dxe/Mtftp4Support.c         |   8 +-
 .../Network/Mtftp4Dxe/Mtftp4Support.h         |  13 --
 .../Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c   |   2 +-
 NetworkPkg/Mtftp6Dxe/Mtftp6Impl.h             |  13 +-
 NetworkPkg/Mtftp6Dxe/Mtftp6Option.c           |  22 ++-
 NetworkPkg/Mtftp6Dxe/Mtftp6Option.h           |  14 +-
 NetworkPkg/Mtftp6Dxe/Mtftp6Rrq.c              |  53 +++++--
 NetworkPkg/Mtftp6Dxe/Mtftp6Support.c          |  10 ++
 NetworkPkg/Mtftp6Dxe/Mtftp6Wrq.c              |   2 +-
 NetworkPkg/NetworkPkg.dec                     |   6 +
 NetworkPkg/NetworkPkg.uni                     |   6 +
 NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c           |  10 +-
 NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c          | 137 +++++++++++++-----
 NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h          |   6 +-
 NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf      |   3 +
 .../DynamicCommand/TftpDynamicCommand/Tftp.c  |  65 +++++++--
 .../TftpDynamicCommand/Tftp.uni               |   6 +-
 22 files changed, 371 insertions(+), 108 deletions(-)

--
2.17.1.windows.2



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance.
  2018-09-25  1:11 [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Jiaxin Wu
                   ` (3 preceding siblings ...)
  2018-09-25  8:40 ` Ye, Ting
@ 2018-09-25 20:07 ` Laszlo Ersek
  2018-09-26  0:48   ` Wu, Jiaxin
  4 siblings, 1 reply; 10+ messages in thread
From: Laszlo Ersek @ 2018-09-25 20:07 UTC (permalink / raw)
  To: Jiaxin Wu, edk2-devel; +Cc: Ye Ting, Shao Ming, Carsey Jaben, Fu Siyuan

On 09/25/18 03:11, Jiaxin Wu wrote:
> *v2: The first three patches(1/2/3) are the same with version 1, just update the last two
> patches (4/5):
> I) <MdeModulePkg/MdeModulePkg.dec: Define one PCD for PXE to specify MTFTP windowsize.>
> This patch has been discarded since we rename and redefine the PCD in NetworkPkg instead 
> of MdeModulePkg. The replacement is: 
> [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
> II) <NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.>
> Since the new PCD (PcdPxeTftpWindowSize) was renamed/defined in NetworkPkg instead of 
> MdeModulePkg, we udpate the consuming PXE driver. The new version patch is:
> [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886
> 
> The series patches are to support the TFTP windowsize option described in RFC 7440.
> TFTP shell command and UEFI PXE driver will use the feature to benefit the download 
> performance.
> 
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Carsey Jaben <jaben.carsey@intel.com>
> Cc: Shao Ming <ming.shao@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
> 
> Jiaxin Wu (5):
>   MdeModulePke/Mtftp4Dxe: Support windowsize in read request operation.
>   NetworkPkg/Mtftp6Dxe: Support windowsize in read request operation.
>   ShellPkg/TftpDynamicCommand: Add one option for tftp command to
>     specify windowsize.
>   NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
>   NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.

You didn't include the (unchanged) patches #1 through #3 from the v1
series in this posting. Hence, a reminder: please don't forget to pick
up my T-b for patches #1 and #2, from:

http://mid.mail-archive.com/bbd4d8e9-6470-8cc8-ff7d-6b154adbd7ce@redhat.com

I'll comment more elsewhere under the v2 posting.

Thanks!
Laszlo


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
  2018-09-25  1:11 ` [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize Jiaxin Wu
@ 2018-09-25 20:12   ` Laszlo Ersek
  2018-09-26  0:52     ` Wu, Jiaxin
  0 siblings, 1 reply; 10+ messages in thread
From: Laszlo Ersek @ 2018-09-25 20:12 UTC (permalink / raw)
  To: Jiaxin Wu, edk2-devel; +Cc: Ye Ting, Shao Ming, Fu Siyuan

On 09/25/18 03:11, Jiaxin Wu wrote:
> *v2: Rename and redefine the PCD in NetworkPkg instead of MdeModulePkg.
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=886
> 
> This patch is to define one new PCD for PXE driver to specify MTFTP windowsize so as
> to improve the PXE download performance. The default value is set to 4.
> 
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Shao Ming <ming.shao@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/NetworkPkg.dec | 6 ++++++
>  NetworkPkg/NetworkPkg.uni | 6 ++++++
>  2 files changed, 12 insertions(+)

git-am complained about trailing whitespace:

> diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
> index aae36226d5..aa721d8315 100644
> --- a/NetworkPkg/NetworkPkg.dec
> +++ b/NetworkPkg/NetworkPkg.dec
> @@ -90,10 +90,16 @@
>    # TRUE  - HTTP connections are allowed. Both the "https://" and "http://" URI schemes are permitted.
>    # FALSE - HTTP connections are denied. Only the "https://" URI scheme is permitted.
>    # @Prompt Indicates whether HTTP connections are permitted or not.
>    gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|FALSE|BOOLEAN|0x00000008
>  
> +  ## This setting is to specify the MTFTP windowsize used by UEFI PXE driver. 

(1) here

> +  # A value of 0 indicates the default value of windowsize(1). 

(2) here

> +  # A non-zero value will be used as windowsize.
> +  # @Prompt PXE TFTP windowsize.
> +  gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize|0x4|UINT64|0x10000008  

(3) here

> +
>  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>    ## IPv6 DHCP Unique Identifier (DUID) Type configuration (From RFCs 3315 and 6355).
>    # 01 = DUID Based on Link-layer Address Plus Time [DUID-LLT]
>    # 04 = UUID-Based DHCPv6 Unique Identifier (DUID-UUID)
>    # 02 = DUID Assigned by Vendor Based on Enterprise Number [DUID-EN] (not supported)
> diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni
> index 5604b1bf32..07585680e3 100644
> --- a/NetworkPkg/NetworkPkg.uni
> +++ b/NetworkPkg/NetworkPkg.uni
> @@ -53,10 +53,16 @@
>  
>  #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdAllowHttpConnections_HELP  #language en-US "Indicates whether HTTP connections are permitted or not.\n"
>                                                                                         "TRUE  - HTTP connections are allowed.\n"
>                                                                                         "FALSE - HTTP connections are denied."
>  
> +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdPxeTftpWindowSize_PROMPT  #language en-US "This setting is to specify the MTFTP windowsize used by UEFI PXE driver."
> +
> +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdPxeTftpWindowSize_HELP  #language en-US "Specify MTFTP windowsize used by UEFI PXE driver.\n"
> +                                                                                    "A value of 0 indicates the default value of windowsize(1).\n"
> +                                                                                    "A non-zero value will be used as windowsize."                                                                                       

(4) and here.

With those fixed:

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo

> +
>  #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_PROMPT  #language en-US "Enable IPsec IKEv2 Certificate Authentication."
>  
>  #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdIpsecCertificateEnabled_HELP  #language en-US "Indicates if the IPsec IKEv2 Certificate Authentication feature is enabled or not.<BR><BR>\n"
>                                                                                            "TRUE  - Certificate Authentication feature is enabled.<BR>\n"
>                                                                                            "FALSE - Does not support Certificate Authentication.<BR>"
> 



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.
  2018-09-25  1:11 ` [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified " Jiaxin Wu
@ 2018-09-25 20:23   ` Laszlo Ersek
  0 siblings, 0 replies; 10+ messages in thread
From: Laszlo Ersek @ 2018-09-25 20:23 UTC (permalink / raw)
  To: Jiaxin Wu, edk2-devel; +Cc: Ye Ting, Shao Ming, Fu Siyuan

On 09/25/18 03:11, Jiaxin Wu wrote:
> *v2: Since the new PCD (PcdPxeTftpWindowSize) was renamed/defined in
> NetworkPkg instead of MdeModulePkg, this new version is to update the
> consuming PXE driver.
>
> 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 <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Shao Ming <ming.shao@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
> ---
>  NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c      |  10 +-
>  NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.c     | 137 +++++++++++++++++------
>  NetworkPkg/UefiPxeBcDxe/PxeBcMtftp.h     |   6 +-
>  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf |   3 +
>  4 files changed, 121 insertions(+), 35 deletions(-)

I compared this variant against the v1 posting. The difference is very
small (as you explain in the blurb):

> diff --git a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> index 949596c029be..e2a0eb44b1fc 100644
> --- a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> +++ b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> @@ -55,6 +55,7 @@ [Sources]
>  [Packages]
>    MdePkg/MdePkg.dec
>    MdeModulePkg/MdeModulePkg.dec
> +  NetworkPkg/NetworkPkg.dec
>
>
>  [LibraryClasses]
> @@ -107,7 +108,7 @@ [Guids]
>
>  [Pcd]
>    gEfiMdeModulePkgTokenSpaceGuid.PcdTftpBlockSize      ## SOMETIMES_CONSUMES
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdTftpWindowSize     ## SOMETIMES_CONSUMES
> +  gEfiNetworkPkgTokenSpaceGuid.PcdPxeTftpWindowSize    ## SOMETIMES_CONSUMES
>
>  [UserExtensions.TianoCore."ExtraFiles"]
>    UefiPxeBcDxeExtra.uni
> diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> index db463d1b11fb..468b38d887d8 100644
> --- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> +++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
> @@ -874,9 +874,9 @@ EfiPxeBcMtftp (
>    Mode      = Private->PxeBc.Mode;
>
>    //
> -  // Get PcdTftpWindowSize.
> +  // Get PcdPxeTftpWindowSize.
>    //
> -  WindowSize   = (UINTN) PcdGet64 (PcdTftpWindowSize);
> +  WindowSize = (UINTN) PcdGet64 (PcdPxeTftpWindowSize);
>
>    if (Mode->UsingIpv6) {
>      if (!NetIp6IsValidUnicast (&ServerIp->v6)) {

Also, the renaming of the PCD hasn't changed its default value (4), its
data type (UINT64), or its "flavor" ([PcdsFixedAtBuild,
PcdsPatchableInModule]). Therefore, in this specific case, I think we
should carry forward my T-b for this patch (patch #5) as well, from:

http://mid.mail-archive.com/bbd4d8e9-6470-8cc8-ff7d-6b154adbd7ce@redhat.com

Thanks!
Laszlo


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance.
  2018-09-25 20:07 ` Laszlo Ersek
@ 2018-09-26  0:48   ` Wu, Jiaxin
  0 siblings, 0 replies; 10+ messages in thread
From: Wu, Jiaxin @ 2018-09-26  0:48 UTC (permalink / raw)
  To: Laszlo Ersek, edk2-devel@lists.01.org
  Cc: Ye, Ting, Shao, Ming, Carsey, Jaben, Fu, Siyuan

> >   MdeModulePke/Mtftp4Dxe: Support windowsize in read request
> operation.
> >   NetworkPkg/Mtftp6Dxe: Support windowsize in read request operation.
> >   ShellPkg/TftpDynamicCommand: Add one option for tftp command to
> >     specify windowsize.
> >   NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
> >   NetworkPkg/UefiPxeBcDxe: Use the specified MTFTP windowsize.
> 
> You didn't include the (unchanged) patches #1 through #3 from the v1
> series in this posting. Hence, a reminder: please don't forget to pick
> up my T-b for patches #1 and #2, from:
> 

Sure, I will pick up the tag.

Thanks,
Jiaxin


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize.
  2018-09-25 20:12   ` Laszlo Ersek
@ 2018-09-26  0:52     ` Wu, Jiaxin
  0 siblings, 0 replies; 10+ messages in thread
From: Wu, Jiaxin @ 2018-09-26  0:52 UTC (permalink / raw)
  To: Laszlo Ersek, edk2-devel@lists.01.org; +Cc: Ye, Ting, Shao, Ming, Fu, Siyuan

> 
> git-am complained about trailing whitespace:
> 
> 
> (4) and here.
> 
> With those fixed:
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 

I will fix them. Thanks reminder.   /Jiaxin



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-09-26  0:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-25  1:11 [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Jiaxin Wu
2018-09-25  1:11 ` [PATCH v2 4/5] NetworkPkg: Define one PCD for PXE to specify MTFTP windowsize Jiaxin Wu
2018-09-25 20:12   ` Laszlo Ersek
2018-09-26  0:52     ` Wu, Jiaxin
2018-09-25  1:11 ` [PATCH v2 5/5] NetworkPkg/UefiPxeBcDxe: Use the specified " Jiaxin Wu
2018-09-25 20:23   ` Laszlo Ersek
2018-09-25  1:40 ` [PATCH v2 0/5] Support windowsize to benefit tftp/pxe download performance Fu, Siyuan
2018-09-25  8:40 ` Ye, Ting
2018-09-25 20:07 ` Laszlo Ersek
2018-09-26  0:48   ` Wu, Jiaxin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox