MdeModulePkg: Change the default IPv4 config policy

Git version '3d0a49ad' commit provided a scenario to resolve the
performance issue for IPv4, but it's not workable for IPv6. To
avoid IPv4 and IPv6 inconsistency, we decided to revert that version
fix.

If so, the default policy for Ip4Config2 is Ip4Config2PolicyDhcp,
which results in all NIC ports attempting DHCP. So, this patch is
used to changes the the default IPv4 config policy to
Ip4Config2PolicyStatic and also defer the SetData operation after
Ip4Config2Protocol installed. This update let the other platform
drivers have chance to change the default config data by consume
Ip4Config2Protocol.

Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: El-Haj-Mahmoud Samer <samer.el-haj-mahmoud@hpe.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Subramanian Sriram <sriram-s@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Jiaxin Wu
2016-02-25 10:48:58 +08:00
parent d0d34cdf1d
commit 7648748e99
5 changed files with 150 additions and 107 deletions

View File

@@ -1,7 +1,7 @@
/** @file
Definitions for EFI IPv4 Configuration II Protocol implementation.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
@@ -212,6 +212,26 @@ typedef struct {
} IP4_CONFIG2_DHCP4_OPTION;
#pragma pack()
/**
Read the configuration data from variable storage according to the VarName and
gEfiIp4Config2ProtocolGuid. It checks the integrity of variable data. If the
data is corrupted, it clears the variable data to ZERO. Othewise, it outputs the
configuration data to IP4_CONFIG2_INSTANCE.
@param[in] VarName The pointer to the variable name
@param[in, out] Instance The pointer to the IP4 config2 instance data.
@retval EFI_NOT_FOUND The variable can not be found or already corrupted.
@retval EFI_OUT_OF_RESOURCES Fail to allocate resource to complete the operation.
@retval EFI_SUCCESS The configuration data was retrieved successfully.
**/
EFI_STATUS
Ip4Config2ReadConfigData (
IN CHAR16 *VarName,
IN OUT IP4_CONFIG2_INSTANCE *Instance
);
/**
Start the DHCP configuration for this IP service instance.
It will locates the EFI_IP4_CONFIG2_PROTOCOL, then start the
@@ -253,6 +273,20 @@ Ip4Config2CleanInstance (
IN OUT IP4_CONFIG2_INSTANCE *Instance
);
/**
Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK.
@param Event The event that is signalled.
@param Context The IP4 service binding instance.
**/
VOID
EFIAPI
Ip4AutoReconfigCallBack (
IN EFI_EVENT Event,
IN VOID *Context
);
/**
Destroy the Dhcp4 child in IP4_CONFIG2_INSTANCE and release the resources.