16 #ifndef SRC_VNET_TCP_TCP_TYPES_H_ 17 #define SRC_VNET_TCP_TCP_TYPES_H_ 25 #define TCP_TICK 0.001 26 #define THZ (u32) (1/TCP_TICK) 27 #define TCP_TSTAMP_RESOLUTION TCP_TICK 28 #define TCP_PAWS_IDLE 24 * 24 * 60 * 60 * THZ 29 #define TCP_FIB_RECHECK_PERIOD 1 * THZ 30 #define TCP_MAX_OPTION_SPACE 40 31 #define TCP_CC_DATA_SZ 24 32 #define TCP_MAX_GSO_SZ 65536 33 #define TCP_RXT_MAX_BURST 10 35 #define TCP_DUPACK_THRESHOLD 3 36 #define TCP_IW_N_SEGMENTS 10 37 #define TCP_ALWAYS_ACK 1 38 #define TCP_USE_SACKS 1 41 #define foreach_tcp_fsm_state \ 44 _(SYN_SENT, "SYN_SENT") \ 45 _(SYN_RCVD, "SYN_RCVD") \ 46 _(ESTABLISHED, "ESTABLISHED") \ 47 _(CLOSE_WAIT, "CLOSE_WAIT") \ 48 _(FIN_WAIT_1, "FIN_WAIT_1") \ 49 _(LAST_ACK, "LAST_ACK") \ 50 _(CLOSING, "CLOSING") \ 51 _(FIN_WAIT_2, "FIN_WAIT_2") \ 52 _(TIME_WAIT, "TIME_WAIT") 54 typedef enum _tcp_state
56 #define _(sym, str) TCP_STATE_##sym, 63 #define foreach_tcp_timer \ 64 _(RETRANSMIT, "RETRANSMIT") \ 65 _(DELACK, "DELAYED ACK") \ 66 _(PERSIST, "PERSIST") \ 67 _(WAITCLOSE, "WAIT CLOSE") \ 68 _(RETRANSMIT_SYN, "RETRANSMIT SYN") \ 70 typedef enum _tcp_timers
72 #define _(sym, str) TCP_TIMER_##sym, 78 #define TCP_TIMER_HANDLE_INVALID ((u32) ~0) 80 #define TCP_TIMER_TICK 0.1 81 #define TCP_TO_TIMER_TICK TCP_TICK*10 84 #define TCP_RTO_MAX 60 * THZ 85 #define TCP_RTO_MIN 0.2 * THZ 86 #define TCP_RTT_MAX 30 * THZ 87 #define TCP_RTO_SYN_RETRIES 3 88 #define TCP_RTO_INIT 1 * THZ 89 #define TCP_RTO_BOFF_MAX 8 90 #define TCP_ESTABLISH_TIME (60 * THZ) 93 #define foreach_tcp_cfg_flag \ 94 _(RATE_SAMPLE, "Rate sampling") \ 95 _(NO_CSUM_OFFLOAD, "No csum offload") \ 96 _(NO_TSO, "TSO off") \ 98 _(NO_ENDPOINT,"No endpoint") \ 102 #define _(sym, str) TCP_CFG_F_##sym##_BIT, 110 #define _(sym, str) TCP_CFG_F_##sym = 1 << TCP_CFG_F_##sym##_BIT, 117 #define foreach_tcp_connection_flag \ 118 _(SNDACK, "Send ACK") \ 119 _(FINSNT, "FIN sent") \ 120 _(RECOVERY, "Recovery") \ 121 _(FAST_RECOVERY, "Fast Recovery") \ 122 _(DCNT_PENDING, "Disconnect pending") \ 123 _(HALF_OPEN_DONE, "Half-open completed") \ 124 _(FINPNDG, "FIN pending") \ 125 _(RXT_PENDING, "Retransmit pending") \ 126 _(FRXT_FIRST, "Retransmit first") \ 127 _(DEQ_PENDING, "Dequeue pending ") \ 128 _(PSH_PENDING, "PSH pending") \ 129 _(FINRCVD, "FIN received") \ 130 _(ZERO_RWND_SENT, "Zero RWND sent") \ 134 #define _(sym, str) TCP_CONN_##sym##_BIT, 142 #define _(sym, str) TCP_CONN_##sym = 1 << TCP_CONN_##sym##_BIT, 148 #define TCP_SCOREBOARD_TRACE (0) 149 #define TCP_MAX_SACK_BLOCKS 255 150 #define TCP_INVALID_SACK_HOLE_INDEX ((u32)~0) 152 typedef struct _scoreboard_trace_elt
161 typedef struct _sack_scoreboard_hole
170 typedef struct _sack_scoreboard
176 u32 last_sacked_bytes;
177 u32 last_bytes_delivered;
187 #if TCP_SCOREBOARD_TRACE 193 #define TCP_BTS_INVALID_INDEX ((u32)~0) 243 typedef enum _tcp_cc_algorithm_type
252 typedef enum _tcp_cc_ack_t
275 typedef struct _tcp_connection
315 u32 tsval_recent_age;
366 u32 next_node_opaque;
367 u32 limited_transmit;
386 #define rst_state snd_wl1 390 struct _tcp_cc_algorithm
408 #define tcp_fastrecovery_on(tc) (tc)->flags |= TCP_CONN_FAST_RECOVERY 409 #define tcp_fastrecovery_off(tc) (tc)->flags &= ~TCP_CONN_FAST_RECOVERY 410 #define tcp_recovery_on(tc) (tc)->flags |= TCP_CONN_RECOVERY 411 #define tcp_recovery_off(tc) (tc)->flags &= ~TCP_CONN_RECOVERY 412 #define tcp_in_fastrecovery(tc) ((tc)->flags & TCP_CONN_FAST_RECOVERY) 413 #define tcp_in_recovery(tc) ((tc)->flags & (TCP_CONN_RECOVERY)) 414 #define tcp_in_slowstart(tc) (tc->cwnd < tc->ssthresh) 415 #define tcp_disconnect_pending(tc) ((tc)->flags & TCP_CONN_DCNT_PENDING) 416 #define tcp_disconnect_pending_on(tc) ((tc)->flags |= TCP_CONN_DCNT_PENDING) 417 #define tcp_disconnect_pending_off(tc) ((tc)->flags &= ~TCP_CONN_DCNT_PENDING) 418 #define tcp_fastrecovery_first(tc) ((tc)->flags & TCP_CONN_FRXT_FIRST) 419 #define tcp_fastrecovery_first_on(tc) ((tc)->flags |= TCP_CONN_FRXT_FIRST) 420 #define tcp_fastrecovery_first_off(tc) ((tc)->flags &= ~TCP_CONN_FRXT_FIRST) 422 #define tcp_in_cong_recovery(tc) ((tc)->flags & \ 423 (TCP_CONN_FAST_RECOVERY | TCP_CONN_RECOVERY)) 428 tc->flags &= ~(TCP_CONN_FAST_RECOVERY | TCP_CONN_RECOVERY);
432 #define tcp_csum_offload(tc) (!((tc)->cfg_flags & TCP_CFG_F_NO_CSUM_OFFLOAD)) 434 #define tcp_zero_rwnd_sent(tc) ((tc)->flags & TCP_CONN_ZERO_RWND_SENT) 435 #define tcp_zero_rwnd_sent_on(tc) (tc)->flags |= TCP_CONN_ZERO_RWND_SENT 436 #define tcp_zero_rwnd_sent_off(tc) (tc)->flags &= ~TCP_CONN_ZERO_RWND_SENT
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
enum tcp_connection_flag_ tcp_connection_flags_e
struct _sack_block sack_block_t
enum tcp_cfg_flag_ tcp_cfg_flags_e
struct tcp_rate_sample_ tcp_rate_sample_t
#define tcp_fastrecovery_first_off(tc)
struct _tcp_connection tcp_connection_t
enum tcp_bts_flags_ tcp_bts_flags_t
enum tcp_connection_flag_bits_ tcp_connection_flag_bits_e
struct _sack_scoreboard sack_scoreboard_t
enum _tcp_cc_ack_t tcp_cc_ack_t
struct _tcp_cc_algorithm tcp_cc_algorithm_t
struct tcp_bt_sample_ tcp_bt_sample_t
vl_api_interface_index_t sw_if_index
enum tcp_cfg_flag_bits_ tcp_cfg_flag_bits_e
enum _tcp_timers tcp_timers_e
#define foreach_tcp_connection_flag
TCP connection flags.
#define foreach_tcp_fsm_state
TCP FSM state definitions as per RFC793.
tw_timer_wheel_16t_2w_512sl_t tcp_timer_wheel_t
static void cleanup(void)
#define foreach_tcp_cfg_flag
Connection configuration flags.
struct _transport_connection transport_connection_t
tcp_connection_flag_bits_
static void tcp_cong_recovery_off(tcp_connection_t *tc)
struct _sack_scoreboard_hole sack_scoreboard_hole_t
struct tcp_byte_tracker_ tcp_byte_tracker_t
enum _tcp_cc_algorithm_type tcp_cc_algorithm_type_e
enum tcp_cc_event_ tcp_cc_event_t
vl_api_dhcp_client_state_t state
f64 end
end of the time range
struct _scoreboard_trace_elt scoreboard_trace_elt_t
struct tcp_errors_ tcp_errors_t
static tcp_connection_t * tcp_get_connection_from_transport(transport_connection_t *tconn)
enum _tcp_state tcp_state_t
#define foreach_tcp_timer
TCP timers.