MdeModulePkg/Ip4Dxe: Add an independent timer for reconfig checking

* Since wireless network can switch at very short time, the time interval
  of reconfig event checking is too long for this case. To achieve better
  performance and scalability, separate this task from Ip4 tick timer.

Cc: Jiaxin Wu <jiaxin.wu@intel.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: Wang Fan <fan.wang@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
(cherry picked from commit 018432f0ce)
This commit is contained in:
Wang Fan
2018-01-11 15:28:41 +08:00
committed by Jiaxin Wu
parent e2cef60f80
commit 9bdb89e8ba
3 changed files with 83 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for IP4 driver.
Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
@@ -253,6 +253,7 @@ Ip4CreateService (
ZeroMem (&IpSb->SnpMode, sizeof (EFI_SIMPLE_NETWORK_MODE));
IpSb->Timer = NULL;
IpSb->ReconfigCheckTimer = NULL;
IpSb->ReconfigEvent = NULL;
@@ -284,6 +285,18 @@ Ip4CreateService (
goto ON_ERROR;
}
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL | EVT_TIMER,
TPL_CALLBACK,
Ip4TimerReconfigChecking,
IpSb,
&IpSb->ReconfigCheckTimer
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
@@ -410,6 +423,13 @@ Ip4CleanService (
IpSb->Timer = NULL;
}
if (IpSb->ReconfigCheckTimer != NULL) {
gBS->SetTimer (IpSb->ReconfigCheckTimer, TimerCancel, 0);
gBS->CloseEvent (IpSb->ReconfigCheckTimer);
IpSb->ReconfigCheckTimer = NULL;
}
if (IpSb->DefaultInterface != NULL) {
Status = Ip4FreeInterface (IpSb->DefaultInterface, NULL);
@@ -630,6 +650,12 @@ Ip4DriverBindingStart (
goto UNINSTALL_PROTOCOL;
}
Status = gBS->SetTimer (IpSb->ReconfigCheckTimer, TimerPeriodic, 500 * TICKS_PER_MS);
if (EFI_ERROR (Status)) {
goto UNINSTALL_PROTOCOL;
}
//
// Initialize the IP4 ID
//