FD.io VPP  v21.06-3-gbb25fbf28
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.000001
 TCP tick period (s) More...
 
#define THZ   (u32) (1/TCP_TICK)
 TCP tick frequency. More...
 
#define TCP_TSTP_TICK   0.001
 Timestamp tick (s) More...
 
#define TCP_TSTP_HZ   (u32) (1/TCP_TSTP_TICK)
 Timestamp freq. More...
 
#define TCP_PAWS_IDLE   (24 * 86400 * TCP_TSTP_HZ)
 24 days More...
 
#define TCP_TSTP_TO_HZ   (u32) (TCP_TSTP_TICK * THZ)
 
#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_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.0001
 Timer tick in seconds. More...
 
#define TCP_TO_TIMER_TICK   TCP_TICK*10000
 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_MAX_SACK_REORDER   300
 
#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
 
#define TW_TIMER_WHEELS   2
 
#define TW_SLOTS_PER_RING   1024
 
#define TW_RING_SHIFT   10
 
#define TW_RING_MASK   (TW_SLOTS_PER_RING -1)
 
#define TW_TIMERS_PER_OBJECT   16
 
#define LOG2_TW_TIMERS_PER_OBJECT   4
 
#define TW_SUFFIX   _tcp_twsl
 
#define TW_FAST_WHEEL_BITMAP   0
 
#define TW_TIMER_ALLOW_DUPLICATE_STOP   1
 

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_tcp_twsl_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 43 of file tcp_types.h.

◆ foreach_tcp_timer

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

TCP timers.

Definition at line 65 of file tcp_types.h.

◆ LOG2_TW_TIMERS_PER_OBJECT

#define LOG2_TW_TIMERS_PER_OBJECT   4

Definition at line 468 of file tcp_types.h.

◆ rst_state

#define rst_state   snd_wl1

Definition at line 389 of file tcp_types.h.

◆ TCP_ALWAYS_ACK

#define TCP_ALWAYS_ACK   1

On/off delayed acks.

Definition at line 39 of file tcp_types.h.

◆ TCP_BTS_INVALID_INDEX

#define TCP_BTS_INVALID_INDEX   ((u32)~0)

Definition at line 196 of file tcp_types.h.

◆ TCP_CC_DATA_SZ

#define TCP_CC_DATA_SZ   24

Definition at line 34 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 435 of file tcp_types.h.

◆ tcp_disconnect_pending

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

Definition at line 418 of file tcp_types.h.

◆ tcp_disconnect_pending_off

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

Definition at line 420 of file tcp_types.h.

◆ tcp_disconnect_pending_on

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

Definition at line 419 of file tcp_types.h.

◆ TCP_DUPACK_THRESHOLD

#define TCP_DUPACK_THRESHOLD   3

Definition at line 37 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 421 of file tcp_types.h.

◆ tcp_fastrecovery_first_off

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

Definition at line 423 of file tcp_types.h.

◆ tcp_fastrecovery_first_on

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

Definition at line 422 of file tcp_types.h.

◆ tcp_fastrecovery_off

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

Definition at line 412 of file tcp_types.h.

◆ tcp_fastrecovery_on

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

Definition at line 411 of file tcp_types.h.

◆ TCP_FIB_RECHECK_PERIOD

#define TCP_FIB_RECHECK_PERIOD   1 * THZ

Recheck every 1s.

Definition at line 32 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))

Definition at line 425 of file tcp_types.h.

◆ tcp_in_fastrecovery

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

Definition at line 415 of file tcp_types.h.

◆ tcp_in_recovery

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

Definition at line 416 of file tcp_types.h.

◆ tcp_in_slowstart

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

Definition at line 417 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 38 of file tcp_types.h.

◆ TCP_MAX_OPTION_SPACE

#define TCP_MAX_OPTION_SPACE   40

Definition at line 33 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_MAX_SACK_REORDER

#define TCP_MAX_SACK_REORDER   300

Definition at line 152 of file tcp_types.h.

◆ TCP_PAWS_IDLE

#define TCP_PAWS_IDLE   (24 * 86400 * TCP_TSTP_HZ)

24 days

Definition at line 29 of file tcp_types.h.

◆ tcp_recovery_off

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

Definition at line 414 of file tcp_types.h.

◆ tcp_recovery_on

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

Definition at line 413 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 35 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.000001

TCP tick period (s)

Definition at line 24 of file tcp_types.h.

◆ TCP_TIMER_HANDLE_INVALID

#define TCP_TIMER_HANDLE_INVALID   ((u32) ~0)

Definition at line 79 of file tcp_types.h.

◆ TCP_TIMER_TICK

#define TCP_TIMER_TICK   0.0001

Timer tick in seconds.

Definition at line 81 of file tcp_types.h.

◆ TCP_TO_TIMER_TICK

#define TCP_TO_TIMER_TICK   TCP_TICK*10000

Factor for converting ticks to timer ticks.

Definition at line 82 of file tcp_types.h.

◆ TCP_TSTP_HZ

#define TCP_TSTP_HZ   (u32) (1/TCP_TSTP_TICK)

Timestamp freq.

Definition at line 28 of file tcp_types.h.

◆ TCP_TSTP_TICK

#define TCP_TSTP_TICK   0.001

Timestamp tick (s)

Definition at line 27 of file tcp_types.h.

◆ TCP_TSTP_TO_HZ

#define TCP_TSTP_TO_HZ   (u32) (TCP_TSTP_TICK * THZ)

Definition at line 30 of file tcp_types.h.

◆ TCP_USE_SACKS

#define TCP_USE_SACKS   1

Disable only for testing.

Definition at line 40 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 437 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 439 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 438 of file tcp_types.h.

◆ THZ

#define THZ   (u32) (1/TCP_TICK)

TCP tick frequency.

Definition at line 25 of file tcp_types.h.

◆ TW_FAST_WHEEL_BITMAP

#define TW_FAST_WHEEL_BITMAP   0

Definition at line 470 of file tcp_types.h.

◆ TW_RING_MASK

#define TW_RING_MASK   (TW_SLOTS_PER_RING -1)

Definition at line 466 of file tcp_types.h.

◆ TW_RING_SHIFT

#define TW_RING_SHIFT   10

Definition at line 465 of file tcp_types.h.

◆ TW_SLOTS_PER_RING

#define TW_SLOTS_PER_RING   1024

Definition at line 464 of file tcp_types.h.

◆ TW_SUFFIX

#define TW_SUFFIX   _tcp_twsl

Definition at line 469 of file tcp_types.h.

◆ TW_TIMER_ALLOW_DUPLICATE_STOP

#define TW_TIMER_ALLOW_DUPLICATE_STOP   1

Definition at line 471 of file tcp_types.h.

◆ TW_TIMER_WHEELS

#define TW_TIMER_WHEELS   2

Definition at line 463 of file tcp_types.h.

◆ TW_TIMERS_PER_OBJECT

#define TW_TIMERS_PER_OBJECT   16

Definition at line 467 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 253 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_tcp_twsl_t tcp_timer_wheel_t

Definition at line 475 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 198 of file tcp_types.h.

◆ tcp_cc_event_

Enumerator
TCP_CC_EVT_START_TX 

Definition at line 262 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 429 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 442 of file tcp_types.h.

+ Here is the caller graph for this function:
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105