Misc support routines for TCP driver.\r
\r
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
// First window size is never scaled\r
//\r
Tcb->RcvWndScale = 0;\r
+ Tcb->RetxmitSeqMax = 0;\r
\r
Tcb->ProbeTimerOn = FALSE;\r
}\r
/** @file\r
TCP output process routines.\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
// 2. Must in the current send window\r
// 3. Will not change the boundaries of queued segments.\r
//\r
- if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {\r
+\r
+ //\r
+ // Handle the Window Retraction if TCP window scale is enabled according to RFC7323:\r
+ // On first retransmission, or if the sequence number is out of\r
+ // window by less than 2^Rcv.Wind.Shift, then do normal\r
+ // retransmission(s) without regard to the receiver window as long\r
+ // as the original segment was in window when it was sent.\r
+ //\r
+ if ((Tcb->SndWndScale != 0) &&\r
+ (TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax) || TCP_SEQ_BETWEEN (Tcb->SndWl2 + Tcb->SndWnd, Seq, Tcb->SndWl2 + Tcb->SndWnd + (1 << Tcb->SndWndScale)))) {\r
+ Len = TCP_SUB_SEQ (Tcb->SndNxt, Seq);\r
+ DEBUG (\r
+ (EFI_D_WARN,\r
+ "TcpRetransmit: retransmission without regard to the receiver window for TCB %p\n",\r
+ Tcb)\r
+ );\r
+ \r
+ } else if (TCP_SEQ_GEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {\r
+ Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);\r
+ \r
+ } else {\r
DEBUG (\r
(EFI_D_WARN,\r
"TcpRetransmit: retransmission cancelled because send window too small for TCB %p\n",\r
return 0;\r
}\r
\r
- Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);\r
- Len = MIN (Len, Tcb->SndMss);\r
+ Len = MIN (Len, Tcb->SndMss);\r
\r
- Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);\r
+ Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);\r
if (Nbuf == NULL) {\r
return -1;\r
}\r
goto OnError;\r
}\r
\r
+ if (TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax)) {\r
+ Tcb->RetxmitSeqMax = Seq;\r
+ }\r
+\r
//\r
// The retransmitted buffer may be on the SndQue,\r
// trim TCP head because all the buffers on SndQue\r
/** @file\r
TCP protocol header file.\r
\r
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
UINT8 LossTimes; ///< Number of retxmit timeouts in a row.\r
TCP_SEQNO LossRecover; ///< Recover point for retxmit.\r
\r
+ //\r
+ // RFC7323\r
+ // Addressing Window Retraction for TCP Window Scale Option.\r
+ //\r
+ TCP_SEQNO RetxmitSeqMax; ///< Max Seq number in previous retransmission.\r
+\r
//\r
// configuration parameters, for EFI_TCP4_PROTOCOL specification\r
//\r