Re: [edk2] [patch] NetworkPkg: Bug fix of iSCSI to support MPIO

2016-05-11 Thread Wu, Jiaxin
Reviewed-By: Wu Jiaxin 


> -Original Message-
> From: Zhang, Lubo
> Sent: Wednesday, May 11, 2016 9:38 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Wu,
> Jiaxin 
> Subject: [patch] NetworkPkg: Bug fix of iSCSI to support MPIO
> 
> If two attempts added on different NIC and enable MPIO attribute, then
> change the attempts order. If both two attempts succeed to connect the
> target,it should abort the later one in the order and uninstall
> ExtScsiPassThruProtocol Interface, But now it unistall it twice.
> 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Cc: Wu Jiaxin 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo 
> ---
>  NetworkPkg/IScsiDxe/IScsiDriver.c | 18 +++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c
> b/NetworkPkg/IScsiDxe/IScsiDriver.c
> index 12095cb..5a121ce 100644
> --- a/NetworkPkg/IScsiDxe/IScsiDriver.c
> +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
> @@ -863,14 +863,26 @@ IScsiStart (
>  IScsiRemoveNic (ExistPrivate->Controller);
>  if (ExistPrivate->Session != NULL) {
>IScsiSessionAbort (ExistPrivate->Session);
>  }
> 
> -Status = IScsiCleanDriverData (ExistPrivate);
> -if (EFI_ERROR (Status)) {
> -  goto ON_ERROR;
> +if (ExistPrivate->DevicePath != NULL) {
> +  Status = gBS->UninstallProtocolInterface (
> +  ExistPrivate->ExtScsiPassThruHandle,
> +  ,
> +  ExistPrivate->DevicePath
> +  );
> +  if (EFI_ERROR (Status)) {
> +goto ON_ERROR;
> +  }
> +
> +  FreePool (ExistPrivate->DevicePath);
>  }
> +
> +gBS->CloseEvent (ExistPrivate->ExitBootServiceEvent);
> +FreePool (ExistPrivate);
> +
>}
>  } else {
>//
>// Use the attempt in earlier order as boot selected in single path 
> mode.
>//
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [patch] NetworkPkg: Bug fix of iSCSI to support MPIO

2016-05-10 Thread Zhang Lubo
If two attempts added on different NIC and enable
MPIO attribute, then change the attempts order. If
both two attempts succeed to connect the target,it
should abort the later one in the order and uninstall
ExtScsiPassThruProtocol Interface, But now it
unistall it twice.

Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Wu Jiaxin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 NetworkPkg/IScsiDxe/IScsiDriver.c | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c 
b/NetworkPkg/IScsiDxe/IScsiDriver.c
index 12095cb..5a121ce 100644
--- a/NetworkPkg/IScsiDxe/IScsiDriver.c
+++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
@@ -863,14 +863,26 @@ IScsiStart (
 IScsiRemoveNic (ExistPrivate->Controller);
 if (ExistPrivate->Session != NULL) {
   IScsiSessionAbort (ExistPrivate->Session);
 }
 
-Status = IScsiCleanDriverData (ExistPrivate);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
+if (ExistPrivate->DevicePath != NULL) {
+  Status = gBS->UninstallProtocolInterface (
+  ExistPrivate->ExtScsiPassThruHandle,
+  ,
+  ExistPrivate->DevicePath
+  );
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
+
+  FreePool (ExistPrivate->DevicePath);
 }
+
+gBS->CloseEvent (ExistPrivate->ExitBootServiceEvent);
+FreePool (ExistPrivate);
+
   }
 } else {
   //
   // Use the attempt in earlier order as boot selected in single path mode.
   //
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel