FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
main.c File Reference
+ Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define ERRLIST_LEN   36
 
#define MAX_ERRBUF_LEN   256
 
#define MEMIF_MEORY_BARRIER()   __sync_synchronize ()
 
#define MEMIF_ERR_UNDEFINED   "undefined error"
 
#define DBG_TX_BUF   (0)
 
#define DBG_RX_BUF   (1)
 

Functions

char * memif_strerror (int err_code)
 Memif strerror. More...
 
int memif_syscall_error_handler (int err_code)
 
static int memif_add_epoll_fd (int fd, uint32_t events)
 
static int memif_mod_epoll_fd (int fd, uint32_t events)
 
static int memif_del_epoll_fd (int fd)
 
int memif_control_fd_update (int fd, uint8_t events)
 
int add_list_elt (memif_list_elt_t *e, memif_list_elt_t **list, uint16_t *len)
 
int get_list_elt (memif_list_elt_t **e, memif_list_elt_t *list, uint16_t len, int key)
 
int free_list_elt (memif_list_elt_t *list, uint16_t len, int key)
 
int free_list_elt_ctx (memif_list_elt_t *list, uint16_t len, memif_connection_t *ctx)
 
static void memif_control_fd_update_register (memif_control_fd_update_t *cb)
 
int memif_init (memif_control_fd_update_t *on_control_fd_update, char *app_name)
 Memif initialization. More...
 
static memif_ring_tmemif_get_ring (memif_connection_t *conn, memif_ring_type_t type, uint16_t ring_num)
 
int memif_set_rx_mode (memif_conn_handle_t c, memif_rx_mode_t rx_mode, uint16_t qid)
 Memif set rx mode. More...
 
int memif_create (memif_conn_handle_t *c, memif_conn_args_t *args, memif_connection_update_t *on_connect, memif_connection_update_t *on_disconnect, memif_interrupt_t *on_interrupt, void *private_ctx)
 Memory interface create function. More...
 
int memif_control_fd_handler (int fd, uint8_t events)
 Memif control file descriptor handler. More...
 
int memif_poll_event (int timeout)
 Memif poll event. More...
 
static void memif_msg_queue_free (memif_msg_queue_elt_t **e)
 
int memif_disconnect_internal (memif_connection_t *c)
 
int memif_delete (memif_conn_handle_t *conn)
 Memif delete. More...
 
int memif_connect1 (memif_connection_t *c)
 
int memif_init_regions_and_queues (memif_connection_t *conn)
 
int memif_buffer_alloc (memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *count_out, uint16_t size)
 Memif buffer alloc. More...
 
int memif_buffer_free (memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *count_out)
 Memif buffer free. More...
 
int memif_tx_burst (memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *tx)
 Memif transmit buffer burst. More...
 
int memif_rx_burst (memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *rx)
 Memif receive buffer burst. More...
 
int memif_get_details (memif_conn_handle_t conn, memif_details_t *md, char *buf, ssize_t buflen)
 Memif get details. More...
 
int memif_get_queue_efd (memif_conn_handle_t conn, uint16_t qid, int *efd)
 Memif get queue event file descriptor More...
 
int memif_cleanup ()
 Memif cleanup. More...
 

Variables

libmemif_main_t libmemif_main
 
int memif_epfd
 
static char memif_buf [MAX_ERRBUF_LEN]
 
const char * memif_errlist [ERRLIST_LEN]
 

Macro Definition Documentation

#define DBG_RX_BUF   (1)

Definition at line 165 of file main.c.

#define DBG_TX_BUF   (0)

Definition at line 164 of file main.c.

#define ERRLIST_LEN   36

Definition at line 57 of file main.c.

#define MAX_ERRBUF_LEN   256

Definition at line 58 of file main.c.

#define MEMIF_ERR_UNDEFINED   "undefined error"

Definition at line 145 of file main.c.

#define MEMIF_MEORY_BARRIER ( )    __sync_synchronize ()

Definition at line 63 of file main.c.

Function Documentation

int add_list_elt ( memif_list_elt_t e,
memif_list_elt_t **  list,
uint16_t *  len 
)

Definition at line 298 of file main.c.

+ Here is the caller graph for this function:

int free_list_elt ( memif_list_elt_t list,
uint16_t  len,
int  key 
)

Definition at line 356 of file main.c.

+ Here is the caller graph for this function:

int free_list_elt_ctx ( memif_list_elt_t list,
uint16_t  len,
memif_connection_t ctx 
)

Definition at line 373 of file main.c.

+ Here is the caller graph for this function:

int get_list_elt ( memif_list_elt_t **  e,
memif_list_elt_t list,
uint16_t  len,
int  key 
)

Definition at line 333 of file main.c.

+ Here is the caller graph for this function:

static int memif_add_epoll_fd ( int  fd,
uint32_t  events 
)
static

Definition at line 219 of file main.c.

+ Here is the caller graph for this function:

int memif_connect1 ( memif_connection_t c)

Definition at line 1147 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int memif_control_fd_update ( int  fd,
uint8_t  events 
)

Definition at line 280 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void memif_control_fd_update_register ( memif_control_fd_update_t cb)
static

Definition at line 393 of file main.c.

+ Here is the caller graph for this function:

static int memif_del_epoll_fd ( int  fd)
static

Definition at line 261 of file main.c.

+ Here is the caller graph for this function:

int memif_disconnect_internal ( memif_connection_t c)

Definition at line 965 of file main.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static memif_ring_t* memif_get_ring ( memif_connection_t conn,
memif_ring_type_t  type,
uint16_t  ring_num 
)
inlinestatic

Definition at line 493 of file main.c.

+ Here is the caller graph for this function:

int memif_init_regions_and_queues ( memif_connection_t conn)

Definition at line 1213 of file main.c.

+ Here is the call graph for this function:

static int memif_mod_epoll_fd ( int  fd,
uint32_t  events 
)
static

Definition at line 240 of file main.c.

+ Here is the caller graph for this function:

static void memif_msg_queue_free ( memif_msg_queue_elt_t **  e)
static

Definition at line 953 of file main.c.

+ Here is the caller graph for this function:

int memif_syscall_error_handler ( int  err_code)

Definition at line 187 of file main.c.

+ Here is the caller graph for this function:

Variable Documentation

libmemif_main_t libmemif_main

Definition at line 66 of file main.c.

char memif_buf[MAX_ERRBUF_LEN]
static

Definition at line 69 of file main.c.

int memif_epfd

Definition at line 67 of file main.c.

const char* memif_errlist[ERRLIST_LEN]

Definition at line 71 of file main.c.