]> git.proxmox.com Git - mirror_edk2.git/commitdiff
changing UDP default timeout value to 2s to improve PXE BC boot performance.
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Mar 2010 11:35:35 +0000 (11:35 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 18 Mar 2010 11:35:35 +0000 (11:35 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10282 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDriver.c
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcImpl.h
MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.c

index f82f744b762fb0a022b4089892e19207280c5bc0..33e7a3769f3c1b3dea046f586415b7ef1a407b98 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
   The driver binding for UEFI PXEBC protocol.\r
-  \r
+\r
 Copyright (c) 2007 - 2009, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -60,7 +60,7 @@ PxeBcDriverEntryPoint (
   order to make drivers as small as possible, there are a few calling\r
   restrictions for this service. ConnectController() must\r
   follow these calling restrictions. If any other agent wishes to call\r
-  Supported() it must also follow these calling restrictions.  \r
+  Supported() it must also follow these calling restrictions.\r
   PxeBc requires DHCP4 and MTFTP4 protocols.\r
 \r
   @param  This                Protocol instance pointer.\r
@@ -260,7 +260,7 @@ PxeBcDriverBindingStart (
   //
   Status = Private->Ip4->GetModeData (Private->Ip4, &Ip4ModeData, NULL, NULL);
   if (EFI_ERROR (Status)) {
-    goto ON_ERROR;  
+    goto ON_ERROR;
   }
 
   Private->Ip4MaxPacketSize = Ip4ModeData.MaxPacketSize;\r
@@ -320,7 +320,7 @@ PxeBcDriverBindingStart (
   // The UDP instance for EfiPxeBcUdpWrite\r
   //\r
   Status = NetLibCreateServiceChild (\r
-             ControllerHandle, \r
+             ControllerHandle,\r
              This->DriverBindingHandle,\r
              &gEfiUdp4ServiceBindingProtocolGuid,\r
              &Private->Udp4WriteChild\r
@@ -348,7 +348,7 @@ PxeBcDriverBindingStart (
   Private->Udp4CfgData.TypeOfService      = DEFAULT_ToS;\r
   Private->Udp4CfgData.TimeToLive         = DEFAULT_TTL;\r
   Private->Udp4CfgData.DoNotFragment      = FALSE;\r
-  Private->Udp4CfgData.ReceiveTimeout     = 50000;  // 50 milliseconds\r
+  Private->Udp4CfgData.ReceiveTimeout     = PXEBC_DEFAULT_LIFETIME;\r
   Private->Udp4CfgData.UseDefaultAddress  = FALSE;\r
 \r
   PxeBcInitSeedPacket (&Private->SeedPacket, Private->Udp4Read);\r
@@ -487,7 +487,7 @@ ON_ERROR:
   restrictions for this service. DisconnectController()\r
   must follow these calling restrictions. If any other agent wishes\r
   to call Stop() it must also follow these calling restrictions.\r
-  \r
+\r
   @param  This              Protocol instance pointer.\r
   @param  ControllerHandle  Handle of device to stop driver on\r
   @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
@@ -545,7 +545,7 @@ PxeBcDriverBindingStop (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Stop functionality of PXE Base Code protocol\r
   //\r
index 807e4d128a7ed94001fa5ec38054992e243d9a83..806a6862d5be1001627c46f91dffb1a770d1e30a 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2007 - 2010, Intel Corporation.<BR>                                                         \r
+Copyright (c) 2007 - 2010, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -51,7 +51,8 @@ typedef struct _PXEBC_PRIVATE_DATA  PXEBC_PRIVATE_DATA;
 #define PXEBC_MTFTP_RETRIES                6\r
 #define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE    8
 #define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE   4\r
-#define PXEBC_DEFAULT_PACKET_SIZE          1480 \r
+#define PXEBC_DEFAULT_PACKET_SIZE          1480\r
+#define PXEBC_DEFAULT_LIFETIME             2000000  // 2 seconds, unit is microsecond\r
 \r
 struct _PXEBC_PRIVATE_DATA {\r
   UINT32                                    Signature;\r
@@ -146,21 +147,21 @@ extern EFI_LOAD_FILE_PROTOCOL     mLoadFileProtocolTemplate;
 \r
   @param  This                  Protocol instance pointer.\r
   @param  FilePath              The device specific path of the file to load.\r
-  @param  BootPolicy            If TRUE, indicates that the request originates from the \r
+  @param  BootPolicy            If TRUE, indicates that the request originates from the\r
                                 boot manager is attempting to load FilePath as a boot\r
                                 selection. If FALSE, then FilePath must match as exact file\r
                                 to be loaded.\r
   @param  BufferSize            On input the size of Buffer in bytes. On output with a return\r
-                                code of EFI_SUCCESS, the amount of data transferred to \r
+                                code of EFI_SUCCESS, the amount of data transferred to\r
                                 Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,\r
                                 the size of Buffer required to retrieve the requested file.\r
   @param  Buffer                The memory buffer to transfer the file to. IF Buffer is NULL,\r
-                                then no the size of the requested file is returned in \r
+                                then no the size of the requested file is returned in\r
                                 BufferSize.\r
 \r
   @retval EFI_SUCCESS                 The file was loaded.\r
   @retval EFI_UNSUPPORTED             The device does not support the provided BootPolicy\r
-  @retval EFI_INVALID_PARAMETER       FilePath is not a valid device path, or \r
+  @retval EFI_INVALID_PARAMETER       FilePath is not a valid device path, or\r
                                       BufferSize is NULL.\r
   @retval EFI_NO_MEDIA                No medium was present to load the file.\r
   @retval EFI_DEVICE_ERROR            The file was not loaded due to a device error.\r
index d425b1ff8f3aa6007ec20f3021ff75627a952423..9e6b47aa1233e671cb7122b8bbf6c5594bc22fb1 100644 (file)
@@ -194,7 +194,7 @@ PxeBcConfigureUdpWriteInstance (
 \r
   ZeroMem (&Udp4CfgData, sizeof (Udp4CfgData));\r
 \r
-  Udp4CfgData.ReceiveTimeout = 1000;\r
+  Udp4CfgData.ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;\r
   Udp4CfgData.TypeOfService  = DEFAULT_ToS;\r
   Udp4CfgData.TimeToLive     = DEFAULT_TTL;\r
   Udp4CfgData.AllowDuplicatePort = TRUE;\r