tcp: treat pending timers as active 59/29359/4
authorFlorin Coras <fcoras@cisco.com>
Thu, 8 Oct 2020 20:33:20 +0000 (13:33 -0700)
committerDave Barach <openvpp@barachs.net>
Thu, 8 Oct 2020 22:13:36 +0000 (22:13 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ic63af51fab8dbefe79439554ea563f20e3788afa

src/vnet/tcp/tcp.c
src/vnet/tcp/tcp_timer.h
src/vnet/tcp/tcp_types.h

index 5ebb638..d4da601 100644 (file)
@@ -1101,7 +1101,7 @@ tcp_dispatch_pending_timers (tcp_worker_ctx_t * wrk)
        continue;
 
       /* Skip if the timer is not pending. Probably it was reset while
-       * wating for dispatch */
+       * waiting for dispatch */
       if (PREDICT_FALSE (!(tc->pending_timers & (1 << timer_id))))
        continue;
 
index f604152..06322a2 100644 (file)
@@ -117,7 +117,8 @@ tcp_retransmit_timer_update (tcp_timer_wheel_t * tw, tcp_connection_t * tc)
 always_inline u8
 tcp_timer_is_active (tcp_connection_t * tc, tcp_timers_e timer)
 {
-  return tc->timers[timer] != TCP_TIMER_HANDLE_INVALID;
+  return tc->timers[timer] != TCP_TIMER_HANDLE_INVALID
+    || (tc->pending_timers & (1 << timer));
 }
 
 always_inline void
index 95d5b73..0ffc036 100644 (file)
@@ -75,7 +75,7 @@ typedef enum _tcp_timers
   foreach_tcp_timer
 #undef _
   TCP_N_TIMERS
-} tcp_timers_e;
+} __clib_packed tcp_timers_e;
 
 #define TCP_TIMER_HANDLE_INVALID ((u32) ~0)