+ * Got 0 snd_wnd from peer, try to do something about it.
+ *
+ */
+void
+tcp_timer_persist_handler (u32 index)
+{
+ tcp_main_t *tm = vnet_get_tcp_main ();
+ vlib_main_t *vm = vlib_get_main ();
+ u32 thread_index = vlib_get_thread_index ();
+ tcp_connection_t *tc;
+ vlib_buffer_t *b;
+ u32 bi, n_bytes;
+
+ tc = tcp_connection_get (index, thread_index);
+
+ /* Make sure timer handle is set to invalid */
+ tc->timers[TCP_TIMER_PERSIST] = TCP_TIMER_HANDLE_INVALID;
+
+ /* Problem already solved or worse */
+ if (tc->snd_wnd > tc->snd_mss || tcp_in_recovery (tc))
+ return;
+
+ /* Increment RTO backoff */
+ tc->rto_boff += 1;
+ tc->rto = clib_min (tc->rto << 1, TCP_RTO_MAX);
+
+ /* Try to force the first unsent segment */
+ tcp_get_free_buffer_index (tm, &bi);
+ b = vlib_get_buffer (vm, bi);
+ n_bytes = stream_session_peek_bytes (&tc->connection,
+ vlib_buffer_get_current (b),
+ tc->snd_una_max - tc->snd_una,
+ tc->snd_mss);
+ /* Nothing to send */
+ if (n_bytes == 0)
+ {
+ tcp_return_buffer (tm);
+ return;
+ }
+
+ b->current_length = n_bytes;
+ tcp_push_hdr_i (tc, b, tc->state);
+ tcp_enqueue_to_output (vm, b, bi, tc->c_is_ip4);
+
+ /* Re-enable persist timer */
+ tcp_persist_timer_set (tc);
+}
+
+/**
+ * Retransmit first unacked segment
+ */