diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-04-11 07:20:05 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-04-11 07:20:05 +0000 |
commit | 5c70cb3285dbceae65d135c73e865986a50b2ad2 (patch) | |
tree | 64d2b11ec9284d369767450c48f6c4d831a5b9aa /MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c | |
parent | 7b414b4ed6ccdefce8e167ecc7d67ad64118eb94 (diff) | |
download | edk2-platforms-5c70cb3285dbceae65d135c73e865986a50b2ad2.tar.xz |
[Description]
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
Diffstat (limited to 'MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c')
-rw-r--r-- | MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c index 3298b95769..93b7f715e1 100644 --- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c +++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c @@ -2776,6 +2776,7 @@ Returns: Status = EFI_SUCCESS;
Tcb = NULL;
TimeoutEvent = NULL;
+ Timeout = 0;
if (Session->State != SESSION_STATE_LOGGED_IN) {
return EFI_DEVICE_ERROR;
@@ -2790,15 +2791,6 @@ Returns: if (Packet->Timeout != 0) {
Timeout = MultU64x32 (Packet->Timeout, 2);
- //
- // Start the timeout timer.
- //
- Status = gBS->SetTimer (Conn->TimeoutEvent, TimerRelative, Timeout);
- if (EFI_ERROR (Status)) {
- goto ON_EXIT;
- }
-
- TimeoutEvent = Conn->TimeoutEvent;
}
Status = IScsiNewTcb (Conn, &Tcb);
@@ -2855,6 +2847,16 @@ Returns: while (!Tcb->StatusXferd) {
//
+ // Start the timeout timer.
+ //
+ if (Timeout) {
+ Status = gBS->SetTimer (Conn->TimeoutEvent, TimerRelative, Timeout);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ TimeoutEvent = Conn->TimeoutEvent;
+ }
+ //
// try to receive PDU from target.
//
Status = IScsiReceivePdu (Conn, &Pdu, &InBufferContext, FALSE, FALSE, TimeoutEvent);
|