mirror of https://github.com/acidanthera/audk.git
NetworkPkg: Addressing TCP Window Retraction when window scale factor is used.
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. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
parent
207b3d2b0b
commit
3696ceaecb
|
@ -2,7 +2,7 @@
|
||||||
Misc support routines for TCP driver.
|
Misc support routines for TCP driver.
|
||||||
|
|
||||||
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
|
||||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
// First window size is never scaled
|
||||||
//
|
//
|
||||||
Tcb->RcvWndScale = 0;
|
Tcb->RcvWndScale = 0;
|
||||||
|
Tcb->RetxmitSeqMax = 0;
|
||||||
|
|
||||||
Tcb->ProbeTimerOn = FALSE;
|
Tcb->ProbeTimerOn = FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
TCP output process routines.
|
TCP output process routines.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
// 2. Must in the current send window
|
||||||
// 3. Will not change the boundaries of queued segments.
|
// 3. Will not change the boundaries of queued segments.
|
||||||
//
|
//
|
||||||
if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {
|
|
||||||
|
//
|
||||||
|
// Handle the Window Retraction if TCP window scale is enabled according 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.
|
||||||
|
//
|
||||||
|
if ((Tcb->SndWndScale != 0) &&
|
||||||
|
(TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax) || TCP_SEQ_BETWEEN (Tcb->SndWl2 + Tcb->SndWnd, Seq, Tcb->SndWl2 + Tcb->SndWnd + (1 << Tcb->SndWndScale)))) {
|
||||||
|
Len = TCP_SUB_SEQ (Tcb->SndNxt, Seq);
|
||||||
|
DEBUG (
|
||||||
|
(EFI_D_WARN,
|
||||||
|
"TcpRetransmit: retransmission without regard to the receiver window for TCB %p\n",
|
||||||
|
Tcb)
|
||||||
|
);
|
||||||
|
|
||||||
|
} else if (TCP_SEQ_GEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {
|
||||||
|
Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);
|
||||||
|
|
||||||
|
} else {
|
||||||
DEBUG (
|
DEBUG (
|
||||||
(EFI_D_WARN,
|
(EFI_D_WARN,
|
||||||
"TcpRetransmit: retransmission cancelled because send window too small for TCB %p\n",
|
"TcpRetransmit: retransmission cancelled because send window too small for TCB %p\n",
|
||||||
|
@ -674,10 +694,9 @@ TcpRetransmit (
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);
|
Len = MIN (Len, Tcb->SndMss);
|
||||||
Len = MIN (Len, Tcb->SndMss);
|
|
||||||
|
|
||||||
Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
|
Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
|
||||||
if (Nbuf == NULL) {
|
if (Nbuf == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -688,6 +707,10 @@ TcpRetransmit (
|
||||||
goto OnError;
|
goto OnError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TCP_SEQ_GT (Seq, Tcb->RetxmitSeqMax)) {
|
||||||
|
Tcb->RetxmitSeqMax = Seq;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// The retransmitted buffer may be on the SndQue,
|
// The retransmitted buffer may be on the SndQue,
|
||||||
// trim TCP head because all the buffers on SndQue
|
// trim TCP head because all the buffers on SndQue
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
TCP protocol header file.
|
TCP protocol header file.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
|
||||||
|
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -315,6 +315,12 @@ struct _TCP_CONTROL_BLOCK {
|
||||||
UINT8 LossTimes; ///< Number of retxmit timeouts in a row.
|
UINT8 LossTimes; ///< Number of retxmit timeouts in a row.
|
||||||
TCP_SEQNO LossRecover; ///< Recover point for retxmit.
|
TCP_SEQNO LossRecover; ///< Recover point for retxmit.
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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
|
// configuration parameters, for EFI_TCP4_PROTOCOL specification
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue