- if (preallocated_connections_per_thread)
- pool_init_fixed (tm->connections[thread],
- preallocated_connections_per_thread);
+ vec_validate (tm->wrk_ctx[thread].pending_fast_rxt, 255);
+ vec_validate (tm->wrk_ctx[thread].ongoing_fast_rxt, 255);
+ vec_validate (tm->wrk_ctx[thread].postponed_fast_rxt, 255);
+ vec_validate (tm->wrk_ctx[thread].pending_deq_acked, 255);
+ vec_validate (tm->wrk_ctx[thread].pending_acks, 255);
+ vec_validate (tm->wrk_ctx[thread].pending_disconnects, 255);
+ vec_reset_length (tm->wrk_ctx[thread].pending_fast_rxt);
+ vec_reset_length (tm->wrk_ctx[thread].ongoing_fast_rxt);
+ vec_reset_length (tm->wrk_ctx[thread].postponed_fast_rxt);
+ vec_reset_length (tm->wrk_ctx[thread].pending_deq_acked);
+ vec_reset_length (tm->wrk_ctx[thread].pending_acks);
+ vec_reset_length (tm->wrk_ctx[thread].pending_disconnects);
+ tm->wrk_ctx[thread].vm = vlib_mains[thread];
+
+ /*
+ * Preallocate connections. Assume that thread 0 won't
+ * use preallocated threads when running multi-core
+ */
+ if ((thread > 0 || num_threads == 1) && prealloc_conn_per_wrk)
+ pool_init_fixed (tm->connections[thread], prealloc_conn_per_wrk);