summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-10-19 17:49:00 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-10-21 19:26:22 +0000
commit9f9e969f149e40044fee9d2e47b7dd96f3ae4dfa (patch)
tree076e54c10681d87216b73b101e4ec569f8c41ada /src/vnet
parenta9ded38b1f2d852ff231a305805e5f5c801b9c76 (diff)
tcp: count first lost hole (VPP-1465)
Change-Id: I3ac136e2a10796d8fa86ddb6f0d6cabe5fa749f8 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/tcp/tcp_input.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index e75c77d0e2f..87bacc24354 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -680,29 +680,32 @@ scoreboard_update_bytes (tcp_connection_t * tc, sack_scoreboard_t * sb)
{
bytes = sb->high_sacked - left->end;
blks = 1;
- if (bytes > (TCP_DUPACK_THRESHOLD - 1) * tc->snd_mss
- && left->prev == TCP_INVALID_SACK_HOLE_INDEX)
- sb->lost_bytes += scoreboard_hole_bytes (left);
}
- right = left;
- while ((left = scoreboard_prev_hole (sb, right))
- && (bytes < (TCP_DUPACK_THRESHOLD - 1) * tc->snd_mss
- && blks < TCP_DUPACK_THRESHOLD))
+ while ((right = left)
+ && bytes < (TCP_DUPACK_THRESHOLD - 1) * tc->snd_mss
+ && blks < TCP_DUPACK_THRESHOLD
+ /* left not updated if above conditions fail */
+ && (left = scoreboard_prev_hole (sb, right)))
{
bytes += right->start - left->end;
blks++;
- right = left;
}
- while (left)
+ /* left is first lost */
+ if (left)
{
- bytes += right->start - left->end;
- sb->lost_bytes += scoreboard_hole_bytes (left);
- left->is_lost = 1;
- right = left;
- left = scoreboard_prev_hole (sb, left);
+ do
+ {
+ sb->lost_bytes += scoreboard_hole_bytes (right);
+ left->is_lost = 1;
+ left = scoreboard_prev_hole (sb, right);
+ if (left)
+ bytes += right->start - left->end;
+ }
+ while ((right = left));
}
+
sb->sacked_bytes = bytes;
}