From nobody Sun Sep 25 10:04:43 2022 X-Original-To: dev-commits-src-all@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 4Mb1hW5zCJz4ct08; Sun, 25 Sep 2022 10:04:43 +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 4Mb1hW4Y8Hz3TSB; Sun, 25 Sep 2022 10:04:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664100283; 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=Sg5lIm5Yh5MBZbMDDEj9ckfRAogPUGxaCMXuAKwuOtM=; b=r9NyVS496UyyM4NZsuCujRcrjO5qLQv6z/8KFxNS3AWp6jUn4y0Cq9ZKIbHytsbtu1zoEN ycF610yHmVQSOXEUVXq2dAl2AHQvMQndrw65B8EoPHNQKrqthHT9tdCnBvpYZkz6Gy7bSG BbcSx+o/DzGu7rX5FwbaQCOWmFdOmRHjU6+rsRJPgvSzXu/Di9h2F2OqJ2dVAaztEK4tQ5 K5d1bb8Wx7CixJIEGLq0t9Ft35lDV09ZEQimWBZM1NzDlpXUuLVyAaS8zQ5N+3uzxWc/rv F4AHJe1qRAmSYazfcMzOqUhYAueT7WjvScZgMxLF5oEj5Y9t7vEqLUuSr5D/Lg== 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 4Mb1hW3g9nzNjs; Sun, 25 Sep 2022 10:04:43 +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 28PA4hHG047229; Sun, 25 Sep 2022 10:04:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28PA4hD2047228; Sun, 25 Sep 2022 10:04:43 GMT (envelope-from git) Date: Sun, 25 Sep 2022 10:04:43 GMT Message-Id: <202209251004.28PA4hD2047228@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: 3651c4f42285 - stable/12 - tcp: fix cwnd restricted SACK retransmission loop List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/12 X-Git-Reftype: branch X-Git-Commit: 3651c4f42285644938e2f5bc924ab8c7ed857f83 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664100283; 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=Sg5lIm5Yh5MBZbMDDEj9ckfRAogPUGxaCMXuAKwuOtM=; b=MX7wPtO2muzK6SruaHUeM4MPHvNBI9fMGmTlHt6aEBsfz2b5JHs3X+Mz6bxo+A3Mt+DwjV M4Ji7SVw2GzdTJYIq1jARu6WjpQ6porWjy5Hir3vjbCy7RszFoEPNX9mZJthKofFeHVDUy 3e6/X7q09xSjBl/grL4kFqZBlw6f4sPrEXgPa3lTyOi93DRiM2vOymfjduf0v88HZU41pi 6PMVgYZ4EYsK9Oebd4fEkysyxUTduEM+XCbnbft1dyo91dn1RUVnEKwXhvuQQc4dm2GoHL qduXVjBxMnjyNhqEsimsnCFlql3qaQ232tiP/RQFXx5fmVbuBWJyrovXmPdfWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664100283; a=rsa-sha256; cv=none; b=orIqrT20N/ReLVrgcvksCAQ38dtsKCmHs8ws/kDVKb/4ZdFjhol9wNQ6GoAJdXvYw/UBPD Od2uy/H4Z6svmjtskKCNRKpMVBfZEsWFCb55ggn0DkJXeLjBSPSm66QuAJUjv9gUKa7tGh kDObfOjeYqLpPyt9Ado36XqoUAtCIkg9S3S9aqNHcNGtP9SECrzrXgL3meeJyCzEDPK5Gp KDNWQPcWqEOxRsJbf7HSzrvYWJIp9QRjbEWe/3FA65xbeTmUlS7Ktj/WLhKO9oh6hoB/Pg Z3rI9qC9JLuNfTSo/yCGds6BwJ7/RtQ1ZXOuBVQ7uVpfZtdJsQuWGWOqHyjZfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rscheff: URL: https://cgit.FreeBSD.org/src/commit/?id=3651c4f42285644938e2f5bc924ab8c7ed857f83 commit 3651c4f42285644938e2f5bc924ab8c7ed857f83 Author: Richard Scheffenegger AuthorDate: 2022-09-22 10:55:25 +0000 Commit: Richard Scheffenegger CommitDate: 2022-09-25 08:52:56 +0000 tcp: fix cwnd restricted SACK retransmission loop While doing the initial SACK retransmission segment while heavily cwnd constrained, tcp_ouput can erroneously send out the entire sendbuffer again. This may happen after an retransmission timeout, which resets snd_nxt to snd_una while the SACK scoreboard is still populated. Reviewed By: tuexen, #transport PR: 264257 PR: 263445 PR: 260393 MFC after: 3 days Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D36637 (cherry picked from commit a743fc8826fa348b09d219632594c537f8e5690e) --- sys/netinet/tcp_output.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index e8d585a15d1c..125227991a51 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -394,7 +394,7 @@ after_sack_rexmit: else { int32_t cwin; - /* + /* * We are inside of a SACK recovery episode and are * sending new data, having retransmitted all the * data possible in the scoreboard. @@ -410,8 +410,8 @@ after_sack_rexmit: * of len is bungled by the optimizer. */ if (len > 0) { - cwin = tp->snd_cwnd - - (tp->snd_nxt - tp->sack_newdata) - + cwin = tp->snd_cwnd - imax(0, (int32_t) + (tp->snd_nxt - tp->sack_newdata)) - sack_bytes_rxmt; if (cwin < 0) cwin = 0;