public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Wu, Jiaxin" <jiaxin.wu@intel.com>
To: "Zhang, Lubo" <lubo.zhang@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Ye, Ting" <ting.ye@intel.com>, "Fu, Siyuan" <siyuan.fu@intel.com>
Subject: Re: [patch] MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly.
Date: Fri, 28 Apr 2017 08:25:58 +0000	[thread overview]
Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C5188@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1493361649-8096-1-git-send-email-lubo.zhang@intel.com>

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>


Thanks,
Jiaxin

> -----Original Message-----
> From: Zhang, Lubo
> Sent: Friday, April 28, 2017 2:41 PM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>; Fu, Siyuan
> <siyuan.fu@intel.com>
> Subject: [patch] MdeModulePkg: Fix issue the iSCSI client can not send reset
> packet correctly.
> 
> if we already established a iSCSI connection from initiator to target
> based on IPv4 stack, after using reconnect -r command, we can not rebuild
> the session with the windows target, since the server thought the session
> is still exist.  This issue is caused by wrong place of acquire ownership of
> sock lock which lead the iSCSI can not reset the connection correctly.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> ---
>  MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c | 18 +++++++++--
> -------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
> b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
> index f8b535c..bca4b02 100644
> --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
> +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
> @@ -160,19 +160,10 @@ SockDestroyChild (
>    ProtoData = (TCP4_PROTO_DATA *) Sock->ProtoReserved;
>    Tcb       = ProtoData->TcpPcb;
> 
>    ASSERT (Tcb != NULL);
> 
> -  Status = EfiAcquireLockOrFail (&(Sock->Lock));
> -  if (EFI_ERROR (Status)) {
> -
> -    DEBUG ((EFI_D_ERROR, "SockDestroyChild: Get the lock to "
> -      "access socket failed with %r\n", Status));
> -
> -    return EFI_ACCESS_DENIED;
> -  }
> -
>    //
>    // Close the IP protocol.
>    //
>    gBS->CloseProtocol (
>           Tcb->IpInfo->ChildHandle,
> @@ -212,10 +203,19 @@ SockDestroyChild (
>          &gEfiTcp4ProtocolGuid,
>          SockProtocol,
>          NULL
>          );
> 
> +  Status = EfiAcquireLockOrFail (&(Sock->Lock));
> +  if (EFI_ERROR (Status)) {
> +
> +    DEBUG ((EFI_D_ERROR, "SockDestroyChild: Get the lock to "
> +      "access socket failed with %r\n", Status));
> +
> +    return EFI_ACCESS_DENIED;
> +  }
> +
>    //
>    // force protocol layer to detach the PCB
>    //
>    Status = Sock->ProtoHandler (Sock, SOCK_DETACH, NULL);
> 
> --
> 1.9.5.msysgit.1



  reply	other threads:[~2017-04-28  8:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  6:40 [patch] MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly Zhang Lubo
2017-04-28  8:25 ` Wu, Jiaxin [this message]
2017-05-03  2:54 ` Ye, Ting

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=895558F6EA4E3B41AC93A00D163B7274162C5188@SHSMSX103.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox