From: Junwei Hu <hujunw...@huawei.com> In the document of RFC2582(https://tools.ietf.org/html/rfc2582) introduced two separate scenarios for tcp congestion control: There are two separate scenarios in which the TCP sender could receive three duplicate acknowledgements acknowledging "send_high" but no more than "send_high". One scenario would be that the data sender transmitted four packets with sequence numbers higher than "send_high", that the first packet was dropped in the network, and the following three packets triggered three duplicate acknowledgements acknowledging "send_high". The second scenario would be that the sender unnecessarily retransmitted three packets below "send_high", and that these three packets triggered three duplicate acknowledgements acknowledging "send_high". In the absence of SACK, the TCP sender in unable to distinguish between these two scenarios.
We encountered the second scenario when the third-party switches does not support SACK, and I use kprobes to find that tcp kept in CA_Loss state when high_seq equal to snd_nxt. All of the packets is acked if high_seq equal to snd_nxt, the TCP sender is able to distinguish between these two scenarios in described RFC2582. So the current state can be switched. This patch enhance the TCP congestion control algorithm for lack of SACK. Signed-off-by: Junwei Hu <hujunw...@huawei.com> Reviewed-by: XiaoGang Wang <wangxiaoga...@huawei.com> Reviewed-by: Yiting Jin <jinyit...@huawei.com> --- net/ipv4/tcp_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 9615e72..d5573123 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -2385,7 +2385,8 @@ static bool tcp_try_undo_recovery(struct sock *sk) } else if (tp->rack.reo_wnd_persist) { tp->rack.reo_wnd_persist--; } - if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) { + if (tp->snd_una == tp->high_seq && + tcp_is_reno(tp) && tp->snd_nxt > tp->high_seq) { /* Hold old state until something *above* high_seq * is ACKed. For Reno it is MUST to prevent false * fast retransmits (RFC2582). SACK TCP is safe. */ -- 1.7.12.4