From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 E3BFC21A134AE for ; Thu, 4 May 2017 22:12:47 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 04 May 2017 22:12:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,291,1491289200"; d="scan'208";a="1143923012" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 04 May 2017 22:12:47 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 4 May 2017 22:12:47 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 4 May 2017 22:12:46 -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, 5 May 2017 13:12:26 +0800 From: "Wu, Jiaxin" To: "Fu, Siyuan" , "edk2-devel@lists.01.org" CC: Andrey Tepin , "Ye, Ting" Thread-Topic: [Patch V2] NetworkPkg: Addressing TCP Window Retraction when window scale factor is used. Thread-Index: AQHSxUMKI0LKZoCPh0Cf0b0EoBQzpaHlMCFQ Date: Fri, 5 May 2017 05:12:26 +0000 Message-ID: <895558F6EA4E3B41AC93A00D163B7274162C7A50@SHSMSX103.ccr.corp.intel.com> References: <1493949365-105904-1-git-send-email-siyuan.fu@intel.com> <1493949365-105904-2-git-send-email-siyuan.fu@intel.com> In-Reply-To: <1493949365-105904-2-git-send-email-siyuan.fu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGQwZWE3ZDktNTY5Ni00MTE5LWJmNTItZjQxNTgwNWMzZDE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJlZ3VBVTVLU2R4V2hsRTZmRmdWMWd6eXgwU1RwNWwrYzVQS3VuWk53bElrPSJ9 x-ctpclassification: CTP_PUBLIC 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 V2] NetworkPkg: Addressing TCP Window Retraction when window scale factor is used. 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, 05 May 2017 05:12:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wu Jiaxin > -----Original Message----- > From: Fu, Siyuan > Sent: Friday, May 5, 2017 9:56 AM > To: edk2-devel@lists.01.org > Cc: Wu, Jiaxin ; Andrey Tepin ; = Ye, > Ting > Subject: [Patch V2] NetworkPkg: Addressing TCP Window Retraction when > window scale factor is used. >=20 > The RFC1323 which defines the TCP window scale option has been obsoleted = by > RFC7323. > This patch is to follow the RFC7323 to address the TCP window retraction > problem > when a non-zero scale factor is used. > The changes has been test in high packet loss rate network by using HTTP = boot > and > iSCSI file read/write. >=20 > Cc: Wu Jiaxin > Cc: Andrey Tepin > Cc: Ye Ting > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Fu Siyuan > --- > NetworkPkg/TcpDxe/TcpMisc.c | 3 ++- > NetworkPkg/TcpDxe/TcpOutput.c | 33 ++++++++++++++++++++++++++++----- > NetworkPkg/TcpDxe/TcpProto.h | 8 +++++++- > 3 files changed, 37 insertions(+), 7 deletions(-) >=20 > diff --git a/NetworkPkg/TcpDxe/TcpMisc.c b/NetworkPkg/TcpDxe/TcpMisc.c > index a8592c9..4435036 100644 > --- a/NetworkPkg/TcpDxe/TcpMisc.c > +++ b/NetworkPkg/TcpDxe/TcpMisc.c > @@ -2,7 +2,7 @@ > Misc support routines for TCP driver. >=20 > (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
>=20 > This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > @@ -86,6 +86,7 @@ TcpInitTcbLocal ( > // First window size is never scaled > // > Tcb->RcvWndScale =3D 0; > + Tcb->RetxmitSeqMax =3D 0; >=20 > Tcb->ProbeTimerOn =3D FALSE; > } > diff --git a/NetworkPkg/TcpDxe/TcpOutput.c > b/NetworkPkg/TcpDxe/TcpOutput.c > index a46cb60..f3dacf3 100644 > --- a/NetworkPkg/TcpDxe/TcpOutput.c > +++ b/NetworkPkg/TcpDxe/TcpOutput.c > @@ -1,7 +1,7 @@ > /** @file > TCP output process routines. >=20 > - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
>=20 > This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > @@ -664,7 +664,27 @@ TcpRetransmit ( > // 2. Must in the current send window > // 3. Will not change the boundaries of queued segments. > // > - if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) { > + > + if ((Tcb->SndWndScale !=3D 0) && > + (TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax) || TCP_SEQ_GT (Tcb->SndWl2 + > Tcb->SndWnd + (1 << Tcb->SndWndScale), Seq))) { > + // > + // Handle the Window Retraction if TCP window scale is enabled accor= ding > to RFC7323: > + // On first retransmission, or if the sequence number is out of > + // window by less than 2^Rcv.Wind.Shift, then do normal > + // retransmission(s) without regard to the receiver window as long > + // as the original segment was in window when it was sent. > + // > + Len =3D TCP_SUB_SEQ (Tcb->SndNxt, Seq); > + DEBUG ( > + (EFI_D_WARN, > + "TcpRetransmit: retransmission without regard to the receiver wind= ow for > TCB %p\n", > + Tcb) > + ); > + > + } else if (TCP_SEQ_GEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq)) { > + Len =3D TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq); > + > + } else { > DEBUG ( > (EFI_D_WARN, > "TcpRetransmit: retransmission cancelled because send window too s= mall > for TCB %p\n", > @@ -674,10 +694,9 @@ TcpRetransmit ( > return 0; > } >=20 > - Len =3D TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq); > - Len =3D MIN (Len, Tcb->SndMss); > + Len =3D MIN (Len, Tcb->SndMss); >=20 > - Nbuf =3D TcpGetSegmentSndQue (Tcb, Seq, Len); > + Nbuf =3D TcpGetSegmentSndQue (Tcb, Seq, Len); > if (Nbuf =3D=3D NULL) { > return -1; > } > @@ -688,6 +707,10 @@ TcpRetransmit ( > goto OnError; > } >=20 > + if (TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax)) { > + Tcb->RetxmitSeqMax =3D Seq; > + } > + > // > // The retransmitted buffer may be on the SndQue, > // trim TCP head because all the buffers on SndQue > diff --git a/NetworkPkg/TcpDxe/TcpProto.h b/NetworkPkg/TcpDxe/TcpProto.h > index ee35134..81397d7 100644 > --- a/NetworkPkg/TcpDxe/TcpProto.h > +++ b/NetworkPkg/TcpDxe/TcpProto.h > @@ -1,7 +1,7 @@ > /** @file > TCP protocol header file. >=20 > - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
> + Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
>=20 > This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > @@ -316,6 +316,12 @@ struct _TCP_CONTROL_BLOCK { > TCP_SEQNO LossRecover; ///< Recover point for retxmit. >=20 > // > + // RFC7323 > + // Addressing Window Retraction for TCP Window Scale Option. > + // > + TCP_SEQNO RetxmitSeqMax; ///< Max Seq number in previous > retransmission. > + > + // > // configuration parameters, for EFI_TCP4_PROTOCOL specification > // > UINT32 KeepAliveIdle; ///< Idle time before sending first= probe. > -- > 1.9.5.msysgit.1