FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
transport.h File Reference
+ Include dependency graph for transport.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  transport_send_params_
 

Macros

#define TRANSPORT_PACER_MIN_MSS   1460
 
#define TRANSPORT_PACER_MIN_BURST   TRANSPORT_PACER_MIN_MSS
 
#define TRANSPORT_PACER_MAX_BURST   (43 * TRANSPORT_PACER_MIN_MSS)
 
#define TRANSPORT_PACER_MAX_BURST_PKTS   43
 
#define TRANSPORT_PACER_BURSTS_PER_RTT   20
 
#define TRANSPORT_PACER_MIN_IDLE   100
 
#define TRANSPORT_PACER_IDLE_FACTOR   0.05
 
#define transport_proto_foreach(VAR, BODY)
 

Typedefs

typedef struct _transport_options_t transport_options_t
 
typedef enum transport_snd_flags_ transport_snd_flags_t
 
typedef struct transport_send_params_ transport_send_params_t
 
typedef struct _transport_proto_vft transport_proto_vft_t
 

Enumerations

enum  transport_snd_flags_ { TRANSPORT_SND_F_DESCHED = 1 << 0, TRANSPORT_SND_F_POSTPONE = 1 << 1, TRANSPORT_SND_N_FLAGS }
 

Functions

int transport_connect (transport_proto_t tp, transport_endpoint_cfg_t *tep)
 
void transport_half_close (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
void transport_close (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
void transport_reset (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
u32 transport_start_listen (transport_proto_t tp, u32 session_index, transport_endpoint_t *tep)
 
u32 transport_stop_listen (transport_proto_t tp, u32 conn_index)
 
void transport_cleanup (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
void transport_cleanup_half_open (transport_proto_t tp, u32 conn_index)
 
void transport_get_endpoint (transport_proto_t tp, u32 conn_index, u32 thread_index, transport_endpoint_t *tep, u8 is_lcl)
 
void transport_get_listener_endpoint (transport_proto_t tp, u32 conn_index, transport_endpoint_t *tep, u8 is_lcl)
 
int transport_connection_attribute (transport_proto_t tp, u32 conn_index, u8 thread_index, u8 is_get, transport_endpt_attr_t *attr)
 
static transport_connection_ttransport_get_connection (transport_proto_t tp, u32 conn_index, u8 thread_index)
 
static transport_connection_ttransport_get_listener (transport_proto_t tp, u32 conn_index)
 
static transport_connection_ttransport_get_half_open (transport_proto_t tp, u32 conn_index)
 
static int transport_custom_tx (transport_proto_t tp, void *s, transport_send_params_t *sp)
 
static int transport_app_rx_evt (transport_proto_t tp, u32 conn_index, u32 thread_index)
 
static u32 transport_connection_snd_params (transport_connection_t *tc, transport_send_params_t *sp)
 Get send parameters for transport connection. More...
 
static u8 transport_connection_is_descheduled (transport_connection_t *tc)
 
static void transport_connection_deschedule (transport_connection_t *tc)
 
static u8 transport_connection_is_cless (transport_connection_t *tc)
 
void transport_connection_reschedule (transport_connection_t *tc)
 
void transport_fifos_init_ooo (transport_connection_t *tc)
 
void transport_register_protocol (transport_proto_t transport_proto, const transport_proto_vft_t *vft, fib_protocol_t fib_proto, u32 output_node)
 Register transport virtual function table. More...
 
transport_proto_t transport_register_new_protocol (const transport_proto_vft_t *vft, fib_protocol_t fib_proto, u32 output_node)
 
transport_proto_vft_ttransport_protocol_get_vft (transport_proto_t tp)
 Get transport virtual function table. More...
 
void transport_update_time (clib_time_type_t time_now, u8 thread_index)
 
int transport_alloc_local_port (u8 proto, ip46_address_t *ip)
 Allocate local port and add if successful add entry to local endpoint table to mark the pair as used. More...
 
int transport_alloc_local_endpoint (u8 proto, transport_endpoint_cfg_t *rmt, ip46_address_t *lcl_addr, u16 *lcl_port)
 
void transport_share_local_endpoint (u8 proto, ip46_address_t *lcl_ip, u16 port)
 
void transport_endpoint_cleanup (u8 proto, ip46_address_t *lcl_ip, u16 port)
 
void transport_enable_disable (vlib_main_t *vm, u8 is_en)
 
void transport_init (void)
 
static u32 transport_elog_track_index (transport_connection_t *tc)
 
void transport_connection_tx_pacer_reset (transport_connection_t *tc, u64 rate_bytes_per_sec, u32 initial_bucket, clib_us_time_t rtt)
 
void transport_connection_tx_pacer_init (transport_connection_t *tc, u64 rate_bytes_per_sec, u32 initial_bucket)
 Initialize tx pacer for connection. More...
 
void transport_connection_tx_pacer_update (transport_connection_t *tc, u64 bytes_per_sec, clib_us_time_t rtt)
 Update tx pacer pacing rate. More...
 
u32 transport_connection_tx_pacer_burst (transport_connection_t *tc)
 Get tx pacer max burst. More...
 
u64 transport_connection_tx_pacer_rate (transport_connection_t *tc)
 Get tx pacer current rate. More...
 
void transport_connection_tx_pacer_reset_bucket (transport_connection_t *tc, u32 bucket)
 Reset tx pacer bucket. More...
 
static u8 transport_connection_is_tx_paced (transport_connection_t *tc)
 Check if transport connection is paced. More...
 
u8format_transport_pacer (u8 *s, va_list *args)
 
void transport_connection_update_tx_bytes (transport_connection_t *tc, u32 bytes)
 Update tx bytes for paced transport connection. More...
 
void transport_connection_tx_pacer_update_bytes (transport_connection_t *tc, u32 bytes)
 
void transport_update_pacer_time (u32 thread_index, clib_time_type_t now)
 Request pacer time update. More...
 

Variables

transport_proto_vft_ttp_vfts
 Per-type vector of transport protocol virtual function tables. More...
 

Macro Definition Documentation

◆ TRANSPORT_PACER_BURSTS_PER_RTT

#define TRANSPORT_PACER_BURSTS_PER_RTT   20

Definition at line 26 of file transport.h.

◆ TRANSPORT_PACER_IDLE_FACTOR

#define TRANSPORT_PACER_IDLE_FACTOR   0.05

Definition at line 28 of file transport.h.

◆ TRANSPORT_PACER_MAX_BURST

#define TRANSPORT_PACER_MAX_BURST   (43 * TRANSPORT_PACER_MIN_MSS)

Definition at line 24 of file transport.h.

◆ TRANSPORT_PACER_MAX_BURST_PKTS

#define TRANSPORT_PACER_MAX_BURST_PKTS   43

Definition at line 25 of file transport.h.

◆ TRANSPORT_PACER_MIN_BURST

#define TRANSPORT_PACER_MIN_BURST   TRANSPORT_PACER_MIN_MSS

Definition at line 23 of file transport.h.

◆ TRANSPORT_PACER_MIN_IDLE

#define TRANSPORT_PACER_MIN_IDLE   100

Definition at line 27 of file transport.h.

◆ TRANSPORT_PACER_MIN_MSS

#define TRANSPORT_PACER_MIN_MSS   1460

Definition at line 22 of file transport.h.

◆ transport_proto_foreach

#define transport_proto_foreach (   VAR,
  BODY 
)
Value:
do { \
for (VAR = 0; VAR < vec_len (tp_vfts); VAR++) \
if (tp_vfts[VAR].push_header != 0) \
do { BODY; } while (0); \
} while (0)

Definition at line 130 of file transport.h.

Typedef Documentation

◆ transport_options_t

typedef struct _transport_options_t transport_options_t

◆ transport_proto_vft_t

typedef struct _transport_proto_vft transport_proto_vft_t

◆ transport_send_params_t

◆ transport_snd_flags_t

Enumeration Type Documentation

◆ transport_snd_flags_

Enumerator
TRANSPORT_SND_F_DESCHED 
TRANSPORT_SND_F_POSTPONE 
TRANSPORT_SND_N_FLAGS 

Definition at line 38 of file transport.h.

Function Documentation

◆ format_transport_pacer()

u8* format_transport_pacer ( u8 s,
va_list *  args 
)

Definition at line 645 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_alloc_local_endpoint()

int transport_alloc_local_endpoint ( u8  proto,
transport_endpoint_cfg_t rmt,
ip46_address_t *  lcl_addr,
u16 lcl_port 
)

Definition at line 583 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_alloc_local_port()

int transport_alloc_local_port ( u8  proto,
ip46_address_t *  ip 
)

Allocate local port and add if successful add entry to local endpoint table to mark the pair as used.

Definition at line 493 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_app_rx_evt()

static int transport_app_rx_evt ( transport_proto_t  tp,
u32  conn_index,
u32  thread_index 
)
inlinestatic

Definition at line 184 of file transport.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_cleanup()

void transport_cleanup ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)

Definition at line 302 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_cleanup_half_open()

void transport_cleanup_half_open ( transport_proto_t  tp,
u32  conn_index 
)

Definition at line 308 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_close()

void transport_close ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)

Definition at line 328 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_connect()

int transport_connect ( transport_proto_t  tp,
transport_endpoint_cfg_t tep 
)

Definition at line 315 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_connection_attribute()

int transport_connection_attribute ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index,
u8  is_get,
transport_endpt_attr_t attr 
)

Definition at line 410 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_connection_deschedule()

static void transport_connection_deschedule ( transport_connection_t tc)
inlinestatic

Definition at line 217 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_connection_is_cless()

static u8 transport_connection_is_cless ( transport_connection_t tc)
inlinestatic

Definition at line 223 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_connection_is_descheduled()

static u8 transport_connection_is_descheduled ( transport_connection_t tc)
inlinestatic

Definition at line 211 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_connection_is_tx_paced()

static u8 transport_connection_is_tx_paced ( transport_connection_t tc)
inlinestatic

Check if transport connection is paced.

Definition at line 327 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_connection_reschedule()

void transport_connection_reschedule ( transport_connection_t tc)

Definition at line 790 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_connection_snd_params()

static u32 transport_connection_snd_params ( transport_connection_t tc,
transport_send_params_t sp 
)
inlinestatic

Get send parameters for transport connection.

These include maximum tx burst, mss, tx offset and other flags transport might want to provide to sessin layer

Parameters
tctransport connection
spsend paramaters

Definition at line 204 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_connection_tx_pacer_burst()

u32 transport_connection_tx_pacer_burst ( transport_connection_t tc)

Get tx pacer max burst.

Parameters
tctransport connection
time_nowcurrent cpu time
Returns
max burst for connection

Definition at line 757 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_connection_tx_pacer_init()

void transport_connection_tx_pacer_init ( transport_connection_t tc,
u64  rate_bytes_per_sec,
u32  initial_bucket 
)

Initialize tx pacer for connection.

Parameters
tctransport connection
rate_bytes_per_secondinitial byte rate
burst_bytesinitial burst size in bytes

Definition at line 739 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_connection_tx_pacer_rate()

u64 transport_connection_tx_pacer_rate ( transport_connection_t tc)

Get tx pacer current rate.

Parameters
tctransport connection
Returns
rate for connection in bytes/s

Definition at line 764 of file transport.c.

+ Here is the call graph for this function:

◆ transport_connection_tx_pacer_reset()

void transport_connection_tx_pacer_reset ( transport_connection_t tc,
u64  rate_bytes_per_sec,
u32  initial_bucket,
clib_us_time_t  rtt 
)

Definition at line 721 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_connection_tx_pacer_reset_bucket()

void transport_connection_tx_pacer_reset_bucket ( transport_connection_t tc,
u32  bucket 
)

Reset tx pacer bucket.

Parameters
tctransport connection
bucketvalue the bucket will be reset to

Definition at line 732 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_connection_tx_pacer_update()

void transport_connection_tx_pacer_update ( transport_connection_t tc,
u64  bytes_per_sec,
clib_us_time_t  rtt 
)

Update tx pacer pacing rate.

Parameters
tctransport connection
bytes_per_secnew pacing rate
rttconnection rtt that is used to compute inactivity time after which pacer bucket is reset to 1 mtu

Definition at line 749 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_connection_tx_pacer_update_bytes()

void transport_connection_tx_pacer_update_bytes ( transport_connection_t tc,
u32  bytes 
)

Definition at line 777 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_connection_update_tx_bytes()

void transport_connection_update_tx_bytes ( transport_connection_t tc,
u32  bytes 
)

Update tx bytes for paced transport connection.

If tx pacing is enabled, this update pacer bucket to account for the amount of bytes that have been sent.

Parameters
tctransport connection
bytesbytes recently sent

Definition at line 770 of file transport.c.

+ Here is the call graph for this function:

◆ transport_custom_tx()

static int transport_custom_tx ( transport_proto_t  tp,
void *  s,
transport_send_params_t sp 
)
inlinestatic

Definition at line 177 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_elog_track_index()

static u32 transport_elog_track_index ( transport_connection_t tc)
inlinestatic

Definition at line 260 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_enable_disable()

void transport_enable_disable ( vlib_main_t vm,
u8  is_en 
)

Definition at line 826 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_endpoint_cleanup()

void transport_endpoint_cleanup ( u8  proto,
ip46_address_t *  lcl_ip,
u16  port 
)

Definition at line 439 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_fifos_init_ooo()

void transport_fifos_init_ooo ( transport_connection_t tc)

Definition at line 807 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_get_connection()

static transport_connection_t* transport_get_connection ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)
inlinestatic

Definition at line 158 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_get_endpoint()

void transport_get_endpoint ( transport_proto_t  tp,
u32  conn_index,
u32  thread_index,
transport_endpoint_t tep,
u8  is_lcl 
)

Definition at line 380 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_get_half_open()

static transport_connection_t* transport_get_half_open ( transport_proto_t  tp,
u32  conn_index 
)
inlinestatic

Definition at line 171 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_get_listener()

static transport_connection_t* transport_get_listener ( transport_proto_t  tp,
u32  conn_index 
)
inlinestatic

Definition at line 165 of file transport.h.

+ Here is the caller graph for this function:

◆ transport_get_listener_endpoint()

void transport_get_listener_endpoint ( transport_proto_t  tp,
u32  conn_index,
transport_endpoint_t tep,
u8  is_lcl 
)

Definition at line 396 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_half_close()

void transport_half_close ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)

Definition at line 321 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_init()

void transport_init ( void  )

Definition at line 837 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_protocol_get_vft()

transport_proto_vft_t* transport_protocol_get_vft ( transport_proto_t  transport_proto)

Get transport virtual function table.

Parameters
type- session type (not protocol type)

Definition at line 282 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_register_new_protocol()

transport_proto_t transport_register_new_protocol ( const transport_proto_vft_t vft,
fib_protocol_t  fib_proto,
u32  output_node 
)

Definition at line 259 of file transport.c.

+ Here is the call graph for this function:

◆ transport_register_protocol()

void transport_register_protocol ( transport_proto_t  transport_proto,
const transport_proto_vft_t vft,
fib_protocol_t  fib_proto,
u32  output_node 
)

Register transport virtual function table.

Parameters
transport_proto- transport protocol type (i.e., TCP, UDP ..)
vft- virtual function table for transport proto
fib_proto- network layer protocol
output_node- output node index that session layer will hand off buffers to, for requested fib proto

Definition at line 246 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_reset()

void transport_reset ( transport_proto_t  tp,
u32  conn_index,
u8  thread_index 
)

Definition at line 334 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_share_local_endpoint()

void transport_share_local_endpoint ( u8  proto,
ip46_address_t *  lcl_ip,
u16  port 
)

Definition at line 474 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_start_listen()

u32 transport_start_listen ( transport_proto_t  tp,
u32  session_index,
transport_endpoint_t tep 
)

Definition at line 343 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_stop_listen()

u32 transport_stop_listen ( transport_proto_t  tp,
u32  conn_index 
)

Definition at line 350 of file transport.c.

+ Here is the caller graph for this function:

◆ transport_update_pacer_time()

void transport_update_pacer_time ( u32  thread_index,
clib_time_type_t  now 
)

Request pacer time update.

Parameters
thread_indexthread for which time is updated
nowtime now

Definition at line 784 of file transport.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ transport_update_time()

void transport_update_time ( clib_time_type_t  time_now,
u8  thread_index 
)

Definition at line 815 of file transport.c.

Variable Documentation

◆ tp_vfts

Per-type vector of transport protocol virtual function tables.

Definition at line 29 of file transport.c.

tp_vfts
transport_proto_vft_t * tp_vfts
Per-type vector of transport protocol virtual function tables.
Definition: transport.c:29
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142