Revision: 18548
          http://sourceforge.net/p/edk2/code/18548
Author:   hwu1225
Date:     2015-09-25 06:07:27 +0000 (Fri, 25 Sep 2015)
Log Message:
-----------
NetworkPkg:Fix iSCSI driver issue to work with iSCSI LIO target

The patch fixes iSCSI driver can't reinstate itself when configured
 in AutoConfigure mode and IPv6 stack is actually used.
The issue occurs when iSCSI driver communicates with
iSCSI LIO target in IPv6 path and the target sends
back TCP FIN packets randomly.

(Sync patch r18546 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Ye Ting <[email protected]>
Reviewed-by: Fu siyuan <[email protected]>
Reviewed-by: Wu jiaxin <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18546

Modified Paths:
--------------
    branches/UDK2015/NetworkPkg/IScsiDxe/IScsiConfig.h
    branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.c
    branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.h
    branches/UDK2015/NetworkPkg/IScsiDxe/IScsiMisc.c

Modified: branches/UDK2015/NetworkPkg/IScsiDxe/IScsiConfig.h
===================================================================
--- branches/UDK2015/NetworkPkg/IScsiDxe/IScsiConfig.h  2015-09-25 06:06:59 UTC 
(rev 18547)
+++ branches/UDK2015/NetworkPkg/IScsiDxe/IScsiConfig.h  2015-09-25 06:07:27 UTC 
(rev 18548)
@@ -2,7 +2,7 @@
   The header file of functions for configuring or getting the parameters
   relating to iSCSI.
 
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -78,7 +78,7 @@
   union {
     ISCSI_CHAP_AUTH_CONFIG_NVDATA  CHAP;
   } AuthConfigData;
-
+  BOOLEAN                          AutoConfigureSuccess;
 };
 
 ///

Modified: branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.c
===================================================================
--- branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.c  2015-09-25 06:06:59 UTC 
(rev 18547)
+++ branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.c  2015-09-25 06:07:27 UTC 
(rev 18548)
@@ -477,7 +477,7 @@
     // Don't process the autoconfigure path if it is already established.
     //
     if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&
-        AttemptConfigData->AutoConfigureMode == IP_MODE_AUTOCONFIG_SUCCESS) {
+        AttemptConfigData->AutoConfigureSuccess) {
       continue;
     }
 
@@ -576,7 +576,7 @@
       // IScsi session success. Update the attempt state to NVR.
       //
       if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) {
-        AttemptConfigData->AutoConfigureMode = IP_MODE_AUTOCONFIG_SUCCESS;
+        AttemptConfigData->AutoConfigureSuccess = TRUE;
       }
 
       gRT->SetVariable (

Modified: branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.h
===================================================================
--- branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.h  2015-09-25 06:06:59 UTC 
(rev 18547)
+++ branches/UDK2015/NetworkPkg/IScsiDxe/IScsiDriver.h  2015-09-25 06:07:27 UTC 
(rev 18548)
@@ -1,7 +1,7 @@
 /** @file
   The header file of IScsiDriver.c.
 
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
@@ -29,7 +29,6 @@
 
 #define IP_MODE_AUTOCONFIG_IP4     3
 #define IP_MODE_AUTOCONFIG_IP6     4
-#define IP_MODE_AUTOCONFIG_SUCCESS 5
 
 extern EFI_COMPONENT_NAME2_PROTOCOL       gIScsiComponentName2;
 extern EFI_COMPONENT_NAME_PROTOCOL        gIScsiComponentName;

Modified: branches/UDK2015/NetworkPkg/IScsiDxe/IScsiMisc.c
===================================================================
--- branches/UDK2015/NetworkPkg/IScsiDxe/IScsiMisc.c    2015-09-25 06:06:59 UTC 
(rev 18547)
+++ branches/UDK2015/NetworkPkg/IScsiDxe/IScsiMisc.c    2015-09-25 06:07:27 UTC 
(rev 18548)
@@ -1054,7 +1054,7 @@
       // Check the autoconfig path to see whether it should be retried.
       //
       if (AttemptTmp->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&
-          AttemptTmp->AutoConfigureMode != IP_MODE_AUTOCONFIG_SUCCESS) {
+          !AttemptTmp->AutoConfigureSuccess) {
         if (mPrivate->Ipv6Flag &&
             AttemptTmp->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP6) {
           //
@@ -1197,6 +1197,7 @@
 
       AttemptConfigData->AutoConfigureMode =
         (UINT8) (mPrivate->Ipv6Flag ? IP_MODE_AUTOCONFIG_IP6 : 
IP_MODE_AUTOCONFIG_IP4);
+      AttemptConfigData->AutoConfigureSuccess = FALSE;
     }
     
     //


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to