From aa04395573f26fe420d7eb9ca329732b7197fe52 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 8 Oct 2020 13:33:20 -0700 Subject: [PATCH] tcp: treat pending timers as active Type: fix Signed-off-by: Florin Coras Change-Id: Ic63af51fab8dbefe79439554ea563f20e3788afa --- src/vnet/tcp/tcp.c | 2 +- src/vnet/tcp/tcp_timer.h | 3 ++- src/vnet/tcp/tcp_types.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 5ebb63802d7..d4da601f655 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -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; diff --git a/src/vnet/tcp/tcp_timer.h b/src/vnet/tcp/tcp_timer.h index f604152cdf9..06322a27d7e 100644 --- a/src/vnet/tcp/tcp_timer.h +++ b/src/vnet/tcp/tcp_timer.h @@ -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 diff --git a/src/vnet/tcp/tcp_types.h b/src/vnet/tcp/tcp_types.h index 95d5b73a91d..0ffc036dc39 100644 --- a/src/vnet/tcp/tcp_types.h +++ b/src/vnet/tcp/tcp_types.h @@ -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) -- 2.16.6