tcp: update snd_una_max for retranmsits 23/13323/2
authorFlorin Coras <fcoras@cisco.com>
Mon, 2 Jul 2018 08:30:51 +0000 (01:30 -0700)
committerDamjan Marion <dmarion@me.com>
Tue, 3 Jul 2018 09:17:33 +0000 (09:17 +0000)
Change-Id: I0573d0aff39581bba96e610228a10ae923a8ca06
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vnet/session/session.c
src/vnet/tcp/tcp_output.c
src/vppinfra/tw_timer_template.c

index e486c2b..7131f51 100644 (file)
@@ -459,9 +459,7 @@ session_enqueue_notify (stream_session_t * s, u8 block)
       return 0;
     }
 
-  /* Get session's server */
   app = application_get_if_valid (s->app_index);
-
   if (PREDICT_FALSE (app == 0))
     {
       clib_warning ("invalid s->app_index = %d", s->app_index);
@@ -509,7 +507,10 @@ session_dequeue_notify (stream_session_t * s)
   application_t *app;
   svm_queue_t *q;
 
-  app = application_get (s->app_index);
+  app = application_get_if_valid (s->app_index);
+  if (PREDICT_FALSE (!app))
+    return -1;
+
   if (application_is_builtin (app))
     return 0;
 
index 7c11345..b3c39b1 100644 (file)
@@ -1306,6 +1306,8 @@ tcp_prepare_retransmit_segment (tcp_connection_t * tc, u32 offset,
       ASSERT (n_bytes == max_deq_bytes);
       b[0]->current_length = n_bytes;
       tcp_push_hdr_i (tc, *b, tc->state, /* compute opts */ 0, /* burst */ 0);
+      if (seq_gt (tc->snd_nxt, tc->snd_una_max))
+       tc->snd_una_max = tc->snd_nxt;
     }
   /* Split mss into multiple buffers */
   else
@@ -1369,6 +1371,8 @@ tcp_prepare_retransmit_segment (tcp_connection_t * tc, u32 offset,
        }
 
       tcp_push_hdr_i (tc, *b, tc->state, /* compute opts */ 0, /* burst */ 0);
+      if (seq_gt (tc->snd_nxt, tc->snd_una_max))
+       tc->snd_una_max = tc->snd_nxt;
     }
 
   ASSERT (n_bytes > 0);
index da40e2c..c96c329 100644 (file)
@@ -157,7 +157,7 @@ timer_remove (TWT (tw_timer) * pool, TWT (tw_timer) * elt)
   elt->prev = elt->next = ~0;
 }
 
-static void
+static inline void
 timer_add (TWT (tw_timer_wheel) * tw, TWT (tw_timer) * t, u64 interval)
 {
 #if TW_TIMER_WHEELS > 1