]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg:Fix iSCSI driver issue to work with iSCSI LIO target
authorYe Ting <ting.ye@intel.com>
Fri, 25 Sep 2015 03:51:46 +0000 (03:51 +0000)
committertye1 <tye1@Edk2>
Fri, 25 Sep 2015 03:51:46 +0000 (03:51 +0000)
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.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu jiaxin <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18546 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/IScsiDxe/IScsiConfig.h
NetworkPkg/IScsiDxe/IScsiDriver.c
NetworkPkg/IScsiDxe/IScsiDriver.h
NetworkPkg/IScsiDxe/IScsiMisc.c

index 7fd18a0ae2f2c8e22af4ffc2be0aaf08860e62f2..daa0d343828a07cbc1ed55509c27410c4e7c8167 100644 (file)
@@ -2,7 +2,7 @@
   The header file of functions for configuring or getting the parameters\r
   relating to iSCSI.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -78,7 +78,7 @@ struct _ISCSI_ATTEMPT_CONFIG_NVDATA {
   union {\r
     ISCSI_CHAP_AUTH_CONFIG_NVDATA  CHAP;\r
   } AuthConfigData;\r
-\r
+  BOOLEAN                          AutoConfigureSuccess;\r
 };\r
 \r
 ///\r
index 5e5d700e47870d7a5f04f2ff8139475a97978511..363daadc8f70db50da558924ad0268342a595f61 100644 (file)
@@ -477,7 +477,7 @@ IScsiStart (
     // Don't process the autoconfigure path if it is already established.\r
     //\r
     if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&\r
-        AttemptConfigData->AutoConfigureMode == IP_MODE_AUTOCONFIG_SUCCESS) {\r
+        AttemptConfigData->AutoConfigureSuccess) {\r
       continue;\r
     }\r
 \r
@@ -576,7 +576,7 @@ IScsiStart (
       // IScsi session success. Update the attempt state to NVR.\r
       //\r
       if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) {\r
-        AttemptConfigData->AutoConfigureMode = IP_MODE_AUTOCONFIG_SUCCESS;\r
+        AttemptConfigData->AutoConfigureSuccess = TRUE;\r
       }\r
 \r
       gRT->SetVariable (\r
index 825394a1d29a65901bbfc622b7226fbd03af636c..338e3dcf188b30b99a0a802e87e3888b324bb0bd 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The header file of IScsiDriver.c.\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -29,7 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #define IP_MODE_AUTOCONFIG_IP4     3\r
 #define IP_MODE_AUTOCONFIG_IP6     4\r
-#define IP_MODE_AUTOCONFIG_SUCCESS 5\r
 \r
 extern EFI_COMPONENT_NAME2_PROTOCOL       gIScsiComponentName2;\r
 extern EFI_COMPONENT_NAME_PROTOCOL        gIScsiComponentName;\r
index f5c54e70188e91e1e22d609b2ce42824c54815db..e7198d5ab04cbb7c79de395d6838aa1a5d43b818 100644 (file)
@@ -1054,7 +1054,7 @@ IScsiGetConfigData (
       // Check the autoconfig path to see whether it should be retried.\r
       //\r
       if (AttemptTmp->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&\r
-          AttemptTmp->AutoConfigureMode != IP_MODE_AUTOCONFIG_SUCCESS) {\r
+          !AttemptTmp->AutoConfigureSuccess) {\r
         if (mPrivate->Ipv6Flag &&\r
             AttemptTmp->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP6) {\r
           //\r
@@ -1197,6 +1197,7 @@ IScsiGetConfigData (
 \r
       AttemptConfigData->AutoConfigureMode =\r
         (UINT8) (mPrivate->Ipv6Flag ? IP_MODE_AUTOCONFIG_IP6 : IP_MODE_AUTOCONFIG_IP4);\r
+      AttemptConfigData->AutoConfigureSuccess = FALSE;\r
     }\r
     \r
     //\r