TAS
TCP Acceleration as an OS Service
|
Application library for TAS lowlevel interface. More...
Data Structures | |
struct | flextcp_context |
struct | flextcp_listener |
struct | flextcp_connection |
struct | flextcp_event |
Macros | |
#define | FLEXTCP_MAX_CONTEXTS 32 |
#define | FLEXTCP_MAX_FTCPCORES 16 |
#define | FLEXTCP_LISTEN_REUSEPORT 0x1 |
Application library for TAS lowlevel interface.
enum flextcp_event_type |
Types of events that can occur in flextcp contexts
Enumerator | |
---|---|
FLEXTCP_EV_LISTEN_OPEN | flextcp_listen_open() result. |
FLEXTCP_EV_LISTEN_NEWCONN | New connection on listening socket arrived. |
FLEXTCP_EV_LISTEN_ACCEPT | Accept operation completed |
FLEXTCP_EV_CONN_OPEN | flextcp_connection_open() result |
FLEXTCP_EV_CONN_CLOSED | Connection was closed |
FLEXTCP_EV_CONN_RECEIVED | Data arrived on connection |
FLEXTCP_EV_CONN_SENDBUF | More send buffer available |
FLEXTCP_EV_CONN_RXCLOSED | Receive stream closed |
FLEXTCP_EV_CONN_TXCLOSED | transmit stream closed |
FLEXTCP_EV_CONN_MOVED | Connection moved to new context |
int flextcp_connection_close | ( | struct flextcp_context * | ctx, |
struct flextcp_connection * | conn | ||
) |
int flextcp_connection_move | ( | struct flextcp_context * | ctx, |
struct flextcp_connection * | conn | ||
) |
Move connection to specfied context
Definition at line 397 of file conn.c.
References CONN_CLOSED, flextcp_connection::txb_allocated, and flextcp_connection::txb_sent.
int flextcp_connection_open | ( | struct flextcp_context * | ctx, |
struct flextcp_connection * | conn, | ||
uint32_t | dst_ip, | ||
uint16_t | dst_port | ||
) |
int flextcp_connection_rx_done | ( | struct flextcp_context * | ctx, |
struct flextcp_connection * | conn, | ||
size_t | len | ||
) |
Receive processing for `len' bytes done.
Definition at line 223 of file conn.c.
References flextcp_connection::rxb_bump, and flextcp_connection::rxb_used.
ssize_t flextcp_connection_tx_alloc | ( | struct flextcp_connection * | conn, |
size_t | len, | ||
void ** | buf | ||
) |
Allocate transmit buffer for `len' bytes, returns number of bytes allocated.
NOTE: short allocs can occur if buffer wraps around
Definition at line 242 of file conn.c.
References flextcp_connection::txb_allocated, and flextcp_connection::txb_head.
ssize_t flextcp_connection_tx_alloc2 | ( | struct flextcp_connection * | conn, |
size_t | len, | ||
void ** | buf_1, | ||
size_t * | len_1, | ||
void ** | buf_2 | ||
) |
Allocate transmit buffer for `len' bytes, returns number of bytes allocated. May be split across two buffers, in case of wrap around.
Definition at line 277 of file conn.c.
References flextcp_connection::txb_allocated, and flextcp_connection::txb_head.
int flextcp_connection_tx_close | ( | struct flextcp_context * | ctx, |
struct flextcp_connection * | conn | ||
) |
Send previously allocated bytes in transmit buffer
Definition at line 337 of file conn.c.
References flextcp_connection::txb_bump, flextcp_connection::txb_head, and flextcp_connection::txb_sent.
int flextcp_connection_tx_possible | ( | struct flextcp_context * | ctx, |
struct flextcp_connection * | conn | ||
) |
int flextcp_connection_tx_send | ( | struct flextcp_context * | ctx, |
struct flextcp_connection * | conn, | ||
size_t | len | ||
) |
Send previously allocated bytes in transmit buffer
Definition at line 314 of file conn.c.
References flextcp_connection::txb_allocated, flextcp_connection::txb_bump, flextcp_connection::txb_head, and flextcp_connection::txb_sent.
int flextcp_context_canwait | ( | struct flextcp_context * | ctx | ) |
Indicates whether the caller is allowed to block on the wait file descriptor on this context after this call returns.
Definition at line 930 of file init.c.
References flexnic_info::poll_cycle_app.
Referenced by flextcp_context_wait().
int flextcp_context_create | ( | struct flextcp_context * | ctx | ) |
int flextcp_context_poll | ( | struct flextcp_context * | ctx, |
int | num, | ||
struct flextcp_event * | events | ||
) |
Poll events from a flextcp socket.
Definition at line 454 of file init.c.
References flextcp_event::conn_closed, CONN_CLOSED, flextcp_event::conn_moved, flextcp_event::conn_open, CONN_OPEN, flextcp_event::conn_received, flextcp_event::conn_rxclosed, FLEXTCP_EV_CONN_CLOSED, FLEXTCP_EV_CONN_MOVED, FLEXTCP_EV_CONN_OPEN, FLEXTCP_EV_CONN_RECEIVED, FLEXTCP_EV_CONN_RXCLOSED, FLEXTCP_EV_LISTEN_ACCEPT, FLEXTCP_EV_LISTEN_NEWCONN, FLEXTCP_EV_LISTEN_OPEN, flextcp_event::listen_accept, flextcp_event::listen_newconn, flextcp_event::listen_open, flexnic_info::poll_cycle_tas, and flextcp_connection::rxb_used.
int flextcp_context_wait | ( | struct flextcp_context * | ctx, |
int | timeout_ms | ||
) |
Waits for events for up to timeout_ms milliseconds. Is not guaranteed to block, but only does so when flextcp_context_canwait returns 0.
Definition at line 995 of file init.c.
References flextcp_context_canwait(), and flextcp_context_waitclear().
void flextcp_context_waitclear | ( | struct flextcp_context * | ctx | ) |
Clear events off of waitfd after waking up. Does not process any events any events, just reads the count off the internal eventfd.
Definition at line 979 of file init.c.
Referenced by flextcp_context_wait().
int flextcp_context_waitfd | ( | struct flextcp_context * | ctx | ) |
Get file descriptor for waiting on events in this context. Note that blocking is only allowed after flextcp_context_canwait
indicates this. After waking up, canwait has to be called again before blocking again.
int flextcp_init | ( | void | ) |
int flextcp_listen_accept | ( | struct flextcp_context * | ctx, |
struct flextcp_listener * | lst, | ||
struct flextcp_connection * | conn | ||
) |
int flextcp_listen_open | ( | struct flextcp_context * | ctx, |
struct flextcp_listener * | lst, | ||
uint16_t | port, | ||
uint32_t | backlog, | ||
uint32_t | flags | ||
) |