]> git.proxmox.com Git - mirror_edk2.git/commitdiff
[Description]
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 11 Apr 2008 07:20:05 +0000 (07:20 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 11 Apr 2008 07:20:05 +0000 (07:20 +0000)
solve the big file transfer issue using ISCSI
[Impaction]
change the control flow on IScsiExecuteScsiCommand  function
[Reference Info]
The original design incorrectly uses a timer (its span is usually 2 seconds) to ensure the timely execution of CMD PDU send by initiator. For example: When initiator delivers a CMD PDU(WRITE command) in which the ExpDataXferLength filed is larger than DataSegmentLength field, according to ISCSI protocol spec, the target will respond it with a R2T PDU which is followed by a sequential DATA-OUT PDUs. In this situation, the original code may loop to deal with the arrival packet until initiator receives a RESPONSE PDU or the timer is expired. This way may cause the bigger file is more likely to fail.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5044 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c

index 3298b9576971e8bb74bdace749860cf453fec543..93b7f715e196404698a3c4659098e1d65484adfa 100644 (file)
@@ -2776,6 +2776,7 @@ Returns:
   Status        = EFI_SUCCESS;\r
   Tcb           = NULL;\r
   TimeoutEvent  = NULL;\r
+  Timeout       = 0;\r
 \r
   if (Session->State != SESSION_STATE_LOGGED_IN) {\r
     return EFI_DEVICE_ERROR;\r
@@ -2790,15 +2791,6 @@ Returns:
 \r
   if (Packet->Timeout != 0) {\r
     Timeout = MultU64x32 (Packet->Timeout, 2);\r
-    //\r
-    // Start the timeout timer.\r
-    //\r
-    Status = gBS->SetTimer (Conn->TimeoutEvent, TimerRelative, Timeout);\r
-    if (EFI_ERROR (Status)) {\r
-      goto ON_EXIT;\r
-    }\r
-\r
-    TimeoutEvent = Conn->TimeoutEvent;\r
   }\r
 \r
   Status = IScsiNewTcb (Conn, &Tcb);\r
@@ -2854,6 +2846,16 @@ Returns:
   InBufferContext.InDataLen = Packet->InTransferLength;\r
 \r
   while (!Tcb->StatusXferd) {\r
+    //\r
+    // Start the timeout timer.\r
+    //\r
+    if (Timeout) {\r
+      Status = gBS->SetTimer (Conn->TimeoutEvent, TimerRelative, Timeout);\r
+      if (EFI_ERROR (Status)) {\r
+        goto ON_EXIT;\r
+      }\r
+      TimeoutEvent = Conn->TimeoutEvent; \r
+    }\r
     //\r
     // try to receive PDU from target.\r
     //\r