From 9cc711c9ff5e2028cc4518d742404cfcb6636421 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Sat, 25 Jan 2020 13:45:10 +0000 Subject: [PATCH] Sending CWR after an RTO is according to RFC 3168 generally required and not only for the DCTCP congestion control. Submitted by: Richard Scheffenegger Reviewed by: rgrimes, tuexen@, Cheng Cui MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23119 --- sys/netinet/cc/cc_dctcp.c | 1 - sys/netinet/tcp_input.c | 2 ++ sys/netinet/tcp_stacks/rack.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c index 4e143eb45551..72aa8f73c0d3 100644 --- a/sys/netinet/cc/cc_dctcp.c +++ b/sys/netinet/cc/cc_dctcp.c @@ -284,7 +284,6 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->ece_curr = 1; break; case CC_RTO: - CCV(ccv, t_flags2) |= TF2_ECN_SND_CWR; dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 91a10ee31503..5050210ca1b3 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -460,6 +460,8 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type) tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / maxseg) * maxseg; tp->snd_cwnd = maxseg; + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 4f3bc4c732c4..bbb3756c6bfa 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -1813,6 +1813,8 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type) tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / ctf_fixed_maxseg(tp)) * ctf_fixed_maxseg(tp); tp->snd_cwnd = ctf_fixed_maxseg(tp); + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad);