X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ftcp%2Ftcp.c;h=c30a69304bc31b4aa7668052e0c37f38570d6e9e;hb=1caf7f11c0197a912ccc28e67e4e9af75323af80;hp=7798009d2cd8981942a8fb4e2bff1ef74555a2d7;hpb=d50ff7fba167035b10def282b5ec166fa7899948;p=vpp.git diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 7798009d2cd..c30a69304bc 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -1064,7 +1064,6 @@ tcp_timer_waitclose_handler (tcp_connection_t * tc) static timer_expiration_handler *timer_expiration_handlers[TCP_N_TIMERS] = { tcp_timer_retransmit_handler, - tcp_timer_delack_handler, tcp_timer_persist_handler, tcp_timer_waitclose_handler, tcp_timer_retransmit_syn_handler, @@ -1096,6 +1095,13 @@ tcp_dispatch_pending_timers (tcp_worker_ctx_t * wrk) if (PREDICT_FALSE (!tc)) continue; + /* Skip if the timer is not pending. Probably it was reset while + * wating for dispatch */ + if (PREDICT_FALSE (!(tc->pending_timers & (1 << timer_id)))) + continue; + + tc->pending_timers &= ~(1 << timer_id); + /* Skip timer if it was rearmed while pending dispatch */ if (PREDICT_FALSE (tc->timers[timer_id] != TCP_TIMER_HANDLE_INVALID)) continue; @@ -1241,6 +1247,7 @@ tcp_expired_timers_dispatch (u32 * expired_timers) TCP_EVT (TCP_EVT_TIMER_POP, connection_index, timer_id); tc->timers[timer_id] = TCP_TIMER_HANDLE_INVALID; + tc->pending_timers |= (1 << timer_id); } clib_fifo_add (wrk->pending_timers, expired_timers, n_expired); @@ -1258,13 +1265,14 @@ tcp_expired_timers_dispatch (u32 * expired_timers) static void tcp_initialize_timer_wheels (tcp_main_t * tm) { + vlib_main_t *vm = vlib_get_main (); tw_timer_wheel_16t_2w_512sl_t *tw; /* *INDENT-OFF* */ foreach_vlib_main (({ tw = &tm->wrk_ctx[ii].timer_wheel; tw_timer_wheel_init_16t_2w_512sl (tw, tcp_expired_timers_dispatch, TCP_TIMER_TICK, ~0); - tw->last_run_time = vlib_time_now (this_vlib_main); + tw->last_run_time = vlib_time_now (vm); })); /* *INDENT-ON* */ } @@ -1421,7 +1429,7 @@ tcp_configuration_init (void) tcp_cfg.enable_tx_pacing = 1; tcp_cfg.allow_tso = 0; tcp_cfg.csum_offload = 1; - tcp_cfg.cc_algo = TCP_CC_NEWRENO; + tcp_cfg.cc_algo = TCP_CC_CUBIC; tcp_cfg.rwnd_min_update_ack = 1; /* Time constants defined as timer tick (100ms) multiples */