From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 B234D2195406F for ; Fri, 28 Apr 2017 01:26:03 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP; 28 Apr 2017 01:26:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="79970307" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 28 Apr 2017 01:26:03 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:26:02 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:26:02 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by shsmsx102.ccr.corp.intel.com ([169.254.2.246]) with mapi id 14.03.0319.002; Fri, 28 Apr 2017 16:25:58 +0800 From: "Wu, Jiaxin" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [patch] MdeModulePkg: Fix issue the iSCSI client can not send reset packet correctly. Thread-Index: AQHSv+psGt3fu6ObD0OKRmucJmfj6KHackTQ Date: Fri, 28 Apr 2017 08:25:58 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C5188@SHSMSX103.ccr.corp.intel.com> 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: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmRkMmQ1ZTktOTNlMC00YTE1LWIxZjctOThkMWUxYzJhMGYzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Im5wejdsSHNVcmlUMmpuWm5pM2Q1M1c5SjBTajNwXC9Ha2Z4QkM2WmFZQ3FNPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action 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: Fri, 28 Apr 2017 08:26:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin Thanks, Jiaxin > -----Original Message----- > From: Zhang, Lubo > Sent: Friday, April 28, 2017 2:41 PM > To: edk2-devel@lists.01.org > Cc: Wu, Jiaxin ; Ye, Ting ; Fu, S= iyuan > > Subject: [patch] MdeModulePkg: Fix issue the iSCSI client can not send re= set > packet correctly. >=20 > 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. >=20 > 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(-) >=20 > 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 =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 (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