FD.io VPP  v20.05-21-gb1500e9ff
Vector Packet Processing
tcp_types.h File Reference
+ Include dependency graph for tcp_types.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tcp_bt_sample_
 
struct  tcp_rate_sample_
 
struct  tcp_byte_tracker_
 
struct  tcp_errors_
 

Macros

#define TCP_TICK   0.001
 TCP tick period (s) More...
 
#define THZ   (u32) (1/TCP_TICK)
 TCP tick frequency. More...
 
#define TCP_TSTAMP_RESOLUTION   TCP_TICK
 Time stamp resolution. More...
 
#define TCP_PAWS_IDLE   24 * 24 * 60 * 60 * THZ
 24 days More...
 
#define TCP_FIB_RECHECK_PERIOD   1 * THZ
 Recheck every 1s. More...
 
#define TCP_MAX_OPTION_SPACE   40
 
#define TCP_CC_DATA_SZ   24
 
#define TCP_MAX_GSO_SZ   65536
 
#define TCP_RXT_MAX_BURST   10
 
#define TCP_DUPACK_THRESHOLD   3
 
#define TCP_IW_N_SEGMENTS   10
 
#define TCP_ALWAYS_ACK   1
 On/off delayed acks. More...
 
#define TCP_USE_SACKS   1
 Disable only for testing. More...
 
#define foreach_tcp_fsm_state
 TCP FSM state definitions as per RFC793. More...
 
#define foreach_tcp_timer
 TCP timers. More...
 
#define TCP_TIMER_HANDLE_INVALID   ((u32) ~0)
 
#define TCP_TIMER_TICK   0.1
 Timer tick in seconds. More...
 
#define TCP_TO_TIMER_TICK   TCP_TICK*10
 Factor for converting ticks to timer ticks. More...
 
#define TCP_RTO_MAX   60 * THZ /* Min max RTO (60s) as per RFC6298 */
 
#define TCP_RTO_MIN   0.2 * THZ /* Min RTO (200ms) - lower than standard */
 
#define TCP_RTT_MAX   30 * THZ /* 30s (probably too much) */
 
#define TCP_RTO_SYN_RETRIES   3 /* SYN retries without doubling RTO */
 
#define TCP_RTO_INIT   1 * THZ /* Initial retransmit timer */
 
#define TCP_RTO_BOFF_MAX   8 /* Max number of retries before reset */
 
#define TCP_ESTABLISH_TIME   (60 * THZ) /* Connection establish timeout */
 
#define foreach_tcp_cfg_flag
 Connection configuration flags. More...
 
#define foreach_tcp_connection_flag
 TCP connection flags. More...
 
#define TCP_SCOREBOARD_TRACE   (0)
 
#define TCP_MAX_SACK_BLOCKS   255
 Max number of SACK blocks stored. More...
 
#define TCP_INVALID_SACK_HOLE_INDEX   ((u32)~0)
 
#define TCP_BTS_INVALID_INDEX   ((u32)~0)
 
#define rst_state   snd_wl1
 
#define tcp_fastrecovery_on(tc)   (tc)->flags |= TCP_CONN_FAST_RECOVERY
 
#define tcp_fastrecovery_off(tc)   (tc)->flags &= ~TCP_CONN_FAST_RECOVERY
 
#define tcp_recovery_on(tc)   (tc)->flags |= TCP_CONN_RECOVERY
 
#define tcp_recovery_off(tc)   (tc)->flags &= ~TCP_CONN_RECOVERY
 
#define tcp_in_fastrecovery(tc)   ((tc)->flags & TCP_CONN_FAST_RECOVERY)
 
#define tcp_in_recovery(tc)   ((tc)->flags & (TCP_CONN_RECOVERY))
 
#define tcp_in_slowstart(tc)   (tc->cwnd < tc->ssthresh)
 
#define tcp_disconnect_pending(tc)   ((tc)->flags & TCP_CONN_DCNT_PENDING)
 
#define tcp_disconnect_pending_on(tc)   ((tc)->flags |= TCP_CONN_DCNT_PENDING)
 
#define tcp_disconnect_pending_off(tc)   ((tc)->flags &= ~TCP_CONN_DCNT_PENDING)
 
#define tcp_fastrecovery_first(tc)   ((tc)->flags & TCP_CONN_FRXT_FIRST)
 
#define tcp_fastrecovery_first_on(tc)   ((tc)->flags |= TCP_CONN_FRXT_FIRST)
 
#define tcp_fastrecovery_first_off(tc)   ((tc)->flags &= ~TCP_CONN_FRXT_FIRST)
 
#define tcp_in_cong_recovery(tc)
 
#define tcp_csum_offload(tc)   (!((tc)->cfg_flags & TCP_CFG_F_NO_CSUM_OFFLOAD))
 
#define tcp_zero_rwnd_sent(tc)   ((tc)->flags & TCP_CONN_ZERO_RWND_SENT)
 
#define tcp_zero_rwnd_sent_on(tc)   (tc)->flags |= TCP_CONN_ZERO_RWND_SENT
 
#define tcp_zero_rwnd_sent_off(tc)   (tc)->flags &= ~TCP_CONN_ZERO_RWND_SENT
 

Typedefs

typedef enum _tcp_state tcp_state_t
 
typedef enum _tcp_timers tcp_timers_e
 
typedef enum tcp_cfg_flag_bits_ tcp_cfg_flag_bits_e
 
typedef enum tcp_cfg_flag_ tcp_cfg_flags_e
 
typedef enum tcp_connection_flag_bits_ tcp_connection_flag_bits_e
 
typedef enum tcp_connection_flag_ tcp_connection_flags_e
 
typedef struct _scoreboard_trace_elt scoreboard_trace_elt_t
 
typedef struct _sack_scoreboard_hole sack_scoreboard_hole_t
 
typedef struct _sack_scoreboard sack_scoreboard_t
 
typedef enum tcp_bts_flags_ tcp_bts_flags_t
 
typedef struct tcp_bt_sample_ tcp_bt_sample_t
 
typedef struct tcp_rate_sample_ tcp_rate_sample_t
 
typedef struct tcp_byte_tracker_ tcp_byte_tracker_t
 
typedef enum _tcp_cc_algorithm_type tcp_cc_algorithm_type_e
 
typedef struct _tcp_cc_algorithm tcp_cc_algorithm_t
 
typedef enum _tcp_cc_ack_t tcp_cc_ack_t
 
typedef enum tcp_cc_event_ tcp_cc_event_t
 
typedef struct tcp_errors_ tcp_errors_t
 
typedef struct _tcp_connection tcp_connection_t
 
typedef tw_timer_wheel_16t_2w_512sl_t tcp_timer_wheel_t
 

Enumerations

enum  tcp_cfg_flag_bits_ { TCP_CFG_N_FLAG_BITS }
 
enum  tcp_cfg_flag_ { TCP_CFG_N_FLAGS }
 
enum  tcp_connection_flag_bits_ { TCP_CONN_N_FLAG_BITS }
 
enum  tcp_connection_flag_ { TCP_CONN_N_FLAGS }
 
enum  tcp_bts_flags_ { TCP_BTS_IS_RXT = 1, TCP_BTS_IS_APP_LIMITED = 1 << 1, TCP_BTS_IS_SACKED = 1 << 2, TCP_BTS_IS_RXT_LOST = 1 << 3 }
 
enum  tcp_cc_event_ { TCP_CC_EVT_START_TX }
 

Functions

static void tcp_cong_recovery_off (tcp_connection_t *tc)
 
static tcp_connection_ttcp_get_connection_from_transport (transport_connection_t *tconn)
 

Macro Definition Documentation

◆ foreach_tcp_cfg_flag

#define foreach_tcp_cfg_flag
Value:
_(RATE_SAMPLE, "Rate sampling") \
_(NO_CSUM_OFFLOAD, "No csum offload") \
_(NO_TSO, "TSO off") \
_(TSO, "TSO") \
_(NO_ENDPOINT,"No endpoint") \

Connection configuration flags.

Definition at line 94 of file tcp_types.h.

◆ foreach_tcp_connection_flag

#define foreach_tcp_connection_flag
Value:
_(SNDACK, "Send ACK") \
_(FINSNT, "FIN sent") \
_(RECOVERY, "Recovery") \
_(FAST_RECOVERY, "Fast Recovery") \
_(DCNT_PENDING, "Disconnect pending") \
_(HALF_OPEN_DONE, "Half-open completed") \
_(FINPNDG, "FIN pending") \
_(RXT_PENDING, "Retransmit pending") \
_(FRXT_FIRST, "Retransmit first") \
_(DEQ_PENDING, "Dequeue pending ") \
_(PSH_PENDING, "PSH pending") \
_(FINRCVD, "FIN received") \
_(ZERO_RWND_SENT, "Zero RWND sent") \

TCP connection flags.

Definition at line 118 of file tcp_types.h.

◆ foreach_tcp_fsm_state

#define foreach_tcp_fsm_state
Value:
_(CLOSED, "CLOSED") \
_(LISTEN, "LISTEN") \
_(SYN_SENT, "SYN_SENT") \
_(SYN_RCVD, "SYN_RCVD") \
_(ESTABLISHED, "ESTABLISHED") \
_(CLOSE_WAIT, "CLOSE_WAIT") \
_(FIN_WAIT_1, "FIN_WAIT_1") \
_(LAST_ACK, "LAST_ACK") \
_(CLOSING, "CLOSING") \
_(FIN_WAIT_2, "FIN_WAIT_2") \
_(TIME_WAIT, "TIME_WAIT")

TCP FSM state definitions as per RFC793.

Definition at line 41 of file tcp_types.h.

◆ foreach_tcp_timer

#define foreach_tcp_timer
Value:
_(RETRANSMIT, "RETRANSMIT") \
_(DELACK, "DELAYED ACK") \
_(PERSIST, "PERSIST") \
_(WAITCLOSE, "WAIT CLOSE") \
_(RETRANSMIT_SYN, "RETRANSMIT SYN") \

TCP timers.

Definition at line 63 of file tcp_types.h.

◆ rst_state

#define rst_state   snd_wl1

Definition at line 387 of file tcp_types.h.

◆ TCP_ALWAYS_ACK

#define TCP_ALWAYS_ACK   1

On/off delayed acks.

Definition at line 37 of file tcp_types.h.

◆ TCP_BTS_INVALID_INDEX

#define TCP_BTS_INVALID_INDEX   ((u32)~0)

Definition at line 194 of file tcp_types.h.

◆ TCP_CC_DATA_SZ

#define TCP_CC_DATA_SZ   24

Definition at line 31 of file tcp_types.h.

◆ tcp_csum_offload

#define tcp_csum_offload (   tc)    (!((tc)->cfg_flags & TCP_CFG_F_NO_CSUM_OFFLOAD))

Definition at line 433 of file tcp_types.h.

◆ tcp_disconnect_pending

#define tcp_disconnect_pending (   tc)    ((tc)->flags & TCP_CONN_DCNT_PENDING)

Definition at line 416 of file tcp_types.h.

◆ tcp_disconnect_pending_off

#define tcp_disconnect_pending_off (   tc)    ((tc)->flags &= ~TCP_CONN_DCNT_PENDING)

Definition at line 418 of file tcp_types.h.

◆ tcp_disconnect_pending_on

#define tcp_disconnect_pending_on (   tc)    ((tc)->flags |= TCP_CONN_DCNT_PENDING)

Definition at line 417 of file tcp_types.h.

◆ TCP_DUPACK_THRESHOLD

#define TCP_DUPACK_THRESHOLD   3

Definition at line 35 of file tcp_types.h.

◆ TCP_ESTABLISH_TIME

#define TCP_ESTABLISH_TIME   (60 * THZ) /* Connection establish timeout */

Definition at line 91 of file tcp_types.h.

◆ tcp_fastrecovery_first

#define tcp_fastrecovery_first (   tc)    ((tc)->flags & TCP_CONN_FRXT_FIRST)

Definition at line 419 of file tcp_types.h.

◆ tcp_fastrecovery_first_off

#define tcp_fastrecovery_first_off (   tc)    ((tc)->flags &= ~TCP_CONN_FRXT_FIRST)

Definition at line 421 of file tcp_types.h.

◆ tcp_fastrecovery_first_on

#define tcp_fastrecovery_first_on (   tc)    ((tc)->flags |= TCP_CONN_FRXT_FIRST)

Definition at line 420 of file tcp_types.h.

◆ tcp_fastrecovery_off

#define tcp_fastrecovery_off (   tc)    (tc)->flags &= ~TCP_CONN_FAST_RECOVERY

Definition at line 410 of file tcp_types.h.

◆ tcp_fastrecovery_on

#define tcp_fastrecovery_on (   tc)    (tc)->flags |= TCP_CONN_FAST_RECOVERY

Definition at line 409 of file tcp_types.h.

◆ TCP_FIB_RECHECK_PERIOD

#define TCP_FIB_RECHECK_PERIOD   1 * THZ

Recheck every 1s.

Definition at line 29 of file tcp_types.h.

◆ tcp_in_cong_recovery

#define tcp_in_cong_recovery (   tc)
Value:
((tc)->flags & \
(TCP_CONN_FAST_RECOVERY | TCP_CONN_RECOVERY))
u32 flags
Definition: vhost_user.h:248

Definition at line 423 of file tcp_types.h.

◆ tcp_in_fastrecovery

#define tcp_in_fastrecovery (   tc)    ((tc)->flags & TCP_CONN_FAST_RECOVERY)

Definition at line 413 of file tcp_types.h.

◆ tcp_in_recovery

#define tcp_in_recovery (   tc)    ((tc)->flags & (TCP_CONN_RECOVERY))

Definition at line 414 of file tcp_types.h.

◆ tcp_in_slowstart

#define tcp_in_slowstart (   tc)    (tc->cwnd < tc->ssthresh)

Definition at line 415 of file tcp_types.h.

◆ TCP_INVALID_SACK_HOLE_INDEX

#define TCP_INVALID_SACK_HOLE_INDEX   ((u32)~0)

Definition at line 151 of file tcp_types.h.

◆ TCP_IW_N_SEGMENTS

#define TCP_IW_N_SEGMENTS   10

Definition at line 36 of file tcp_types.h.

◆ TCP_MAX_GSO_SZ

#define TCP_MAX_GSO_SZ   65536

Definition at line 32 of file tcp_types.h.

◆ TCP_MAX_OPTION_SPACE

#define TCP_MAX_OPTION_SPACE   40

Definition at line 30 of file tcp_types.h.

◆ TCP_MAX_SACK_BLOCKS

#define TCP_MAX_SACK_BLOCKS   255

Max number of SACK blocks stored.

Definition at line 150 of file tcp_types.h.

◆ TCP_PAWS_IDLE

#define TCP_PAWS_IDLE   24 * 24 * 60 * 60 * THZ

24 days

Definition at line 28 of file tcp_types.h.

◆ tcp_recovery_off

#define tcp_recovery_off (   tc)    (tc)->flags &= ~TCP_CONN_RECOVERY

Definition at line 412 of file tcp_types.h.

◆ tcp_recovery_on

#define tcp_recovery_on (   tc)    (tc)->flags |= TCP_CONN_RECOVERY

Definition at line 411 of file tcp_types.h.

◆ TCP_RTO_BOFF_MAX

#define TCP_RTO_BOFF_MAX   8 /* Max number of retries before reset */

Definition at line 90 of file tcp_types.h.

◆ TCP_RTO_INIT

#define TCP_RTO_INIT   1 * THZ /* Initial retransmit timer */

Definition at line 89 of file tcp_types.h.

◆ TCP_RTO_MAX

#define TCP_RTO_MAX   60 * THZ /* Min max RTO (60s) as per RFC6298 */

Definition at line 85 of file tcp_types.h.

◆ TCP_RTO_MIN

#define TCP_RTO_MIN   0.2 * THZ /* Min RTO (200ms) - lower than standard */

Definition at line 86 of file tcp_types.h.

◆ TCP_RTO_SYN_RETRIES

#define TCP_RTO_SYN_RETRIES   3 /* SYN retries without doubling RTO */

Definition at line 88 of file tcp_types.h.

◆ TCP_RTT_MAX

#define TCP_RTT_MAX   30 * THZ /* 30s (probably too much) */

Definition at line 87 of file tcp_types.h.

◆ TCP_RXT_MAX_BURST

#define TCP_RXT_MAX_BURST   10

Definition at line 33 of file tcp_types.h.

◆ TCP_SCOREBOARD_TRACE

#define TCP_SCOREBOARD_TRACE   (0)

Definition at line 149 of file tcp_types.h.

◆ TCP_TICK

#define TCP_TICK   0.001

TCP tick period (s)

Definition at line 25 of file tcp_types.h.

◆ TCP_TIMER_HANDLE_INVALID

#define TCP_TIMER_HANDLE_INVALID   ((u32) ~0)

Definition at line 78 of file tcp_types.h.

◆ TCP_TIMER_TICK

#define TCP_TIMER_TICK   0.1

Timer tick in seconds.

Definition at line 80 of file tcp_types.h.

◆ TCP_TO_TIMER_TICK

#define TCP_TO_TIMER_TICK   TCP_TICK*10

Factor for converting ticks to timer ticks.

Definition at line 81 of file tcp_types.h.

◆ TCP_TSTAMP_RESOLUTION

#define TCP_TSTAMP_RESOLUTION   TCP_TICK

Time stamp resolution.

Definition at line 27 of file tcp_types.h.

◆ TCP_USE_SACKS

#define TCP_USE_SACKS   1

Disable only for testing.

Definition at line 38 of file tcp_types.h.

◆ tcp_zero_rwnd_sent

#define tcp_zero_rwnd_sent (   tc)    ((tc)->flags & TCP_CONN_ZERO_RWND_SENT)

Definition at line 435 of file tcp_types.h.

◆ tcp_zero_rwnd_sent_off

#define tcp_zero_rwnd_sent_off (   tc)    (tc)->flags &= ~TCP_CONN_ZERO_RWND_SENT

Definition at line 437 of file tcp_types.h.

◆ tcp_zero_rwnd_sent_on

#define tcp_zero_rwnd_sent_on (   tc)    (tc)->flags |= TCP_CONN_ZERO_RWND_SENT

Definition at line 436 of file tcp_types.h.

◆ THZ

#define THZ   (u32) (1/TCP_TICK)

TCP tick frequency.

Definition at line 26 of file tcp_types.h.

Typedef Documentation

◆ sack_scoreboard_hole_t

typedef struct _sack_scoreboard_hole sack_scoreboard_hole_t

◆ sack_scoreboard_t

typedef struct _sack_scoreboard sack_scoreboard_t

◆ scoreboard_trace_elt_t

typedef struct _scoreboard_trace_elt scoreboard_trace_elt_t

◆ tcp_bt_sample_t

◆ tcp_bts_flags_t

◆ tcp_byte_tracker_t

◆ tcp_cc_ack_t

typedef enum _tcp_cc_ack_t tcp_cc_ack_t

◆ tcp_cc_algorithm_t

typedef struct _tcp_cc_algorithm tcp_cc_algorithm_t

Definition at line 251 of file tcp_types.h.

◆ tcp_cc_algorithm_type_e

typedef enum _tcp_cc_algorithm_type tcp_cc_algorithm_type_e

◆ tcp_cc_event_t

◆ tcp_cfg_flag_bits_e

◆ tcp_cfg_flags_e

◆ tcp_connection_flag_bits_e

◆ tcp_connection_flags_e

◆ tcp_connection_t

typedef struct _tcp_connection tcp_connection_t

◆ tcp_errors_t

typedef struct tcp_errors_ tcp_errors_t

◆ tcp_rate_sample_t

◆ tcp_state_t

typedef enum _tcp_state tcp_state_t

◆ tcp_timer_wheel_t

typedef tw_timer_wheel_16t_2w_512sl_t tcp_timer_wheel_t

Definition at line 445 of file tcp_types.h.

◆ tcp_timers_e

typedef enum _tcp_timers tcp_timers_e

Enumeration Type Documentation

◆ tcp_bts_flags_

Enumerator
TCP_BTS_IS_RXT 
TCP_BTS_IS_APP_LIMITED 
TCP_BTS_IS_SACKED 
TCP_BTS_IS_RXT_LOST 

Definition at line 196 of file tcp_types.h.

◆ tcp_cc_event_

Enumerator
TCP_CC_EVT_START_TX 

Definition at line 260 of file tcp_types.h.

◆ tcp_cfg_flag_

Enumerator
TCP_CFG_N_FLAGS 

Definition at line 109 of file tcp_types.h.

◆ tcp_cfg_flag_bits_

Enumerator
TCP_CFG_N_FLAG_BITS 

Definition at line 101 of file tcp_types.h.

◆ tcp_connection_flag_

Enumerator
TCP_CONN_N_FLAGS 

Definition at line 141 of file tcp_types.h.

◆ tcp_connection_flag_bits_

Enumerator
TCP_CONN_N_FLAG_BITS 

Definition at line 133 of file tcp_types.h.

Function Documentation

◆ tcp_cong_recovery_off()

static void tcp_cong_recovery_off ( tcp_connection_t tc)
inlinestatic

Definition at line 427 of file tcp_types.h.

+ Here is the caller graph for this function:

◆ tcp_get_connection_from_transport()

static tcp_connection_t* tcp_get_connection_from_transport ( transport_connection_t tconn)
inlinestatic

Definition at line 440 of file tcp_types.h.

+ Here is the caller graph for this function: