From owner-dev-commits-src-all@freebsd.org Fri Mar 26 01:10:16 2021 Return-Path: Delivered-To: dev-commits-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 6CD505AEB32; Fri, 26 Mar 2021 01:10:16 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F63mm2dNDz3Flh; Fri, 26 Mar 2021 01:10:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CBF210FF0; Fri, 26 Mar 2021 01:10:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12Q1AGmF021251; Fri, 26 Mar 2021 01:10:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12Q1AGY2021244; Fri, 26 Mar 2021 01:10:16 GMT (envelope-from git) Date: Fri, 26 Mar 2021 01:10:16 GMT Message-Id: <202103260110.12Q1AGY2021244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Richard Scheffenegger Subject: git: b9f803b7d4b7 - main - tcp: Use PRR for ECN congestion recovery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rscheff X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2021 01:10:16 -0000 The branch main has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a commit b9f803b7d4b7ee3799ab94f66c02c3b6e58c153a Author: Richard Scheffenegger AuthorDate: 2021-03-26 01:05:22 +0000 Commit: Richard Scheffenegger CommitDate: 2021-03-26 01:06:15 +0000 tcp: Use PRR for ECN congestion recovery MFC after: 2 weeks Reviewed By: #transport, rrs Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28972 --- sys/netinet/tcp_input.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7c291eaec633..57779de1759a 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2786,6 +2786,16 @@ resume_partialack: tcp_newreno_partial_ack(tp, th); } else cc_post_recovery(tp, th); + } else if (IN_CONGRECOVERY(tp->t_flags)) { + if (SEQ_LT(th->th_ack, tp->snd_recover)) { + if (V_tcp_do_prr) { + tp->sackhint.delivered_data = BYTES_THIS_ACK(tp, th); + tp->snd_fack = th->th_ack; + tcp_do_prr_ack(tp, th); + (void) tcp_output(tp); + } + } else + cc_post_recovery(tp, th); } /* * If we reach this point, ACK is not a duplicate, @@ -3954,8 +3964,12 @@ tcp_do_prr_ack(struct tcpcb *tp, struct tcphdr *th) * If there is going to be a SACK retransmission, adjust snd_cwnd * accordingly. */ - tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + - tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + if (IN_FASTRECOVERY(tp->t_flags)) { + tp->snd_cwnd = imax(maxseg, tp->snd_nxt - tp->snd_recover + + tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg)); + } else if (IN_CONGRECOVERY(tp->t_flags)) + tp->snd_cwnd = imax(maxseg, pipe - del_data + + (snd_cnt * maxseg)); } /*