FD.io VPP
v17.10-9-gd594711
Vector Packet Processing
|
Functions | |
int | memif_get_queue_efd (memif_conn_handle_t conn, uint16_t qid, int *fd) |
Memif get queue event file descriptor More... | |
int | memif_set_rx_mode (memif_conn_handle_t conn, memif_rx_mode_t rx_mode, uint16_t qid) |
Memif set rx mode. More... | |
char * | memif_strerror (int err_code) |
Memif strerror. 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_init (memif_control_fd_update_t *on_control_fd_update, char *app_name) |
Memif initialization. More... | |
int | memif_cleanup () |
Memif cleanup. More... | |
int | memif_create (memif_conn_handle_t *conn, 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_delete (memif_conn_handle_t *conn) |
Memif delete. More... | |
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_poll_event (int timeout) |
Memif poll event. More... | |
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 | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif buffer alloc.
conn | - memif conenction handle |
qid | - number indentifying queue |
bufs | - memif buffers |
count | - number of memif buffers to allocate |
count_out | - returns number of allocated buffers |
size | - minimal buffer size, 0 = standard buffer size |
Definition at line 1341 of file main.c.
int memif_buffer_free | ( | memif_conn_handle_t | conn, |
uint16_t | qid, | ||
memif_buffer_t * | bufs, | ||
uint16_t | count, | ||
uint16_t * | count_out | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif buffer free.
conn | - memif conenction handle |
qid | - number indentifying queue |
bufs | - memif buffers |
count | - number of memif buffers to free |
count_out | - returns number of freed buffers |
Definition at line 1478 of file main.c.
int memif_cleanup | ( | ) |
#include <extras/libmemif/src/libmemif.h>
Memif cleanup.
Free libmemif internal allocations.
Definition at line 2075 of file main.c.
int memif_control_fd_handler | ( | int | fd, |
uint8_t | events | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif control file descriptor handler.
fd | - file descriptor on which the event occured |
events | - event type(s) that occured |
If event occures on any control fd, call memif_control_fd_handler. Internal - lib will "identify" fd (timerfd, lsitener, control) and handle event accordingly.
FD-TYPE - TIMERFD - Every disconnected memif in slave mode will request connection. LISTENER or CONTROL - Handle socket messaging (internal connection establishment). INTERRUPT - Call on_interrupt callback (if set).
Definition at line 770 of file main.c.
int memif_create | ( | memif_conn_handle_t * | conn, |
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 | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memory interface create function.
conn | - connection handle for user app |
args | - memory interface connection arguments |
on_connect | - inform user about connected status |
on_disconnect | - inform user about disconnected status |
on_interrupt | - informs user about interrupt, if set to null user will not be notified about interrupt, user can use memif_get_queue_efd call to get interrupt fd to poll for events |
private_ctx | - private contex passed back to user with callback |
Creates memory interface.
SLAVE-MODE - Start timer that will send events to timerfd. If this fd is passed to memif_control_fd_handler every disconnected memif in slave mode will send connection request. On success new fd is passed to user with memif_control_fd_update_t.
MASTER-MODE - Create listener socket and pass fd to user with memif_cntrol_fd_update_t. If this fd is passed to memif_control_fd_handler accept will be called and new fd will be passed to user with memif_control_fd_update_t.
Definition at line 526 of file main.c.
int memif_delete | ( | memif_conn_handle_t * | conn | ) |
#include <extras/libmemif/src/libmemif.h>
Memif delete.
conn | - pointer to memif connection handle |
disconnect session (free queues and regions, close file descriptors, unmap shared memory) set connection handle to NULL, to avoid possible double free
Definition at line 1072 of file main.c.
int memif_get_details | ( | memif_conn_handle_t | conn, |
memif_details_t * | md, | ||
char * | buf, | ||
ssize_t | buflen | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif get details.
conn | - memif conenction handle |
md | - pointer to memif details struct |
buf | - buffer containing details strings |
buflen | - length of buffer |
Definition at line 1932 of file main.c.
int memif_get_queue_efd | ( | memif_conn_handle_t | conn, |
uint16_t | qid, | ||
int * | fd | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif get queue event file descriptor
conn | - memif connection handle | |
qid | - queue id | |
[out] | fd | - returns event file descriptor |
Definition at line 2055 of file main.c.
int memif_init | ( | memif_control_fd_update_t * | on_control_fd_update, |
char * | app_name | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif initialization.
on_control_fd_update | - if control fd updates inform user to watch new fd |
app_name | - application name |
if param on_control_fd_update is set to NULL, libmemif will handle file descriptor event polling if a valid callback is set, file descriptor event polling needs to be done by user application, all file descriptors and event types will be passed in this callback to user application
Initialize internal libmemif structures. Create timerfd (used to periodically request connection by disconnected memifs in slave mode, with no additional API call). This fd is passed to user with memif_control_fd_update_t timer is inactive at this state. It activates with if there is at least one memif in slave mode.
Definition at line 400 of file main.c.
int memif_poll_event | ( | int | timeout | ) |
#include <extras/libmemif/src/libmemif.h>
Memif poll event.
timeout | - timeout in seconds |
Passive event polling - timeout = 0 - dont wait for event, check event queue if there is an event and return. timeout = -1 - wait until event
Definition at line 920 of file main.c.
int memif_rx_burst | ( | memif_conn_handle_t | conn, |
uint16_t | qid, | ||
memif_buffer_t * | bufs, | ||
uint16_t | count, | ||
uint16_t * | rx | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif receive buffer burst.
conn | - memif conenction handle |
qid | - number indentifying queue |
bufs | - memif buffers |
count | - number of memif buffers to receive |
rx | - returns number of received buffers |
Definition at line 1768 of file main.c.
int memif_set_rx_mode | ( | memif_conn_handle_t | conn, |
memif_rx_mode_t | rx_mode, | ||
uint16_t | qid | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif set rx mode.
conn | - memif connection handle |
rx_mode | - receive mode |
qid | - queue id |
Definition at line 508 of file main.c.
char* memif_strerror | ( | int | err_code | ) |
#include <extras/libmemif/src/libmemif.h>
Memif strerror.
err_code | - error code |
Converts error code to error message.
Definition at line 148 of file main.c.
int memif_tx_burst | ( | memif_conn_handle_t | conn, |
uint16_t | qid, | ||
memif_buffer_t * | bufs, | ||
uint16_t | count, | ||
uint16_t * | tx | ||
) |
#include <extras/libmemif/src/libmemif.h>
Memif transmit buffer burst.
conn | - memif conenction handle |
qid | - number indentifying queue |
bufs | - memif buffers |
count | - number of memif buffers to transmit |
tx | - returns number of transmitted buffers |
Definition at line 1547 of file main.c.