#undef _
} tcp_wrk_stats_t;
+typedef struct tcp_free_req_
+{
+ clib_time_type_t free_time;
+ u32 connection_index;
+} tcp_cleanup_req_t;
+
typedef struct tcp_worker_ctx_
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* Fifo of pending timer expirations */
u32 *pending_timers;
+ /* fifo of pending free requests */
+ tcp_cleanup_req_t *pending_cleanups;
+
/** worker timer wheel */
tw_timer_wheel_16t_2w_512sl_t timer_wheel;
/** Timer ticks to wait in closing for fin ack */
u16 closing_time;
- /** Timer ticks to wait before cleaning up the connection */
- u16 cleanup_time;
+ /** Time to wait (sec) before cleaning up the connection */
+ f32 cleanup_time;
/** Number of preallocated connections */
u32 preallocated_connections;
return available_wnd - flight_size;
}
+static inline u8
+tcp_is_descheduled (tcp_connection_t * tc)
+{
+ return (transport_connection_is_descheduled (&tc->connection) ? 1 : 0);
+}
+
always_inline u8
tcp_is_lost_fin (tcp_connection_t * tc)
{
u32 tcp_snd_space (tcp_connection_t * tc);
int tcp_fastrecovery_prr_snd_space (tcp_connection_t * tc);
+void tcp_reschedule (tcp_connection_t * tc);
fib_node_index_t tcp_lookup_rmt_in_fib (tcp_connection_t * tc);
void tcp_connection_tx_pacer_update (tcp_connection_t * tc);
void tcp_connection_tx_pacer_reset (tcp_connection_t * tc, u32 window,
u32 start_bucket);
+void tcp_program_cleanup (tcp_worker_ctx_t * wrk, tcp_connection_t * tc);
always_inline void
tcp_cc_rcv_ack (tcp_connection_t * tc, tcp_rate_sample_t * rs)
void newreno_rcv_cong_ack (tcp_connection_t * tc, tcp_cc_ack_t ack_type,
tcp_rate_sample_t * rs);
+/**
+ * Initialize connection by gleaning network and rcv params from buffer
+ *
+ * @param tc connection to initialize
+ * @param b buffer whose current data is pointing at ip
+ * @param is_ip4 flag set to 1 if using ip4
+ */
+void tcp_init_w_buffer (tcp_connection_t * tc, vlib_buffer_t * b, u8 is_ip4);
/**
* Push TCP header to buffer