|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
26 #define LIBMEMIF_VERSION "3.1"
28 #define MEMIF_DEFAULT_APP_NAME "libmemif-app"
31 #include <sys/types.h>
32 #include <sys/timerfd.h>
33 #include <sys/types.h>
91 #define MEMIF_FD_EVENT_READ (1 << 0)
92 #define MEMIF_FD_EVENT_WRITE (1 << 1)
94 #define MEMIF_FD_EVENT_ERROR (1 << 2)
96 #define MEMIF_FD_EVENT_DEL (1 << 3)
98 #define MEMIF_FD_EVENT_MOD (1 << 4)
207 int *fd,
void *private_ctx);
307 uint8_t interface_name[32];
331 #define MEMIF_BUFFER_FLAG_NEXT (1 << 0)
359 #define MEMIF_QUEUE_FLAG_POLLING 1
476 char *
buf, ssize_t buflen);
599 pt_main,
int fd, uint8_t
events);
627 uint16_t * count_out);
651 uint16_t * count_out, uint16_t
size);
673 uint16_t
count, uint16_t headroom);
736 #define MEMIF_HAVE_CANCEL_POLL_EVENT 1
769 struct itimerspec timer);
809 const char *filename,
void *private_ctx);
void memif_register_external_region(memif_add_external_region_t *ar, memif_get_external_region_addr_t *gr, memif_del_external_region_t *dr, memif_get_external_buffer_offset_t *go)
Register external region.
@ MEMIF_RX_MODE_INTERRUPT
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
int memif_per_thread_create_socket(memif_per_thread_main_handle_t pt_main, memif_socket_handle_t *sock, const char *filename, void *private_ctx)
Create memif socket.
int on_connect(memif_conn_handle_t conn, void *private_ctx)
memif_interface_mode_t mode
void() memif_free_t(void *ptr)
Memif allocator free.
const char * memif_get_socket_filename(memif_socket_handle_t sock)
Get socket filename.
void *() memif_alloc_t(size_t size)
Memif allocator alloc.
uint32_t() memif_get_external_buffer_offset_t(void *private_ctx)
Get external buffer offset (optional)
int memif_per_thread_cleanup(memif_per_thread_main_handle_t *pt_main)
Memif per thread cleanup.
int memif_per_thread_poll_event(memif_per_thread_main_handle_t pt_main, int timeout)
Memif per thread poll event.
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.
@ MEMIF_INTERFACE_MODE_IP
Memif connection arguments.
int memif_buffer_enq_tx(memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *bufs, uint16_t count, uint16_t *count_out)
Memif buffer enq tx.
void * memif_per_thread_main_handle_t
Memif per thread main handle Pointer of type void, pointing to internal structure.
int memif_get_details(memif_conn_handle_t conn, memif_details_t *md, char *buf, ssize_t buflen)
Memif get details.
memif_queue_details_t * tx_queues
int on_disconnect(memif_conn_handle_t conn, void *private_ctx)
int memif_request_connection(memif_conn_handle_t conn)
Send connection request.
int on_interrupt(memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
int memif_init(memif_control_fd_update_t *on_control_fd_update, char *app_name, memif_alloc_t *memif_alloc, memif_realloc_t *memif_realloc, memif_free_t *memif_free)
Memif initialization.
@ MEMIF_INTERFACE_MODE_PUNT_INJECT
int memif_cancel_poll_event()
int memif_create_socket(memif_socket_handle_t *sock, const char *filename, void *private_ctx)
Create memif socket.
int memif_delete_socket(memif_socket_handle_t *sock)
Delete memif socket.
int() memif_add_external_region_t(void **addr, uint32_t size, int *fd, void *private_ctx)
Add external region.
void * memif_socket_handle_t
Memif socket handle pointer of type void, pointing to internal structure.
@ MEMIF_ERR_FILE_NOT_SOCK
uint16_t memif_get_version()
Memif get version.
int memif_per_thread_init(memif_per_thread_main_handle_t *pt_main, void *private_ctx, memif_control_fd_update_t *on_control_fd_update, char *app_name, memif_alloc_t *memif_alloc, memif_realloc_t *memif_realloc, memif_free_t *memif_free)
Memif per thread initialization.
int memif_per_thread_set_connection_request_timer(memif_per_thread_main_handle_t pt_main, struct itimerspec timer)
Set connection request timer value.
uint8_t * remote_inst_name
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.
int() memif_connection_update_t(memif_conn_handle_t conn, void *private_ctx)
Memif connection status update (callback function)
void *() memif_realloc_t(void *ptr, size_t size)
Memif realloc.
static perfmon_event_t events[]
int memif_set_rx_mode(memif_conn_handle_t conn, memif_rx_mode_t rx_mode, uint16_t qid)
Memif set rx mode.
int memif_cleanup()
Memif cleanup.
int memif_per_thread_cancel_poll_event(memif_per_thread_main_handle_t pt_main)
Send signal to stop concurrently running memif_poll_event().
int() memif_del_external_region_t(void *addr, uint32_t size, int fd, void *private_ctx)
Delete external region.
memif_socket_handle_t socket
int memif_set_next_free_buffer(memif_conn_handle_t conn, uint16_t qid, memif_buffer_t *buf)
Memif set next free buffer.
void * memif_conn_handle_t
Memif connection handle pointer of type void, pointing to internal structure.
int memif_get_queue_efd(memif_conn_handle_t conn, uint16_t qid, int *fd)
Memif get queue event file descriptor.
int() memif_control_fd_update_t(int fd, uint8_t events, void *private_ctx)
Memif control file descriptor update (callback function)
uint8_t * socket_filename
memif_region_details_t * regions
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.
int memif_control_fd_handler(int fd, uint8_t events)
Memif control file descriptor handler.
void *() memif_get_external_region_addr_t(uint32_t size, int fd, void *private_ctx)
Get external region address.
int memif_per_thread_control_fd_handler(memif_per_thread_main_handle_t pt_main, int fd, uint8_t events)
Memif per thread control file descriptor handler.
int memif_set_connection_request_timer(struct itimerspec timer)
Set connection request timer value.
int memif_delete(memif_conn_handle_t *conn)
Memif delete.
@ MEMIF_ERR_PROC_FILE_LIMIT
@ MEMIF_INTERFACE_MODE_ETHERNET
int memif_buffer_requeue(memif_conn_handle_t conn, memif_buffer_t *buf_a, memif_buffer_t *buf_b)
Memif buffer enq tx at idx.
int() memif_interrupt_t(memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
Memif interrupt occurred (callback function)
char * memif_strerror(int err_code)
Memif strerror.
memif_queue_details_t * rx_queues
int memif_poll_event(int timeout)
Memif poll event.
int memif_refill_queue(memif_conn_handle_t conn, uint16_t qid, uint16_t count, uint16_t headroom)
Memif refill queue.
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.