TAS
TCP Acceleration as an OS Service
Data Structures | Enumerations | Functions
Tas-sp-nicif

NIC Interface. More...

Collaboration diagram for Tas-sp-nicif:

Data Structures

struct  nicif_connection_stats
 

Enumerations

enum  nicif_connection_flags { NICIF_CONN_ECN = (1 << 2) }
 

Functions

int nicif_init (void)
 
unsigned nicif_poll (void)
 
int nicif_appctx_add (uint16_t appid, uint32_t db, uint64_t *rxq_base, uint32_t rxq_len, uint64_t *txq_base, uint32_t txq_len, int evfd)
 
int nicif_connection_add (uint32_t db, uint64_t mac_remote, uint32_t ip_local, uint16_t port_local, uint32_t ip_remote, uint16_t port_remote, uint64_t rx_base, uint32_t rx_len, uint64_t tx_base, uint32_t tx_len, uint32_t remote_seq, uint32_t local_seq, uint64_t app_opaque, uint32_t flags, uint32_t rate, uint32_t fn_core, uint16_t flow_group, uint32_t *pf_id)
 
int nicif_connection_disable (uint32_t f_id, uint32_t *tx_seq, uint32_t *rx_seq, int *tx_closed, int *rx_closed)
 
void nicif_connection_free (uint32_t f_id)
 
int nicif_connection_move (uint32_t dst_db, uint32_t f_id)
 
int nicif_connection_stats (uint32_t f_id, struct nicif_connection_stats *p_stats)
 
int nicif_connection_setrate (uint32_t f_id, uint32_t rate)
 
int nicif_connection_retransmit (uint32_t f_id, uint16_t core)
 
int nicif_tx_alloc (uint16_t len, void **buf, uint32_t *opaque)
 
void nicif_tx_send (uint32_t opaque, int no_ts)
 

Detailed Description

NIC Interface.

Enumeration Type Documentation

◆ nicif_connection_flags

Flags for connections (used in nicif_connection_add())

Enumerator
NICIF_CONN_ECN 

Enable ECN for connection.

Definition at line 112 of file internal.h.

Function Documentation

◆ nicif_appctx_add()

int nicif_appctx_add ( uint16_t  appid,
uint32_t  db,
uint64_t *  rxq_base,
uint32_t  rxq_len,
uint64_t *  txq_base,
uint32_t  txq_len,
int  evfd 
)

Register application context (must be called from poll thread).

Parameters
appidApplication ID
dbDoorbell ID
rxq_baseBase addresses of context receive queue
rxq_lenLength of context receive queue
txq_baseBase addresses of context transmit queue
txq_lenLength of context transmit queue
evfdEvent FD used to ping app
Returns
0 on success, <0 else

Register application context

Definition at line 130 of file nicif.c.

Referenced by appif_poll().

◆ nicif_connection_add()

int nicif_connection_add ( uint32_t  db,
uint64_t  mac_remote,
uint32_t  ip_local,
uint16_t  port_local,
uint32_t  ip_remote,
uint16_t  port_remote,
uint64_t  rx_base,
uint32_t  rx_len,
uint64_t  tx_base,
uint32_t  tx_len,
uint32_t  remote_seq,
uint32_t  local_seq,
uint64_t  app_opaque,
uint32_t  flags,
uint32_t  rate,
uint32_t  fn_core,
uint16_t  flow_group,
uint32_t *  pf_id 
)

Register flow (must be called from poll thread).

Parameters
dbDoorbell ID
mac_remoteMAC address of the remote host
ip_localLocal IP address
port_localLocal port number
ip_remoteRemote IP address
port_remoteRemote port number
rx_baseBase address of circular receive buffer
rx_lenLength of circular receive buffer
tx_baseBase address of circular transmit buffer
tx_lenLength of circular transmit buffer
remote_seqNext sequence number expected from remote host
local_seqNext sequence number for transmission
app_opaqueOpaque value to pass in notificaitions
flagsSee nicif_connection_flags.
rateCongestion rate to set [Kbps]
fn_coreFlexNIC emulator core for the connection
flow_groupFlow group
pf_idPointer to location where flow id should be stored
Returns
0 on success, <0 else

Register flow

Definition at line 175 of file nicif.c.

Referenced by tcp_timeout().

◆ nicif_connection_disable()

int nicif_connection_disable ( uint32_t  f_id,
uint32_t *  tx_seq,
uint32_t *  rx_seq,
int *  tx_closed,
int *  rx_closed 
)

Disable connection fast path (mark as sp'd and remove from hash table).

Parameters
f_idFlow state ID
tx_seqPointer to return last transmit sequence number
rx_seqPointer to return last receive sequence number
tx_closedPointer to return flag that tx stream is closed
rx_closedPointer to return flag that rx stream is closed
Returns
0 on success, <0 else

Definition at line 250 of file nicif.c.

References flextcp_pl_flowst::lock, flextcp_pl_flowst::rx_base_sp, flextcp_pl_flowst::rx_next_seq, and flextcp_pl_flowst::tx_next_seq.

Referenced by tcp_close().

◆ nicif_connection_free()

void nicif_connection_free ( uint32_t  f_id)

Free flow state.

Parameters
f_idFlow state ID

Definition at line 272 of file nicif.c.

Referenced by tcp_timeout().

◆ nicif_connection_move()

int nicif_connection_move ( uint32_t  dst_db,
uint32_t  f_id 
)

Move flow to new db.

Parameters
dst_dbNew doorbell ID
f_idID of flow to be moved
Returns
0 on success, <0 else

Move flow to new db

Definition at line 278 of file nicif.c.

References flextcp_pl_flowst::db_id.

◆ nicif_connection_retransmit()

int nicif_connection_retransmit ( uint32_t  f_id,
uint16_t  flow_group 
)

Mark flow for retransmit after timeout.

Parameters
f_idID of flow
flow_groupFlexNIC flow group
Returns
0 on success, <0 else

Mark flow for retransmit after timeout.

Definition at line 330 of file nicif.c.

Referenced by cc_conn_remove().

◆ nicif_connection_setrate()

int nicif_connection_setrate ( uint32_t  f_id,
uint32_t  rate 
)

Set rate for flow.

Parameters
f_idID of flow
rateRate to set [Kbps]
Returns
0 on success, <0 else

Definition at line 314 of file nicif.c.

References flextcp_pl_flowst::tx_rate.

Referenced by cc_poll().

◆ nicif_connection_stats()

int nicif_connection_stats ( uint32_t  f_id,
struct nicif_connection_stats p_stats 
)

◆ nicif_init()

int nicif_init ( void  )

Initialize NIC interface

Definition at line 85 of file nicif.c.

References flexnic_info::cores_num, flexnic_info::flags, FLEXNIC_FLAG_READY, and packetmem_init().

◆ nicif_poll()

unsigned nicif_poll ( void  )

Poll NIC queues

Definition at line 111 of file nicif.c.

◆ nicif_tx_alloc()

int nicif_tx_alloc ( uint16_t  len,
void **  pbuf,
uint32_t *  opaque 
)

Allocate transmit buffer for raw packet.

TODO: we probably want an asynchronous version of this.

Parameters
lenLength of packet to be sent
bufPointer to location where base address will be stored
opaquePointer to location to store opaque value that needs to be passed to nicif_tx_send().
Returns
0 on success, <0 else

Allocate transmit buffer

Definition at line 352 of file nicif.c.

Referenced by arp_timeout(), kni_poll(), and tcp_timeout().

◆ nicif_tx_send()

void nicif_tx_send ( uint32_t  opaque,
int  no_ts 
)

Actually send out transmit buffer (lens need to match).

Parameters
opaqueOpaque value returned from nicif_tx_alloc().
no_tsIf != 0, skip inserting tcp timestamp
Returns
0 on success, <0 else

Actually send out transmit buffer (lens need to match)

Definition at line 368 of file nicif.c.

Referenced by arp_timeout(), kni_poll(), and tcp_timeout().