From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 C83FE21951CA7 for ; Fri, 28 Apr 2017 01:26:54 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 01:26:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="1124369861" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 28 Apr 2017 01:26:53 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:26:53 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:26:53 -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; Fri, 28 Apr 2017 16:26:21 +0800 From: "Wu, Jiaxin" To: "Zhang, Lubo" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [edk2] [patch] NetworkPkg: Fix issue the iSCSI client can not send reset packet. Thread-Index: AQHSv+p/4pm0xxPzgEmZFuo0gW8XNaHacl6w Date: Fri, 28 Apr 2017 08:26:21 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C5197@SHSMSX103.ccr.corp.intel.com> References: <1493361693-5112-1-git-send-email-lubo.zhang@intel.com> In-Reply-To: <1493361693-5112-1-git-send-email-lubo.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDhmMjg4ZjgtOTBhMy00MzNkLTk2MjUtZjgzODY5ZTc3MGE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjRmSmVwc24wNnhOd3NxNWtEaFZrODluNkROZHB5TVwvWmdaQVJKb2Y1Q1c0PSJ9 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] NetworkPkg: Fix issue the iSCSI client can not send reset packet. 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:55 -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: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Zhang Lubo > Sent: Friday, April 28, 2017 2:42 PM > To: edk2-devel@lists.01.org > Cc: Ye, Ting ; Fu, Siyuan ; Wu, J= iaxin > > Subject: [edk2] [patch] NetworkPkg: Fix issue the iSCSI client can not se= nd reset > packet. >=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 > --- > NetworkPkg/TcpDxe/SockInterface.c | 25 +++++++++++++------------ > 1 file changed, 13 insertions(+), 12 deletions(-) >=20 > diff --git a/NetworkPkg/TcpDxe/SockInterface.c > b/NetworkPkg/TcpDxe/SockInterface.c > index b4ba40a..0248cdf 100644 > --- a/NetworkPkg/TcpDxe/SockInterface.c > +++ b/NetworkPkg/TcpDxe/SockInterface.c > @@ -167,22 +167,10 @@ SockDestroyChild ( > ProtoData =3D (TCP_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, > @@ -224,10 +212,23 @@ SockDestroyChild ( > TcpProtocolGuid, > 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 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel