From nobody Mon Feb 5 11:41:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TT4Gh3x94z59mft; Mon, 5 Feb 2024 11:41:48 +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 4TT4Gh3SSgz4k06; Mon, 5 Feb 2024 11:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707133308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mys6PbqdKGPByRTTtwTFSkHNpGDRgZ85bVAQGRp9ZPY=; b=u+XCJWDojj0XuzE/HTkWrvzQGJin2hV4N+GMMngLbXaGnmAVhle0NJIS0JEwPrMfiF6dBv MKfK6HGrXlrNPi9AtciwxlJOKqUdKhNW3mWfESGfmHUigVkuPqQgNKxjCpM6br60Xoh7QC ZMkNxuLzXvSKCJId1T1m1dXlOWJrk2SA1JNY1N2vZmU0OErVgWXV9ge1vc3mCL6E6uYNba HjSztmkVRgunIowAKLHWQT+NQAyhHqVVxcHGC3c2hE2CRMK4xyVtoFnlny2kPxyk0dp2YD +jOSYOBanXDBd09ubwYHirDfYZvHF8Xgn5fo+WphBHL1lACAjCBf2E0T6uvgaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707133308; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mys6PbqdKGPByRTTtwTFSkHNpGDRgZ85bVAQGRp9ZPY=; b=ZF3xdJ+uNmJiKGARA/RqlS/FpqS2mKmBPM/6nCywR+75Dcxnv1Q0TDpEuKex6bIxZ6n7Fp G7ylheyX6XYygze2MX8GNBspi8bz5H3LZ1hLeXl0LASlz8st7QVsz72eeS95Mq6d/SgmQi HHH91/IcVkEqFE8ebTh91rIBIlYzAGir3ltIGmG/LZEDnSGeqouyP5IfrGT629HD+KJBRv FSmg17zTU95ugZ23cpw3gHuNy3QrVbuvUE6j9heHSXwWJB62EhrPsvxV7ksn5TnBACHYT/ Ei2gzxxbtSFNBt0WV65TuiGB0rUNcz1Z/PapMsn9Xwf/arT44iebXwcDAB6MIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707133308; a=rsa-sha256; cv=none; b=mEw+9ecthxMP8qjVHnlTc+ug1IXIuXlgbRaNFYGFsvIxFVAVWcqrjPrevIIqO+BYW9KbJA QLiCK7A1yMyWqqu56Hfp/7ck4QSlryF8k58TKk8+s6iY9eZOElm1uEeEJ0cxJGUCYXcpZl Vqmv4/+3Rcqf5HP+TTB2dwOUt5dwRQYDpfyqAQ0CpYuVLp6ZUuqD1+uUaGiikEjR4oowYk Xx+8L+B7yM+naIyWSJU4VzpdhZZK1FqenUtYbVDO0QWZTzFV2n3Folcz3OV5jPU3+bOrnj 1TUJrfxy1YCdTBTRr9eJ5t+TWhHYELLB1C7K7y20msd/2wuhje4YSOPhrA284Q== 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 4TT4Gh2WX8zfCc; Mon, 5 Feb 2024 11:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 415BfmI9075447; Mon, 5 Feb 2024 11:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 415Bfmuw075444; Mon, 5 Feb 2024 11:41:48 GMT (envelope-from git) Date: Mon, 5 Feb 2024 11:41:48 GMT Message-Id: <202402051141.415Bfmuw075444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Richard Scheffenegger Subject: git: 9bc48382a5e8 - stable/14 - tcp: move cc_post_recovery past snd_una update List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9bc48382a5e8260b3240b4cd99d984ada55f0990 Auto-Submitted: auto-generated The branch stable/14 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=9bc48382a5e8260b3240b4cd99d984ada55f0990 commit 9bc48382a5e8260b3240b4cd99d984ada55f0990 Author: Richard Scheffenegger AuthorDate: 2024-01-27 23:16:59 +0000 Commit: Richard Scheffenegger CommitDate: 2024-02-01 18:13:53 +0000 tcp: move cc_post_recovery past snd_una update The RFC6675 pipe calculation (sack.revised, enabled by default since D28702), uses outdated information, while the previous default calculated it correctly with up-to-date information from the incoming ACK. This difference can become as large as the receive window (not the congestion window previously), potentially triggering a massive burst of new packets. MFC after: 1 week Reviewed By: tuexen, #transport Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D43520 (cherry picked from commit 0b3f9e435f2bde9e5be27030d9f574a977a1ad47) --- sys/netinet/tcp_input.c | 57 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 38498370ceb2..2a4f3875d1b9 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -478,13 +478,12 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) { INP_WLOCK_ASSERT(tptoinpcb(tp)); - /* XXXLAS: KASSERT that we're in recovery? */ - if (CC_ALGO(tp)->post_recovery != NULL) { tp->t_ccv.curack = th->th_ack; CC_ALGO(tp)->post_recovery(&tp->t_ccv); } - /* XXXLAS: EXIT_RECOVERY ? */ + EXIT_RECOVERY(tp->t_flags); + tp->t_bytes_acked = 0; tp->sackhint.delivered_data = 0; tp->sackhint.prr_delivered = 0; @@ -2803,35 +2802,36 @@ resume_partialack: * If the congestion window was inflated to account * for the other side's cached packets, retract it. */ - if (IN_FASTRECOVERY(tp->t_flags)) { - if (SEQ_LT(th->th_ack, tp->snd_recover)) { - if (tp->t_flags & TF_SACK_PERMIT) - if (V_tcp_do_prr && to.to_flags & TOF_SACK) { - tcp_timer_activate(tp, TT_REXMT, 0); + if (SEQ_LT(th->th_ack, tp->snd_recover)) { + if (IN_FASTRECOVERY(tp->t_flags)) { + if (tp->t_flags & TF_SACK_PERMIT) { + if (V_tcp_do_prr && + (to.to_flags & TOF_SACK)) { + tcp_timer_activate(tp, + TT_REXMT, 0); tp->t_rtttime = 0; - tcp_do_prr_ack(tp, th, &to, sack_changed); + tcp_do_prr_ack(tp, th, &to, + sack_changed); tp->t_flags |= TF_ACKNOW; (void) tcp_output(tp); - } else + } else { tcp_sack_partialack(tp, th); - else + } + } else { 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; - /* - * During ECN cwnd reduction - * always use PRR-SSRB - */ - tcp_do_prr_ack(tp, th, &to, SACK_CHANGE); - (void) tcp_output(tp); } - } else - cc_post_recovery(tp, th); + } else if (IN_CONGRECOVERY(tp->t_flags) && + (V_tcp_do_prr)) { + tp->sackhint.delivered_data = + BYTES_THIS_ACK(tp, th); + tp->snd_fack = th->th_ack; + /* + * During ECN cwnd reduction + * always use PRR-SSRB + */ + tcp_do_prr_ack(tp, th, &to, SACK_CHANGE); + (void) tcp_output(tp); + } } /* * If we reach this point, ACK is not a duplicate, @@ -2982,12 +2982,11 @@ process_ACK: SEQ_GT(tp->snd_una, tp->snd_recover) && SEQ_LEQ(th->th_ack, tp->snd_recover)) tp->snd_recover = th->th_ack - 1; - /* XXXLAS: Can this be moved up into cc_post_recovery? */ + tp->snd_una = th->th_ack; if (IN_RECOVERY(tp->t_flags) && SEQ_GEQ(th->th_ack, tp->snd_recover)) { - EXIT_RECOVERY(tp->t_flags); + cc_post_recovery(tp, th); } - tp->snd_una = th->th_ack; if (tp->t_flags & TF_SACK_PERMIT) { if (SEQ_GT(tp->snd_una, tp->snd_recover)) tp->snd_recover = tp->snd_una;