tcp: cleanup scoreboard after recovery 34/22034/2
authorFlorin Coras <fcoras@cisco.com>
Fri, 13 Sep 2019 01:49:44 +0000 (18:49 -0700)
committerFlorin Coras <fcoras@cisco.com>
Fri, 13 Sep 2019 01:54:32 +0000 (18:54 -0700)
Type: fix

When recovering from congestion, remove last hole in scoreboard if it
covers all bytes sent above snd_congestion.

Change-Id: I752accd4590cd9bf553c35a1bb40a38c308c04f5
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/tcp/tcp_input.c

index 7ab7020..f4e1026 100755 (executable)
@@ -1298,7 +1298,14 @@ tcp_cc_is_spurious_retransmit (tcp_connection_t * tc)
 static int
 tcp_cc_recover (tcp_connection_t * tc)
 {
+  sack_scoreboard_hole_t *hole;
+
   ASSERT (tcp_in_cong_recovery (tc));
+
+  hole = scoreboard_first_hole (&tc->sack_sb);
+  if (hole && hole->start == tc->snd_una && hole->end == tc->snd_nxt)
+    scoreboard_clear (&tc->sack_sb);
+
   if (tcp_cc_is_spurious_retransmit (tc))
     {
       tcp_cc_congestion_undo (tc);