From nobody Wed Feb 01 23:31:26 2023 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 4P6dTp4STNz3cLLl; Wed, 1 Feb 2023 23:31:26 +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 4P6dTp42Sdz3KqR; Wed, 1 Feb 2023 23:31:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294286; 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=WtRVGS042/oGTEZ1u+kvv7yv9WrUNoL1OxneOpfqTTs=; b=ashfLyxQ7Bo+/fu0Zzat1xyNoJbtetaTpLAZhZkiKV4Iz57CF9Tlo0TNBaiz120m1k01z9 pZsIZqlj5klfWT4EoHxkN+4JipsuHyBorj4z+pCGMZJPLu5Ek9HKqbc3IgVCEvCSDT1R1B DT+khVOuuukC7AqXVt4HEyaMS+gEzNc0L1pegPEJ4xRK4tDQE5lfM/FY5awRtZSNsgSeIR Syk/r2wSfHGFQqv+yWawqwu4awAcGBVwOQ4yFP3Y+IMiX2/Q6OPc3tT0GUa8qlvI16mvq6 nlQGk68mvFo1aTH8RGJ+FP/HxgG+gby+vlyfPgOcYLRJKrqe5vsaaqnSsAVnHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294286; 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=WtRVGS042/oGTEZ1u+kvv7yv9WrUNoL1OxneOpfqTTs=; b=AwnYr8JVcKB+kTiW/gUVfC13Jv7MfID8B6YqtSaEoaWt4UbykSZ/3LlOHyuPha1Q7z1KF/ 4u/Q3DcqTPK+2I90jAMBh2SpjtptZsKfiqwPsBrURjabuTtq9UGPi0p6wybffMyl03dey9 2d93J83tKtUlaX+RuUrgjNQ5f2FNrUYN3GAiOdt2eE3va1yEa5BvyR9YObfiJ9rEkzs0Ou 63XpKUeWhnsp2yhEBNzAMnSdEq9W4h2+FSP39KhoQ8g/CkPzq4d/5NFHSVw+X3SHvvsDpH tqRkfKUu2sfSnRUuYrlF5qvotgXOxf1f36t9rthpECPdT/2suN4JF0N1qYx8gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675294286; a=rsa-sha256; cv=none; b=FdbsjFZQ8X0IOjWeSFyXjEuznHsOB0SYQ3n42aGfg72XaMJwIN3OO8PDZNMNWFbIqZzP6x 5ViUnnBDDl+P6SfTjH1DASo1W6dRlsiDi5OC2InuiVFVF4ll0TUpJZfWyL+tdkm6goLh9g RdJDssAV0x5T2ykVrOtOT6VmWhkt2ss5Vgr7CcXMUoe24u2QbIiYaf7otizE63xhycUlzy wKoiiRq81dVNXn51k3u0vnaEhGNJl5TX+5xWLacFPkoM6CuNt2HMogEOUidXTg3ycraWj1 GwdS2ACJe/ijsnpQkm5YsUyNegG46BP+ACYwKkx0kn3dW/WZVxzqLRi/KdAh9g== 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 4P6dTp34sRzY9f; Wed, 1 Feb 2023 23:31:26 +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 311NVQDq074419; Wed, 1 Feb 2023 23:31:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311NVQMx074418; Wed, 1 Feb 2023 23:31:26 GMT (envelope-from git) Date: Wed, 1 Feb 2023 23:31:26 GMT Message-Id: <202302012331.311NVQMx074418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Tuexen Subject: git: f450156bea76 - stable/13 - tcp rack: simplify computation of rsm start and end 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f450156bea766c71d5728e907c08f3ef142caf45 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f450156bea766c71d5728e907c08f3ef142caf45 commit f450156bea766c71d5728e907c08f3ef142caf45 Author: Michael Tuexen AuthorDate: 2022-08-02 10:45:56 +0000 Commit: Michael Tuexen CommitDate: 2023-02-01 23:30:58 +0000 tcp rack: simplify computation of rsm start and end While there, also fix the setting of the SYN related flag. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D35862 (cherry picked from commit 1abc27dd52e5fd151472439004f20dc798887ae1) --- sys/netinet/tcp_stacks/rack.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index e11351e5c515..162b1c928ef7 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -12285,14 +12285,11 @@ rack_init(struct tcpcb *tp) rsm->r_rtr_bytes = 0; if (tp->t_flags & TF_SENTFIN) rsm->r_flags |= RACK_HAS_FIN; - rsm->r_end = tp->snd_max; - if (tp->snd_una == tp->iss) { - /* The data space is one beyond snd_una */ + if ((tp->snd_una == tp->iss) && + !TCPS_HAVEESTABLISHED(tp->t_state)) rsm->r_flags |= RACK_HAS_SYN; - rsm->r_start = tp->iss; - rsm->r_end = rsm->r_start + (tp->snd_max - tp->snd_una); - } else - rsm->r_start = tp->snd_una; + rsm->r_start = tp->snd_una; + rsm->r_end = tp->snd_max; rsm->r_dupack = 0; if (rack->rc_inp->inp_socket->so_snd.sb_mb != NULL) { rsm->m = sbsndmbuf(&rack->rc_inp->inp_socket->so_snd, 0, &rsm->soff);