From nobody Fri May 26 10:35:18 2023 X-Original-To: dev-commits-src-main@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 4QSLsf2Xjkz4WYFV; Fri, 26 May 2023 10:35:18 +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 4QSLsf1tXRz4PBF; Fri, 26 May 2023 10:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685097318; 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=2eglkmeANHI33AJXilpzRE9NX7wG/Ot++e4Z4ESwDeQ=; b=uKJkT/V9UcaO9gol5WVrEspVaLiBIPCIeMQY7fJVl3m6yYhrT0CURjciMZqN25LNzpKubz aaxdakExqgVWmtXVN3zoqAxpsjaPj5cl4/cpmnymYtc71i+nW1xtC2yob9ccLrY4vP53MA BMTPvguuc/0DoSr2IoEMBoKCooGoXy2EDnlIi445HmqOs4NUCtetmvbyg3wBx/A8B6cUN3 5eYSZF0gZu2V4qpxi70/2YzaHpPTd8DCA/LuCa1LiPUWDD1wBLIqYbMu67fcERvtD22oUq dPbz70wFjozV9SEypuH4r00KDPVjaBQCZ/06IN4niy7LTnQu/iNFtBGaMiA46w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685097318; 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=2eglkmeANHI33AJXilpzRE9NX7wG/Ot++e4Z4ESwDeQ=; b=CaM8IovbleweaCmjsG6S1a/LRsPK0WPujoP8FgC0of5pQWua7FlEm+nekVi1EbK85rBNye EFnIFHmWBoVN6Qsf9H4YX6kEdHAP2pRKfGEc7ZfWfdqN2HW6/XA2MRK7nyL99vm7qxXnOp 5LEx7EKQ1ajeTvCzf0AXXtxImnegccr8CRsbDb7f8K0CNDOo0bn/k1Pip7Akv2Xo7K7x0a 26KhvQxIOa2ldfpvaFxqauGq33XOuvXX0WBEvDr8PZ11vKoQtipG1T28wlnXOITuKSsTk/ uvcyWD7dWu0oeV4lkqht6U+eEBKPuCfoWUS7s9bBaUYLwjNNGTw/wUk/IrIwhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685097318; a=rsa-sha256; cv=none; b=ll/ZFvD3f02i0P3amdRgaG++NJ2sec7Qh0KNOBkEJmcm5Rpxyi622oOqX+c4FbSpk1+g/n RxNZPekYWKawpqEL0CVhiMB4evWf8EZX3X4MBQBrPGYiWiU8IAOsQVER9vBs0HzAgXp766 MxdQ2Z5OzHW0aflxYZ/MeuTgVc1NDxIG4XsZK3RJQoXmUsoc1xLy1F1bARMXq73z4D3Sh0 xPBo1fcXIbHHhB0yOpgiQNyF50xmYpHET6jtN7e0xACoTFUr5V8VLRGevkZ8FqmQj7ws4+ JtiknjIqmocBFlHHmyhncCwNCMSZgNlQBW7Shc9zCNJnHXXt1RxxPcob3iFd6Q== 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 4QSLsf0z4cz13Wk; Fri, 26 May 2023 10:35:18 +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 34QAZIHZ059561; Fri, 26 May 2023 10:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34QAZIO8059560; Fri, 26 May 2023 10:35:18 GMT (envelope-from git) Date: Fri, 26 May 2023 10:35:18 GMT Message-Id: <202305261035.34QAZIO8059560@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: f5abdb03119a - main - tcp: fix a bug where unshifting should be put last in tcp_get_srtt() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5abdb03119a7e6608f0cfee0e7a28c94b9b0ca1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=f5abdb03119a7e6608f0cfee0e7a28c94b9b0ca1 commit f5abdb03119a7e6608f0cfee0e7a28c94b9b0ca1 Author: Cheng Cui AuthorDate: 2023-05-25 13:14:38 +0000 Commit: Cheng Cui CommitDate: 2023-05-26 06:30:52 +0000 tcp: fix a bug where unshifting should be put last in tcp_get_srtt() Reported by: Bhaskar Pardeshi from VMware. Reviewers: rscheff, tuexen, #transport! Approved by: tuexen (mentor) Subscribers: imp, melifaro, glebius Differential Revision: https://reviews.freebsd.org/D40267 --- sys/netinet/tcp_subr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8636ff4cefeb..52222d7c1634 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -4660,8 +4660,9 @@ tcp_get_srtt(struct tcpcb *tp, int granularity) /* * The user wants useconds and internally * its kept in ticks, convert to useconds. + * Put unshift at last improves precision. */ - srtt = TICKS_2_USEC(srtt); + srtt = TICKS_2_USEC(tp->t_srtt) >> TCP_RTT_SHIFT; } else if (granularity == TCP_TMR_GRANULARITY_TICKS) { /* * The user wants ticks and internally its