From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2AC3B21A04830 for ; Tue, 2 May 2017 19:55:10 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 May 2017 19:55:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,282,1491289200"; d="scan'208";a="96543835" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 02 May 2017 19:55:09 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 2 May 2017 19:55:09 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 2 May 2017 19:55:09 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Wed, 3 May 2017 10:54:38 +0800 From: "Ye, Ting" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" , "Wu, Jiaxin" Thread-Topic: [edk2] [patch] MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly. Thread-Index: AQHSv+powixR7lloTEOKu5pr3J+IDqHh8UaA Date: Wed, 3 May 2017 02:54:37 +0000 Message-ID: References: <1493361649-8096-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1493361649-8096-1-git-send-email-lubo.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 May 2017 02:55:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting =20 -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhan= g Lubo Sent: Friday, April 28, 2017 2:41 PM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jia= xin Subject: [edk2] [patch] MdeModulePkg: Fix issue the iSCSI client can not se= nd 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 se= ssion with the windows target, since the server thought the session is stil= l 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 Cc: Wu Jiaxin Cc: Ye Ting Cc: Fu Siyuan --- MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c | 18 +++++++++-----= ---- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeMo= dulePkg/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 =3D (TCP4_PROTO_DATA *) Sock->ProtoReserved; Tcb =3D ProtoData->TcpPcb; =20 ASSERT (Tcb !=3D NULL); =20 - Status =3D 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 ); =20 + Status =3D EfiAcquireLockOrFail (&(Sock->Lock)); if (EFI_ERROR=20 + (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 =3D Sock->ProtoHandler (Sock, SOCK_DETACH, NULL); =20 -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel