From owner-svn-src-head@freebsd.org Tue Jul 25 15:03:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0A7CC7E6C3; Tue, 25 Jul 2017 15:03:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91D257ECE1; Tue, 25 Jul 2017 15:03:07 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6PF367m038787; Tue, 25 Jul 2017 15:03:06 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6PF35cf038781; Tue, 25 Jul 2017 15:03:05 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201707251503.v6PF35cf038781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 25 Jul 2017 15:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321479 - in head/sys/netinet: . cc X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head/sys/netinet: . cc X-SVN-Commit-Revision: 321479 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2017 15:03:07 -0000 Author: sbruno Date: Tue Jul 25 15:03:05 2017 New Revision: 321479 URL: https://svnweb.freebsd.org/changeset/base/321479 Log: Revert r308180 - Set slow start threshold more accurrately on loss ... This was discussed between various transport@ members and it was requested to be reverted and discussed. Submitted by: kevin Reported by: lawerence Reviewed by: hiren Modified: head/sys/netinet/cc/cc_cdg.c head/sys/netinet/cc/cc_chd.c head/sys/netinet/cc/cc_dctcp.c head/sys/netinet/cc/cc_htcp.c head/sys/netinet/cc/cc_newreno.c head/sys/netinet/tcp_input.c Modified: head/sys/netinet/cc/cc_cdg.c ============================================================================== --- head/sys/netinet/cc/cc_cdg.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_cdg.c Tue Jul 25 15:03:05 2017 (r321479) @@ -474,9 +474,7 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_ty ENTER_RECOVERY(CCV(ccv, t_flags)); break; case CC_RTO: - CCV(ccv, snd_ssthresh) = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; + CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2); CCV(ccv, snd_cwnd) = mss; break; default: Modified: head/sys/netinet/cc/cc_chd.c ============================================================================== --- head/sys/netinet/cc/cc_chd.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_chd.c Tue Jul 25 15:03:05 2017 (r321479) @@ -330,11 +330,13 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty struct ertt *e_t; struct chd *chd_data; int qdly; + uint32_t cwin; u_int mss; e_t = khelp_get_osd(CCV(ccv, osd), ertt_id); chd_data = ccv->cc_data; qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt; + cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); switch(signal_type) { @@ -376,9 +378,7 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty ENTER_FASTRECOVERY(CCV(ccv, t_flags)); break; case CC_RTO: - CCV(ccv, snd_ssthresh) = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; + CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2); CCV(ccv, snd_cwnd) = mss; break; Modified: head/sys/netinet/cc/cc_dctcp.c ============================================================================== --- head/sys/netinet/cc/cc_dctcp.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_dctcp.c Tue Jul 25 15:03:05 2017 (r321479) @@ -230,21 +230,19 @@ static void dctcp_cong_signal(struct cc_var *ccv, uint32_t type) { struct dctcp *dctcp_data; - uint32_t cwin, ssthresh_on_loss; + uint32_t cwin; u_int mss; dctcp_data = ccv->cc_data; cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); - ssthresh_on_loss = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; switch (type) { case CC_NDUPACK: if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = mss * + max(cwin / 2 / mss, 2); dctcp_data->num_cong_events++; } else { /* cwnd has already updated as congestion @@ -252,7 +250,8 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) * snd_cwnd_prev and recalculate snd_ssthresh */ cwin = CCV(ccv, snd_cwnd_prev); - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = + max(cwin / 2 / mss, 2) * mss; } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -266,7 +265,8 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { if (V_dctcp_slowstart && dctcp_data->num_cong_events++ == 0) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = + mss * max(cwin / 2 / mss, 2); dctcp_data->alpha = MAX_ALPHA_VALUE; dctcp_data->bytes_ecn = 0; dctcp_data->bytes_total = 0; @@ -285,7 +285,7 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = max(2 * mss, cwin / 2); CCV(ccv, snd_cwnd) = mss; } break; Modified: head/sys/netinet/cc/cc_htcp.c ============================================================================== --- head/sys/netinet/cc/cc_htcp.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_htcp.c Tue Jul 25 15:03:05 2017 (r321479) @@ -325,9 +325,7 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type) */ if (CCV(ccv, t_rxtshift) >= 2) htcp_data->t_last_cong = ticks; - CCV(ccv, snd_ssthresh) = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; + CCV(ccv, snd_ssthresh) = max(2 * mss, cwin / 2); CCV(ccv, snd_cwnd) = mss; break; } @@ -520,10 +518,6 @@ htcp_ssthresh_update(struct cc_var *ccv) CCV(ccv, snd_ssthresh) = ((u_long)CCV(ccv, snd_cwnd) * htcp_data->beta) >> HTCP_SHIFT; } - - /* Align ssthresh to MSS boundary */ - CCV(ccv, snd_ssthresh) = (CCV(ccv, snd_ssthresh) / CCV(ccv, t_maxseg)) - * CCV(ccv, t_maxseg); } Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/cc/cc_newreno.c Tue Jul 25 15:03:05 2017 (r321479) @@ -182,26 +182,23 @@ newreno_after_idle(struct cc_var *ccv) static void newreno_cong_signal(struct cc_var *ccv, uint32_t type) { - uint32_t cwin, ssthresh_on_loss; + uint32_t cwin; u_int mss; cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); - ssthresh_on_loss = - max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2) - * mss; /* Catch algos which mistakenly leak private signal types. */ KASSERT((type & CC_SIGPRIVMASK) == 0, ("%s: congestion signal type 0x%08x is private\n", __func__, type)); - cwin = max(cwin / 2 / mss, 2) * mss; + cwin = max(2*mss, cwin/2); switch (type) { case CC_NDUPACK: if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) { if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = cwin; CCV(ccv, snd_cwnd) = cwin; } ENTER_RECOVERY(CCV(ccv, t_flags)); @@ -209,13 +206,13 @@ newreno_cong_signal(struct cc_var *ccv, uint32_t type) break; case CC_ECN: if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) { - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = cwin; CCV(ccv, snd_cwnd) = cwin; ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } break; case CC_RTO: - CCV(ccv, snd_ssthresh) = ssthresh_on_loss; + CCV(ccv, snd_ssthresh) = cwin; CCV(ccv, snd_cwnd) = mss; break; } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jul 25 14:46:13 2017 (r321478) +++ head/sys/netinet/tcp_input.c Tue Jul 25 15:03:05 2017 (r321479) @@ -441,8 +441,7 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui * ssthresh = max (FlightSize / 2, 2*SMSS) eq (4) */ tp->snd_ssthresh = - max((tp->snd_max - tp->snd_una) / 2 / maxseg, 2) - * maxseg; + max((tp->snd_max - tp->snd_una) / 2, 2 * maxseg); tp->snd_cwnd = maxseg; } break;