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.

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
This commit is contained in:
Ye Ting 2015-09-25 03:51:46 +00:00 committed by tye1
parent 953bcbcce4
commit 87ce4210f5
4 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@
The header file of functions for configuring or getting the parameters The header file of functions for configuring or getting the parameters
relating to iSCSI. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -78,7 +78,7 @@ struct _ISCSI_ATTEMPT_CONFIG_NVDATA {
union { union {
ISCSI_CHAP_AUTH_CONFIG_NVDATA CHAP; ISCSI_CHAP_AUTH_CONFIG_NVDATA CHAP;
} AuthConfigData; } AuthConfigData;
BOOLEAN AutoConfigureSuccess;
}; };
/// ///

View File

@ -477,7 +477,7 @@ IScsiStart (
// Don't process the autoconfigure path if it is already established. // Don't process the autoconfigure path if it is already established.
// //
if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG && if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&
AttemptConfigData->AutoConfigureMode == IP_MODE_AUTOCONFIG_SUCCESS) { AttemptConfigData->AutoConfigureSuccess) {
continue; continue;
} }
@ -576,7 +576,7 @@ IScsiStart (
// IScsi session success. Update the attempt state to NVR. // IScsi session success. Update the attempt state to NVR.
// //
if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) { if (AttemptConfigData->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG) {
AttemptConfigData->AutoConfigureMode = IP_MODE_AUTOCONFIG_SUCCESS; AttemptConfigData->AutoConfigureSuccess = TRUE;
} }
gRT->SetVariable ( gRT->SetVariable (

View File

@ -1,7 +1,7 @@
/** @file /** @file
The header file of IScsiDriver.c. 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 This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -29,7 +29,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define IP_MODE_AUTOCONFIG_IP4 3 #define IP_MODE_AUTOCONFIG_IP4 3
#define IP_MODE_AUTOCONFIG_IP6 4 #define IP_MODE_AUTOCONFIG_IP6 4
#define IP_MODE_AUTOCONFIG_SUCCESS 5
extern EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2; extern EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2;
extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName; extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName;

View File

@ -1054,7 +1054,7 @@ IScsiGetConfigData (
// Check the autoconfig path to see whether it should be retried. // Check the autoconfig path to see whether it should be retried.
// //
if (AttemptTmp->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG && if (AttemptTmp->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&
AttemptTmp->AutoConfigureMode != IP_MODE_AUTOCONFIG_SUCCESS) { !AttemptTmp->AutoConfigureSuccess) {
if (mPrivate->Ipv6Flag && if (mPrivate->Ipv6Flag &&
AttemptTmp->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP6) { AttemptTmp->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP6) {
// //
@ -1197,6 +1197,7 @@ IScsiGetConfigData (
AttemptConfigData->AutoConfigureMode = AttemptConfigData->AutoConfigureMode =
(UINT8) (mPrivate->Ipv6Flag ? IP_MODE_AUTOCONFIG_IP6 : IP_MODE_AUTOCONFIG_IP4); (UINT8) (mPrivate->Ipv6Flag ? IP_MODE_AUTOCONFIG_IP6 : IP_MODE_AUTOCONFIG_IP4);
AttemptConfigData->AutoConfigureSuccess = FALSE;
} }
// //