summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_sack.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-01-05 10:16:07 -0800
committerDave Barach <openvpp@barachs.net>2022-01-06 23:09:40 +0000
commited5be47009aca45008ba9d44e76ac51ec1f7f156 (patch)
tree9dbd8a4dd43777f706eed8b1167a22d729eb05f7 /src/vnet/tcp/tcp_sack.c
parent8e1ada3a615f47d318586add8a4358ea50a10695 (diff)
tcp: mark lost first sack hole on timeout
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I1abff943f3fe3ff0219126b5b8beded4ad859758
Diffstat (limited to 'src/vnet/tcp/tcp_sack.c')
-rw-r--r--src/vnet/tcp/tcp_sack.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp_sack.c b/src/vnet/tcp/tcp_sack.c
index 8f51b517361..63af07b50cd 100644
--- a/src/vnet/tcp/tcp_sack.c
+++ b/src/vnet/tcp/tcp_sack.c
@@ -265,6 +265,27 @@ scoreboard_init_rxt (sack_scoreboard_t * sb, u32 snd_una)
}
void
+scoreboard_rxt_mark_lost (sack_scoreboard_t *sb, u32 snd_una, u32 snd_nxt)
+{
+ sack_scoreboard_hole_t *hole;
+
+ hole = scoreboard_first_hole (sb);
+ if (!hole)
+ {
+ hole = scoreboard_insert_hole (sb, TCP_INVALID_SACK_HOLE_INDEX, snd_una,
+ snd_nxt);
+ sb->tail = scoreboard_hole_index (sb, hole);
+ sb->high_sacked = snd_una;
+ }
+
+ if (hole->is_lost)
+ return;
+
+ hole->is_lost = 1;
+ sb->lost_bytes += scoreboard_hole_bytes (hole);
+}
+
+void
scoreboard_init (sack_scoreboard_t * sb)
{
sb->head = TCP_INVALID_SACK_HOLE_INDEX;