X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ftcp%2Ftcp.h;h=8f2665d2a6a0e90ae11f543603dcab3496ea9fd6;hb=26dd6de91b4d36ac04154c7eb6339684db6684a0;hp=f2626af9da8a7ad81052562cdf000db7987e6ad7;hpb=eff6b82e905f39aa740db38341626d8d615282fa;p=vpp.git diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h index f2626af9da8..8f2665d2a6a 100644 --- a/src/vnet/tcp/tcp.h +++ b/src/vnet/tcp/tcp.h @@ -183,6 +183,7 @@ typedef struct _sack_scoreboard u32 high_rxt; /**< Highest retransmitted sequence */ u32 rescue_rxt; /**< Rescue sequence number */ u32 lost_bytes; /**< Bytes lost as per RFC6675 */ + u32 last_lost_bytes; /**< Number of bytes last lost */ u32 cur_rxt_hole; /**< Retransmitting from this hole */ #if TCP_SCOREBOARD_TRACE @@ -248,18 +249,24 @@ typedef struct tcp_bt_sample_ u32 prev; /**< Previous sample index in list */ u32 min_seq; /**< Min seq number in sample */ u32 max_seq; /**< Max seq number. Set for rxt samples */ - u64 delivered; /**< Total delivered when sample taken */ + u64 delivered; /**< Total delivered bytes for sample */ f64 delivered_time; /**< Delivered time when sample taken */ + f64 tx_time; /**< Transmit time for the burst */ u64 tx_rate; /**< Tx pacing rate */ tcp_bts_flags_t flags; /**< Sample flag */ } tcp_bt_sample_t; typedef struct tcp_rate_sample_ { - u64 sample_delivered; /**< Delivered of sample used for rate */ - u32 delivered; /**< Bytes delivered in ack time */ - f64 ack_time; /**< Time to ack the bytes delivered */ + u64 prior_delivered; /**< Delivered of sample used for rate, i.e., + total bytes delivered at prior_time */ + f64 prior_time; /**< Delivered time of sample used for rate */ + f64 interval_time; /**< Time to ack the bytes delivered */ + f64 rtt_time; /**< RTT for sample */ u64 tx_rate; /**< Tx pacing rate */ + u32 delivered; /**< Bytes delivered in interval_time */ + u32 acked_and_sacked; /**< Bytes acked + sacked now */ + u32 lost; /**< Bytes lost now */ tcp_bts_flags_t flags; /**< Rate sample flags from bt sample */ } tcp_rate_sample_t; @@ -288,6 +295,11 @@ typedef enum _tcp_cc_ack_t TCP_CC_PARTIALACK } tcp_cc_ack_t; +typedef enum tcp_cc_event_ +{ + TCP_CC_EVT_START_TX, +} tcp_cc_event_t; + typedef struct _tcp_connection { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); @@ -372,6 +384,7 @@ typedef struct _tcp_connection u32 last_fib_check; /**< Last time we checked fib route for peer */ u16 mss; /**< Our max seg size that includes options */ + u32 timestamp_delta; } tcp_connection_t; /* *INDENT-OFF* */ @@ -388,6 +401,7 @@ struct _tcp_cc_algorithm void (*loss) (tcp_connection_t * tc); void (*recovered) (tcp_connection_t * tc); void (*undo_recovery) (tcp_connection_t * tc); + void (*event) (tcp_connection_t *tc, tcp_cc_event_t evt); }; /* *INDENT-ON* */ @@ -450,21 +464,9 @@ typedef struct tcp_worker_ctx_ /** tx frames for ip 4/6 lookup nodes */ vlib_frame_t *ip_lookup_tx_frames[2]; - /** vector of connections needing fast rxt */ - u32 *pending_fast_rxt; - - /** vector of connections now doing fast rxt */ - u32 *ongoing_fast_rxt; - - /** vector of connections that will do fast rxt */ - u32 *postponed_fast_rxt; - /** vector of pending ack dequeues */ u32 *pending_deq_acked; - /** vector of pending acks */ - u32 *pending_acks; - /** vector of pending disconnect notifications */ u32 *pending_disconnects; @@ -686,15 +688,12 @@ void tcp_update_burst_snd_vars (tcp_connection_t * tc); void tcp_update_rto (tcp_connection_t * tc); void tcp_flush_frame_to_output (tcp_worker_ctx_t * wrk, u8 is_ip4); void tcp_flush_frames_to_output (tcp_worker_ctx_t * wrk); -void tcp_program_fastretransmit (tcp_worker_ctx_t * wrk, - tcp_connection_t * tc); -void tcp_do_fastretransmits (tcp_worker_ctx_t * wrk); - -void tcp_program_ack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc); -void tcp_program_dupack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc); -void tcp_send_acks (tcp_worker_ctx_t * wrk); void tcp_send_window_update_ack (tcp_connection_t * tc); +void tcp_program_ack (tcp_connection_t * tc); +void tcp_program_dupack (tcp_connection_t * tc); +void tcp_program_fastretransmit (tcp_connection_t * tc); + /* * Rate estimation */ @@ -922,6 +921,16 @@ tcp_time_now_w_thread (u32 thread_index) return tcp_main.wrk_ctx[thread_index].time_now; } +/** + * Generate timestamp for tcp connection + */ +always_inline u32 +tcp_tstamp (tcp_connection_t * tc) +{ + return (tcp_main.wrk_ctx[tc->c_thread_index].time_now - + tc->timestamp_delta); +} + always_inline f64 tcp_time_now_us (u32 thread_index) { @@ -937,6 +946,7 @@ tcp_set_time_now (tcp_worker_ctx_t * wrk) u32 tcp_session_push_header (transport_connection_t * tconn, vlib_buffer_t * b); +int tcp_session_custom_tx (void *conn, u32 max_burst_size); void tcp_connection_timers_init (tcp_connection_t * tc); void tcp_connection_timers_reset (tcp_connection_t * tc); @@ -979,6 +989,13 @@ tcp_cc_undo_recovery (tcp_connection_t * tc) tc->cc_algo->undo_recovery (tc); } +static inline void +tcp_cc_event (tcp_connection_t * tc, tcp_cc_event_t evt) +{ + if (tc->cc_algo->event) + tc->cc_algo->event (tc, evt); +} + always_inline void tcp_timer_set (tcp_connection_t * tc, u8 timer_id, u32 interval) {