TAS
TCP Acceleration as an OS Service
|
TCP Protocol Handling. More...
![]() |
Data Structures | |
struct | connection_cc_dctcp_win |
struct | connection_cc_dctcp_rate |
struct | connection_cc_timely |
struct | connection |
struct | listener |
Enumerations | |
enum | connection_status { CONN_SYN_WAIT, CONN_ARP_PENDING, CONN_SYN_SENT, CONN_REG_SYNACK, CONN_OPEN, CONN_CLOSED, CONN_FAILED } |
Functions | |
int | tcp_init (void) |
void | tcp_poll (void) |
int | tcp_open (struct app_context *ctx, uint64_t opaque, uint32_t remote_ip, uint16_t remote_port, uint32_t db_id, struct connection **conn) |
int | tcp_listen (struct app_context *ctx, uint64_t opaque, uint16_t local_port, uint32_t backlog, int reuseport, struct listener **listen) |
int | tcp_accept (struct app_context *ctx, uint64_t opaque, struct listener *listen, uint32_t db_id) |
int | tcp_packet (const void *pkt, uint16_t len, uint32_t fn_core, uint16_t flow_group) |
int | tcp_close (struct connection *conn) |
void | tcp_destroy (struct connection *conn) |
void | tcp_timeout (struct timeout *to, enum timeout_type type) |
Variables | |
struct connection * | tcp_conns |
TCP Protocol Handling.
enum connection_status |
TCP connection state machine state.
Definition at line 353 of file internal.h.
int tcp_accept | ( | struct app_context * | ctx, |
uint64_t | opaque, | ||
struct listener * | listen, | ||
uint32_t | db_id | ||
) |
Prepare to receive a connection on a listener.
ctx | Application context |
opaque | Opaque value passed from application |
listen | Listener |
db_id | Doorbell ID |
Definition at line 322 of file tcp.c.
References listener::backlog_used, connection::cnt_tx_pending, CONN_SYN_WAIT, connection::ctx, connection::db_id, connection::flags, listener::flags, connection::ht_next, connection::local_port, connection::opaque, listener::port, connection::status, and listener::wait_conns.
int tcp_close | ( | struct connection * | conn | ) |
Destroy already closed/failed connection.
conn | Connection |
Definition at line 392 of file tcp.c.
References cc_conn_remove(), CONN_CLOSED, CONN_OPEN, connection::flow_id, connection::local_seq, nicif_connection_disable(), connection::remote_seq, connection::status, connection::to, connection::to_armed, and util_timeout_arm().
void tcp_destroy | ( | struct connection * | conn | ) |
Destroy already closed/failed connection.
conn | Connection |
Definition at line 428 of file tcp.c.
References CONN_FAILED, and connection::status.
Referenced by appif_accept_conn(), and appif_conn_opened().
int tcp_init | ( | void | ) |
int tcp_listen | ( | struct app_context * | ctx, |
uint64_t | opaque, | ||
uint16_t | local_port, | ||
uint32_t | backlog, | ||
int | reuseport, | ||
struct listener ** | listen | ||
) |
Open a listener.
ctx | Application context |
opaque | Opaque value passed from application |
local_port | Port to listen on |
backlog | Backlog queue length |
reuseport | Enable reuseport, to have multiple listeners for the same port. |
listen | Pointer to location for storing pointer of created listener struct. |
Definition at line 211 of file tcp.c.
References listener::backlog_cores, listener::backlog_fgs, listener::backlog_len, listener::backlog_pos, listener::backlog_ptrs, listener::backlog_used, listener::ctx, listener::flags, listener::opaque, listener::port, and listener::wait_conns.
int tcp_open | ( | struct app_context * | ctx, |
uint64_t | opaque, | ||
uint32_t | remote_ip, | ||
uint16_t | remote_port, | ||
uint32_t | db_id, | ||
struct connection ** | conn | ||
) |
Open a connection.
This function returns asynchronously if it does not fail immediately. The TCP module will call appif_conn_opened().
ctx | Application context |
opaque | Opaque value passed from application |
remote_ip | Remote IP address |
remote_port | Remote port number |
db_id | Doorbell ID to use for connection |
conn | Pointer to location for storing pointer of created conn struct. |
Definition at line 147 of file tcp.c.
References connection::cnt_tx_pending, connection::comp, CONN_ARP_PENDING, connection::ctx, connection::db_id, connection::flags, configuration::ip, connection::local_ip, connection::local_port, connection::local_seq, connection::opaque, connection::remote_ip, connection::remote_mac, connection::remote_port, connection::remote_seq, routing_resolve(), and connection::status.
int tcp_packet | ( | const void * | pkt, |
uint16_t | len, | ||
uint32_t | fn_core, | ||
uint16_t | flow_group | ||
) |
RX processing for a TCP packet.
pkt | Pointer to packet |
len | Length of packet |
fn_core | FlexNIC emulator core |
flow_group | Flow group (rss bucket for steering) |
Definition at line 350 of file tcp.c.
References configuration::ip, and configuration::kni_name.
void tcp_poll | ( | void | ) |
Poll for TCP events
Definition at line 123 of file tcp.c.
References connection::comp, CONN_ARP_PENDING, CONN_REG_SYNACK, and connection::status.
void tcp_timeout | ( | struct timeout * | to, |
enum timeout_type | type | ||
) |
TCP timeout triggered.
to | Timeout that triggered |
type | Timeout type |
Definition at line 434 of file tcp.c.
References appif_accept_conn(), appif_conn_closed(), appif_conn_opened(), appif_listen_newconn(), listener::backlog_cores, listener::backlog_fgs, listener::backlog_len, listener::backlog_pos, listener::backlog_ptrs, listener::backlog_used, cc_conn_init(), connection::cc_rate, connection::comp, CONN_CLOSED, CONN_FAILED, CONN_OPEN, CONN_REG_SYNACK, CONN_SYN_SENT, connection::db_id, connection::flags, connection::flow_group, connection::flow_id, connection::fn_core, connection::ht_next, configuration::ip, connection::local_ip, connection::local_port, connection::local_seq, NICIF_CONN_ECN, nicif_connection_add(), nicif_connection_free(), nicif_tx_alloc(), nicif_tx_send(), connection::opaque, packetmem_alloc(), packetmem_free(), listener::port, connection::remote_ip, connection::remote_mac, connection::remote_port, connection::remote_seq, connection::rx_buf, connection::rx_handle, connection::rx_len, connection::status, connection::syn_ts, configuration::tcp_handshake_retries, configuration::tcp_handshake_to, configuration::tcp_rxbuf_len, configuration::tcp_txbuf_len, connection::timeout, connection::to, connection::to_armed, connection::to_attempts, tcp_opts::ts, connection::tx_buf, connection::tx_handle, connection::tx_len, util_timeout_arm(), util_timeout_disarm(), and listener::wait_conns.
struct connection* tcp_conns |
List of tcp connections