Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2021 00:02:18 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: ecfc25f05bf4 - stable/13 - tcp: In rack, we must only convert restored rtt when the hostcache does restore them.
Message-ID:  <202106090002.15902Ii4056774@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=ecfc25f05bf4bea6ce35a34b746d50fe57d84130

commit ecfc25f05bf4bea6ce35a34b746d50fe57d84130
Author:     Randall Stewart <rrs@FreeBSD.org>
AuthorDate: 2021-05-11 12:15:05 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-06-09 00:01:32 +0000

    tcp: In rack, we must only convert restored rtt when the hostcache does restore them.
    
    Rack now after the previous commit is very careful to translate any
    value in the hostcache for srtt/rttvar into its proper format. However
    there is a snafu here in that if tp->srtt is 0 is the only time that
    the HC will actually restore the srtt. We need to then only convert
    the srtt restored when it is actually restored. We do this by making
    sure it was zero before the call to cc_conn_init and it is non-zero
    afterwards.
    
    Reviewed by:    Michael Tuexen
    Sponsored by: Netflix Inc
    Differential Revision:  https://reviews.freebsd.org/D30213
    
    (cherry picked from commit 4b86a24a76a4d58c1d870fcb2252b321f61cb3cc)
---
 sys/netinet/tcp_stacks/rack.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 7bb77d8158af..e9d3c6b95d91 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -6614,14 +6614,17 @@ static void
 rack_cc_conn_init(struct tcpcb *tp)
 {
 	struct tcp_rack *rack;
+	uint32_t srtt;
 
 	rack = (struct tcp_rack *)tp->t_fb_ptr;
-
+	srtt = tp->t_srtt;
 	cc_conn_init(tp);
 	/*
-	 * Now convert to rack's internal format.
+	 * Now convert to rack's internal format,
+	 * if required.
 	 */
-	rack_convert_rtts(tp);
+	if ((srtt == 0) && (tp->t_srtt != 0))
+		rack_convert_rtts(tp);
 	/*
 	 * We want a chance to stay in slowstart as
 	 * we create a connection. TCP spec says that



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106090002.15902Ii4056774>