Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Apr 2021 07:29:40 GMT
From:      Richard Scheffenegger <rscheff@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d76eb0da7283 - stable/13 - tcp: keep SACK scoreboard sorted when doing rescue retransmission
Message-ID:  <202104230729.13N7TeXU004967@gitrepo.freebsd.org>

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

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

commit d76eb0da7283f83b09d5491d81e25485d87298ab
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2021-04-18 20:14:14 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2021-04-23 07:25:57 +0000

    tcp: keep SACK scoreboard sorted when doing rescue retransmission
    
    Reviewed By: tuexen, kbowling, #transport
    MFC after: 3 days
    Sponsored by: NetApp, Inc.
    Differential Revision: https://reviews.freebsd.org/D29825
    
    (cherry picked from commit b87cf2bc841b2a336b7f0c6cd89573610412a84f)
---
 sys/netinet/tcp_sack.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c
index f8d983da723b..08ce2a0882b1 100644
--- a/sys/netinet/tcp_sack.c
+++ b/sys/netinet/tcp_sack.c
@@ -491,7 +491,7 @@ static struct sackhole *
 tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end,
     struct sackhole *after)
 {
-	struct sackhole *hole;
+	struct sackhole *hole, *tail;
 
 	/* Allocate a new SACK hole. */
 	hole = tcp_sackhole_alloc(tp, start, end);
@@ -502,7 +502,15 @@ tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end,
 	if (after != NULL)
 		TAILQ_INSERT_AFTER(&tp->snd_holes, after, hole, scblink);
 	else
-		TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink);
+		/*
+		 * With Rescue Retransmission, new holes may need to
+		 * be inserted just before the tail.
+		 */
+		if (((tail = TAILQ_LAST_FAST(&tp->snd_holes, sackhole,
+		    scblink)) != NULL) && SEQ_LEQ(end, tail->start))
+			TAILQ_INSERT_BEFORE(tail, hole, scblink);
+		else
+			TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink);
 
 	/* Update SACK hint. */
 	if (tp->sackhint.nexthole == NULL)



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