16 #ifndef SRC_VNET_TCP_TCP_TYPES_H_ 17 #define SRC_VNET_TCP_TCP_TYPES_H_ 25 #define TCP_TICK 0.000001 26 #define THZ (u32) (1/TCP_TICK) 28 #define TCP_TSTP_TICK 0.001 29 #define TCP_TSTP_HZ (u32) (1/TCP_TSTP_TICK) 30 #define TCP_PAWS_IDLE (24 * 86400 * TCP_TSTP_HZ) 31 #define TCP_TSTP_TO_HZ (u32) (TCP_TSTP_TICK * THZ) 33 #define TCP_FIB_RECHECK_PERIOD 1 * THZ 34 #define TCP_MAX_OPTION_SPACE 40 35 #define TCP_CC_DATA_SZ 24 36 #define TCP_MAX_GSO_SZ 65536 37 #define TCP_RXT_MAX_BURST 10 39 #define TCP_DUPACK_THRESHOLD 3 40 #define TCP_IW_N_SEGMENTS 10 41 #define TCP_ALWAYS_ACK 1 42 #define TCP_USE_SACKS 1 45 #define foreach_tcp_fsm_state \ 48 _(SYN_SENT, "SYN_SENT") \ 49 _(SYN_RCVD, "SYN_RCVD") \ 50 _(ESTABLISHED, "ESTABLISHED") \ 51 _(CLOSE_WAIT, "CLOSE_WAIT") \ 52 _(FIN_WAIT_1, "FIN_WAIT_1") \ 53 _(LAST_ACK, "LAST_ACK") \ 54 _(CLOSING, "CLOSING") \ 55 _(FIN_WAIT_2, "FIN_WAIT_2") \ 56 _(TIME_WAIT, "TIME_WAIT") 58 typedef enum _tcp_state
60 #define _(sym, str) TCP_STATE_##sym, 67 #define foreach_tcp_timer \ 68 _(RETRANSMIT, "RETRANSMIT") \ 69 _(PERSIST, "PERSIST") \ 70 _(WAITCLOSE, "WAIT CLOSE") \ 71 _(RETRANSMIT_SYN, "RETRANSMIT SYN") \ 73 typedef enum _tcp_timers
75 #define _(sym, str) TCP_TIMER_##sym, 81 #define TCP_TIMER_HANDLE_INVALID ((u32) ~0) 83 #define TCP_TIMER_TICK 0.1 84 #define TCP_TO_TIMER_TICK TCP_TICK*10 87 #define TCP_RTO_MAX 60 * THZ 88 #define TCP_RTO_MIN 0.2 * THZ 89 #define TCP_RTT_MAX 30 * THZ 90 #define TCP_RTO_SYN_RETRIES 3 91 #define TCP_RTO_INIT 1 * THZ 92 #define TCP_RTO_BOFF_MAX 8 93 #define TCP_ESTABLISH_TIME (60 * THZ) 96 #define foreach_tcp_cfg_flag \ 97 _(RATE_SAMPLE, "Rate sampling") \ 98 _(NO_CSUM_OFFLOAD, "No csum offload") \ 99 _(NO_TSO, "TSO off") \ 101 _(NO_ENDPOINT,"No endpoint") \ 105 #define _(sym, str) TCP_CFG_F_##sym##_BIT, 113 #define _(sym, str) TCP_CFG_F_##sym = 1 << TCP_CFG_F_##sym##_BIT, 120 #define foreach_tcp_connection_flag \ 121 _(SNDACK, "Send ACK") \ 122 _(FINSNT, "FIN sent") \ 123 _(RECOVERY, "Recovery") \ 124 _(FAST_RECOVERY, "Fast Recovery") \ 125 _(DCNT_PENDING, "Disconnect pending") \ 126 _(HALF_OPEN_DONE, "Half-open completed") \ 127 _(FINPNDG, "FIN pending") \ 128 _(RXT_PENDING, "Retransmit pending") \ 129 _(FRXT_FIRST, "Retransmit first") \ 130 _(DEQ_PENDING, "Dequeue pending ") \ 131 _(PSH_PENDING, "PSH pending") \ 132 _(FINRCVD, "FIN received") \ 133 _(ZERO_RWND_SENT, "Zero RWND sent") \ 137 #define _(sym, str) TCP_CONN_##sym##_BIT, 145 #define _(sym, str) TCP_CONN_##sym = 1 << TCP_CONN_##sym##_BIT, 151 #define TCP_SCOREBOARD_TRACE (0) 152 #define TCP_MAX_SACK_BLOCKS 255 153 #define TCP_INVALID_SACK_HOLE_INDEX ((u32)~0) 154 #define TCP_MAX_SACK_REORDER 300 156 typedef struct _scoreboard_trace_elt
165 typedef struct _sack_scoreboard_hole
174 typedef struct _sack_scoreboard
180 u32 last_sacked_bytes;
181 u32 last_bytes_delivered;
192 #if TCP_SCOREBOARD_TRACE 198 #define TCP_BTS_INVALID_INDEX ((u32)~0) 248 typedef enum _tcp_cc_algorithm_type
257 typedef enum _tcp_cc_ack_t
280 typedef struct _tcp_connection
321 u32 tsval_recent_age;
372 u32 next_node_opaque;
373 u32 limited_transmit;
392 #define rst_state snd_wl1 396 struct _tcp_cc_algorithm
414 #define tcp_fastrecovery_on(tc) (tc)->flags |= TCP_CONN_FAST_RECOVERY 415 #define tcp_fastrecovery_off(tc) (tc)->flags &= ~TCP_CONN_FAST_RECOVERY 416 #define tcp_recovery_on(tc) (tc)->flags |= TCP_CONN_RECOVERY 417 #define tcp_recovery_off(tc) (tc)->flags &= ~TCP_CONN_RECOVERY 418 #define tcp_in_fastrecovery(tc) ((tc)->flags & TCP_CONN_FAST_RECOVERY) 419 #define tcp_in_recovery(tc) ((tc)->flags & (TCP_CONN_RECOVERY)) 420 #define tcp_in_slowstart(tc) (tc->cwnd < tc->ssthresh) 421 #define tcp_disconnect_pending(tc) ((tc)->flags & TCP_CONN_DCNT_PENDING) 422 #define tcp_disconnect_pending_on(tc) ((tc)->flags |= TCP_CONN_DCNT_PENDING) 423 #define tcp_disconnect_pending_off(tc) ((tc)->flags &= ~TCP_CONN_DCNT_PENDING) 424 #define tcp_fastrecovery_first(tc) ((tc)->flags & TCP_CONN_FRXT_FIRST) 425 #define tcp_fastrecovery_first_on(tc) ((tc)->flags |= TCP_CONN_FRXT_FIRST) 426 #define tcp_fastrecovery_first_off(tc) ((tc)->flags &= ~TCP_CONN_FRXT_FIRST) 428 #define tcp_in_cong_recovery(tc) ((tc)->flags & \ 429 (TCP_CONN_FAST_RECOVERY | TCP_CONN_RECOVERY)) 434 tc->flags &= ~(TCP_CONN_FAST_RECOVERY | TCP_CONN_RECOVERY);
438 #define tcp_csum_offload(tc) (!((tc)->cfg_flags & TCP_CFG_F_NO_CSUM_OFFLOAD)) 440 #define tcp_zero_rwnd_sent(tc) ((tc)->flags & TCP_CONN_ZERO_RWND_SENT) 441 #define tcp_zero_rwnd_sent_on(tc) (tc)->flags |= TCP_CONN_ZERO_RWND_SENT 442 #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
vl_api_wireguard_peer_flags_t flags
enum tcp_cfg_flag_ tcp_cfg_flags_e
static u32 * pending_timers
Vector of pending timers.
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
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
vl_api_interface_index_t sw_if_index
#define foreach_tcp_timer
TCP timers.