tcp: fix entering closing state while in fast recovery 33/18233/5
authorFlorin Coras <fcoras@cisco.com>
Wed, 13 Mar 2019 03:37:09 +0000 (20:37 -0700)
committerDamjan Marion <dmarion@me.com>
Wed, 13 Mar 2019 08:23:55 +0000 (08:23 +0000)
Change-Id: I30470e8a1404632b0350056769338dc69a94c105
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/tcp/tcp_input.c

index c03c5db..0d75ba2 100644 (file)
@@ -1317,18 +1317,20 @@ tcp_do_fastretransmits (tcp_worker_ctx_t * wrk)
 
   for (i = 0; i < vec_len (ongoing_fast_rxt); i++)
     {
+      tc = tcp_connection_get (ongoing_fast_rxt[i], thread_index);
+      if (!tcp_in_fastrecovery (tc))
+       {
+         tc->flags &= ~TCP_CONN_FRXT_PENDING;
+         continue;
+       }
+
       if (n_segs >= VLIB_FRAME_SIZE)
        {
          vec_add1 (wrk->postponed_fast_rxt, ongoing_fast_rxt[i]);
          continue;
        }
 
-      tc = tcp_connection_get (ongoing_fast_rxt[i], thread_index);
       tc->flags &= ~TCP_CONN_FRXT_PENDING;
-
-      if (!tcp_in_fastrecovery (tc))
-       continue;
-
       burst_size = clib_min (max_burst_size, VLIB_FRAME_SIZE - n_segs);
       burst_bytes = transport_connection_tx_pacer_burst (&tc->connection,
                                                         last_cpu_time);
@@ -2959,6 +2961,14 @@ tcp46_rcv_process_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
              session_tx_fifo_dequeue_drop (&tc0->connection,
                                            transport_max_tx_dequeue
                                            (&tc0->connection));
+             /* Make it look as if we've recovered, if needed */
+             if (tcp_in_cong_recovery (tc0))
+               {
+                 scoreboard_clear (&tc0->sack_sb);
+                 tcp_fastrecovery_off (tc0);
+                 tcp_recovery_off (tc0);
+                 tc0->snd_nxt = tc0->snd_una_max = tc0->snd_una;
+               }
              tcp_send_fin (tc0);
            }
          else