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