From owner-svn-src-all@freebsd.org Thu Sep 3 09:09:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55E123E03BC; Thu, 3 Sep 2020 09:09:45 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bhw491dLfz47hB; Thu, 3 Sep 2020 09:09:45 +0000 (UTC) (envelope-from rscheff@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B17219432; Thu, 3 Sep 2020 09:09:45 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08399iYn056863; Thu, 3 Sep 2020 09:09:44 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08399ikC056862; Thu, 3 Sep 2020 09:09:44 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202009030909.08399ikC056862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 3 Sep 2020 09:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365295 - stable/12/sys/netinet/cc X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: stable/12/sys/netinet/cc X-SVN-Commit-Revision: 365295 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Sep 2020 09:09:45 -0000 Author: rscheff Date: Thu Sep 3 09:09:44 2020 New Revision: 365295 URL: https://svnweb.freebsd.org/changeset/base/365295 Log: MFC r364354: TCP Cubic: recalculate cwnd for every ACK. Since cubic calculates cwnd based on absolute time, retaining RFC3465 (ABC) once-per-window updates can lead to dramatic changes of cwnd in the convex region. Updating cwnd for each incoming ack minimizes this delta, preventing unintentional line-rate bursts. Reviewed by: chengc_netapp.com, tuexen (mentor) MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26060 Modified: stable/12/sys/netinet/cc/cc_cubic.c Modified: stable/12/sys/netinet/cc/cc_cubic.c ============================================================================== --- stable/12/sys/netinet/cc/cc_cubic.c Thu Sep 3 08:45:21 2020 (r365294) +++ stable/12/sys/netinet/cc/cc_cubic.c Thu Sep 3 09:09:44 2020 (r365295) @@ -131,16 +131,11 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) cubic_record_rtt(ccv); /* - * Regular ACK and we're not in cong/fast recovery and we're cwnd - * limited and we're either not doing ABC or are just coming out - * from slow-start or were application limited or are slow starting - * or are doing ABC and we've sent a cwnd's worth of bytes. + * For a regular ACK and we're not in cong/fast recovery and + * we're cwnd limited, always recalculate cwnd. */ if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) && - (ccv->flags & CCF_CWND_LIMITED) && (!V_tcp_do_rfc3465 || - (cubic_data->flags & (CUBICFLAG_IN_SLOWSTART | CUBICFLAG_IN_APPLIMIT)) || - CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || - (V_tcp_do_rfc3465 && (ccv->flags & CCF_ABC_SENTAWND)))) { + (ccv->flags & CCF_CWND_LIMITED)) { /* Use the logic in NewReno ack_received() for slow start. */ if (CCV(ccv, snd_cwnd) <= CCV(ccv, snd_ssthresh) || cubic_data->min_rtt_ticks == TCPTV_SRTTBASE) { @@ -193,15 +188,8 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * cwnd growth. * Only update snd_cwnd, if it doesn't shrink. */ - if (V_tcp_do_rfc3465) - CCV(ccv, snd_cwnd) = ulmin(w_cubic_next, - INT_MAX); - else - CCV(ccv, snd_cwnd) += ulmax(1, - ((ulmin(w_cubic_next, INT_MAX) - - CCV(ccv, snd_cwnd)) * - CCV(ccv, t_maxseg)) / - CCV(ccv, snd_cwnd)); + CCV(ccv, snd_cwnd) = ulmin(w_cubic_next, + INT_MAX); } /*