summaryrefslogtreecommitdiff
path: root/NetworkPkg
diff options
context:
space:
mode:
authorFu Siyuan <siyuan.fu@intel.com>2015-09-15 05:40:12 +0000
committerhwu1225 <hwu1225@Edk2>2015-09-15 05:40:12 +0000
commit38ada0e8aff0f447dc98a1f37af40f0a65b0fb59 (patch)
tree71335e8103597bf9fa27b87fdf67044a64e0333b /NetworkPkg
parent07e11eedfc6edff2a03df5105e7a8ae9946c16f6 (diff)
downloadedk2-platforms-38ada0e8aff0f447dc98a1f37af40f0a65b0fb59.tar.xz
NetworkPkg: Update Http driver to use DPC mechanism.
This patch updates the HttpDxe driver to use the DPC mechanism to avoid long time delay when single event. (Sync patch r18451 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18461 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/HttpDxe/HttpDriver.h2
-rw-r--r--NetworkPkg/HttpDxe/HttpDxe.inf1
-rw-r--r--NetworkPkg/HttpDxe/HttpImpl.c9
-rw-r--r--NetworkPkg/HttpDxe/HttpProto.c54
4 files changed, 56 insertions, 10 deletions
diff --git a/NetworkPkg/HttpDxe/HttpDriver.h b/NetworkPkg/HttpDxe/HttpDriver.h
index d95b05b634..eea8d5169e 100644
--- a/NetworkPkg/HttpDxe/HttpDriver.h
+++ b/NetworkPkg/HttpDxe/HttpDriver.h
@@ -28,7 +28,7 @@
#include <Library/DebugLib.h>
#include <Library/NetLib.h>
#include <Library/HttpLib.h>
-#include <Library/TcpIoLib.h>
+#include <Library/DpcLib.h>
//
// UEFI Driver Model Protocols
diff --git a/NetworkPkg/HttpDxe/HttpDxe.inf b/NetworkPkg/HttpDxe/HttpDxe.inf
index e8117006d6..0d3bd00cf7 100644
--- a/NetworkPkg/HttpDxe/HttpDxe.inf
+++ b/NetworkPkg/HttpDxe/HttpDxe.inf
@@ -48,6 +48,7 @@
DebugLib
NetLib
HttpLib
+ DpcLib
[Protocols]
gEfiHttpServiceBindingProtocolGuid ## BY_START
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index c5b2be430e..2b62dc5db2 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -502,6 +502,8 @@ EfiHttpRequest (
goto Error5;
}
+ DispatchDpc ();
+
return EFI_SUCCESS;
Error5:
@@ -1330,6 +1332,7 @@ EfiHttpPoll (
)
{
HTTP_PROTOCOL *HttpInstance;
+ EFI_STATUS Status;
if (This == NULL) {
return EFI_INVALID_PARAMETER;
@@ -1346,5 +1349,9 @@ EfiHttpPoll (
return EFI_NOT_STARTED;
}
- return HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);
+ Status = HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);
+
+ DispatchDpc ();
+
+ return Status;
}
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index 9b06e24bed..8fbd454110 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -38,20 +38,18 @@ HttpCommonNotify (
/**
The notify function associated with TxToken for Tcp4->Transmit().
- @param[in] Event The event signaled.
@param[in] Context The context.
**/
VOID
EFIAPI
-HttpTcpTransmitNotify (
- IN EFI_EVENT Event,
+HttpTcpTransmitNotifyDpc (
IN VOID *Context
)
{
HTTP_TOKEN_WRAP *Wrap;
- if ((Event == NULL) || (Context == NULL)) {
+ if (Context == NULL) {
return ;
}
@@ -80,16 +78,35 @@ HttpTcpTransmitNotify (
}
/**
+ Request HttpTcpTransmitNotifyDpc as a DPC at TPL_CALLBACK.
+
+ @param Event The receive event delivered to TCP for transmit.
+ @param Context Context for the callback.
+
+**/
+VOID
+EFIAPI
+HttpTcpTransmitNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ //
+ // Request HttpTcpTransmitNotifyDpc as a DPC at TPL_CALLBACK
+ //
+ QueueDpc (TPL_CALLBACK, HttpTcpTransmitNotifyDpc, Context);
+}
+
+
+/**
The notify function associated with RxToken for Tcp4->Receive ().
- @param[in] Event The event signaled.
@param[in] Context The context.
**/
VOID
EFIAPI
-HttpTcpReceiveNotify (
- IN EFI_EVENT Event,
+HttpTcpReceiveNotifyDpc (
IN VOID *Context
)
{
@@ -99,7 +116,7 @@ HttpTcpReceiveNotify (
EFI_STATUS Status;
HTTP_PROTOCOL *HttpInstance;
- if ((Event == NULL) || (Context == NULL)) {
+ if (Context == NULL) {
return ;
}
@@ -174,6 +191,27 @@ HttpTcpReceiveNotify (
}
/**
+ Request HttpTcpReceiveNotifyDpc as a DPC at TPL_CALLBACK.
+
+ @param Event The receive event delivered to TCP for receive.
+ @param Context Context for the callback.
+
+**/
+VOID
+EFIAPI
+HttpTcpReceiveNotify (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ //
+ // Request HttpTcpTransmitNotifyDpc as a DPC at TPL_CALLBACK
+ //
+ QueueDpc (TPL_CALLBACK, HttpTcpReceiveNotifyDpc, Context);
+}
+
+
+/**
Create events for the TCP4 connection token and TCP4 close token.
@param[in] HttpInstance Pointer to HTTP_PROTOCOL structure.