FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
private.h File Reference
+ Include dependency graph for private.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  memif_socket_file_t
 
struct  memif_region_t
 
struct  memif_msg_fifo_elt_t
 
struct  memif_queue_t
 
struct  memif_if_t
 
struct  memif_packet_op_t
 
struct  memif_copy_op_t
 
struct  memif_per_thread_data_t
 
struct  memif_main_t
 
struct  memif_create_if_args_t
 

Macros

#define MEMIF_DEFAULT_SOCKET_FILENAME   "memif.sock"
 
#define MEMIF_DEFAULT_RING_SIZE   1024
 
#define MEMIF_DEFAULT_RX_QUEUES   1
 
#define MEMIF_DEFAULT_TX_QUEUES   1
 
#define MEMIF_DEFAULT_BUFFER_SIZE   2048
 
#define MEMIF_MAX_M2S_RING   (vec_len (vlib_mains))
 
#define MEMIF_MAX_S2M_RING   256
 
#define MEMIF_MAX_REGION   256
 
#define MEMIF_MAX_LOG2_RING_SIZE   14
 
#define memif_log_debug(dev, f, ...)
 
#define memif_log_warn(dev, f, ...)
 
#define memif_log_err(dev, f, ...)
 
#define memif_file_add(a, b)
 
#define memif_file_del(a)
 
#define memif_file_del_by_index(a)
 
#define foreach_memif_if_flag
 
#define MEMIF_RX_VECTOR_SZ   VLIB_FRAME_SIZE
 

Enumerations

enum  memif_if_flag_t { foreach_memif_if_flag }
 
enum  { MEMIF_PROCESS_EVENT_START = 1, MEMIF_PROCESS_EVENT_STOP = 2 }
 

Functions

int memif_socket_filename_add_del (u8 is_add, u32 sock_id, u8 *sock_filename)
 
int memif_create_if (vlib_main_t *vm, memif_create_if_args_t *args)
 
int memif_delete_if (vlib_main_t *vm, memif_if_t *mif)
 
clib_error_tmemif_plugin_api_hookup (vlib_main_t *vm)
 
static_always_inline void * memif_get_buffer (memif_if_t *mif, memif_ring_t *ring, u16 slot)
 
clib_error_tmemif_init_regions_and_queues (memif_if_t *mif)
 
clib_error_tmemif_connect (memif_if_t *mif)
 
void memif_disconnect (memif_if_t *mif, clib_error_t *err)
 
void memif_socket_close (clib_socket_t **sock)
 
clib_error_tmemif_conn_fd_accept_ready (clib_file_t *uf)
 
clib_error_tmemif_master_conn_fd_read_ready (clib_file_t *uf)
 
clib_error_tmemif_slave_conn_fd_read_ready (clib_file_t *uf)
 
clib_error_tmemif_master_conn_fd_write_ready (clib_file_t *uf)
 
clib_error_tmemif_slave_conn_fd_write_ready (clib_file_t *uf)
 
clib_error_tmemif_master_conn_fd_error (clib_file_t *uf)
 
clib_error_tmemif_slave_conn_fd_error (clib_file_t *uf)
 
clib_error_tmemif_msg_send_disconnect (memif_if_t *mif, clib_error_t *err)
 
u8format_memif_device_name (u8 *s, va_list *args)
 

Variables

memif_main_t memif_main
 
vnet_device_class_t memif_device_class
 
vlib_node_registration_t memif_input_node
 (constructor) VLIB_REGISTER_NODE (memif_input_node) More...
 
enum { ... }  memif_process_event_t
 

Macro Definition Documentation

◆ foreach_memif_if_flag

#define foreach_memif_if_flag
Value:
_(0, ADMIN_UP, "admin-up") \
_(1, IS_SLAVE, "slave") \
_(2, CONNECTING, "connecting") \
_(3, CONNECTED, "connected") \
_(4, DELETING, "deleting") \
_(5, ZERO_COPY, "zero-copy") \
_(6, ERROR, "error")

Definition at line 136 of file private.h.

◆ MEMIF_DEFAULT_BUFFER_SIZE

#define MEMIF_DEFAULT_BUFFER_SIZE   2048

Definition at line 25 of file private.h.

◆ MEMIF_DEFAULT_RING_SIZE

#define MEMIF_DEFAULT_RING_SIZE   1024

Definition at line 22 of file private.h.

◆ MEMIF_DEFAULT_RX_QUEUES

#define MEMIF_DEFAULT_RX_QUEUES   1

Definition at line 23 of file private.h.

◆ MEMIF_DEFAULT_SOCKET_FILENAME

#define MEMIF_DEFAULT_SOCKET_FILENAME   "memif.sock"

Definition at line 21 of file private.h.

◆ MEMIF_DEFAULT_TX_QUEUES

#define MEMIF_DEFAULT_TX_QUEUES   1

Definition at line 24 of file private.h.

◆ memif_file_add

#define memif_file_add (   a,
 
)
Value:
do { \
memif_log_warn (0, "clib_file_add fd %d private_data %u idx %u", \
(b)->file_descriptor, (b)->private_data, *a); \
} while (0)
a
Definition: bitmap.h:538
clib_file_main_t file_main
Definition: main.c:63
static uword clib_file_add(clib_file_main_t *um, clib_file_t *template)
Definition: file.h:96

Definition at line 66 of file private.h.

◆ memif_file_del

#define memif_file_del (   a)
Value:
do { \
memif_log_warn (0, "clib_file_del idx %u", a - file_main.file_pool); \
clib_file_del (&file_main, a); \
} while (0)
a
Definition: bitmap.h:538
clib_file_t * file_pool
Definition: file.h:88
clib_file_main_t file_main
Definition: main.c:63

Definition at line 72 of file private.h.

◆ memif_file_del_by_index

#define memif_file_del_by_index (   a)
Value:
do { \
memif_log_warn (0, "clib_file_del idx %u", a); \
clib_file_del_by_index (&file_main, a); \
} while (0)
a
Definition: bitmap.h:538
clib_file_main_t file_main
Definition: main.c:63

Definition at line 77 of file private.h.

◆ memif_log_debug

#define memif_log_debug (   dev,
  f,
  ... 
)
Value:
do { \
memif_if_t *_dev = (memif_if_t *) dev; \
if (_dev) \
vlib_log(VLIB_LOG_LEVEL_DEBUG, memif_main.log_class, "%U: " f, \
_dev->hw_if_index, ##__VA_ARGS__); \
vlib_log(VLIB_LOG_LEVEL_DEBUG, memif_main.log_class, f, \
##__VA_ARGS__); \
} while (0)
vlib_log_class_t log_class
Definition: private.h:249
format_function_t format_vnet_hw_if_index_name
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
void vlib_log(vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
Definition: log.c:138
memif_main_t memif_main
Definition: memif.c:43

Definition at line 33 of file private.h.

◆ memif_log_err

#define memif_log_err (   dev,
  f,
  ... 
)
Value:
do { \
memif_if_t *_dev = (memif_if_t *) dev; \
if (_dev) \
vlib_log(VLIB_LOG_LEVEL_ERR, memif_main.log_class, "%U: " f, \
_dev->hw_if_index, ##__VA_ARGS__); \
vlib_log(VLIB_LOG_LEVEL_ERR, memif_main.log_class, f, \
##__VA_ARGS__); \
} while (0)
vlib_log_class_t log_class
Definition: private.h:249
format_function_t format_vnet_hw_if_index_name
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
void vlib_log(vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
Definition: log.c:138
memif_main_t memif_main
Definition: memif.c:43

Definition at line 55 of file private.h.

◆ memif_log_warn

#define memif_log_warn (   dev,
  f,
  ... 
)
Value:
do { \
memif_if_t *_dev = (memif_if_t *) dev; \
if (_dev) \
vlib_log(VLIB_LOG_LEVEL_WARNING, memif_main.log_class, "%U: " f, \
_dev->hw_if_index, ##__VA_ARGS__); \
vlib_log(VLIB_LOG_LEVEL_WARNING, memif_main.log_class, f, \
##__VA_ARGS__); \
} while (0)
vlib_log_class_t log_class
Definition: private.h:249
format_function_t format_vnet_hw_if_index_name
vnet_main_t * vnet_get_main(void)
Definition: misc.c:47
void vlib_log(vlib_log_level_t level, vlib_log_class_t class, char *fmt,...)
Definition: log.c:138
memif_main_t memif_main
Definition: memif.c:43

Definition at line 44 of file private.h.

◆ MEMIF_MAX_LOG2_RING_SIZE

#define MEMIF_MAX_LOG2_RING_SIZE   14

Definition at line 30 of file private.h.

◆ MEMIF_MAX_M2S_RING

#define MEMIF_MAX_M2S_RING   (vec_len (vlib_mains))

Definition at line 27 of file private.h.

◆ MEMIF_MAX_REGION

#define MEMIF_MAX_REGION   256

Definition at line 29 of file private.h.

◆ MEMIF_MAX_S2M_RING

#define MEMIF_MAX_S2M_RING   256

Definition at line 28 of file private.h.

◆ MEMIF_RX_VECTOR_SZ

#define MEMIF_RX_VECTOR_SZ   VLIB_FRAME_SIZE

Definition at line 216 of file private.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MEMIF_PROCESS_EVENT_START 
MEMIF_PROCESS_EVENT_STOP 

Definition at line 257 of file private.h.

◆ memif_if_flag_t

Enumerator
foreach_memif_if_flag 

Definition at line 145 of file private.h.

Function Documentation

◆ format_memif_device_name()

u8* format_memif_device_name ( u8 s,
va_list *  args 
)

Definition at line 51 of file device.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_conn_fd_accept_ready()

clib_error_t* memif_conn_fd_accept_ready ( clib_file_t uf)

Definition at line 649 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_connect()

clib_error_t* memif_connect ( memif_if_t mif)

Definition at line 186 of file memif.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_create_if()

int memif_create_if ( vlib_main_t vm,
memif_create_if_args_t args 
)

Definition at line 778 of file memif.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_delete_if()

int memif_delete_if ( vlib_main_t vm,
memif_if_t mif 
)

Definition at line 698 of file memif.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_disconnect()

void memif_disconnect ( memif_if_t mif,
clib_error_t err 
)

Definition at line 69 of file memif.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_get_buffer()

static_always_inline void* memif_get_buffer ( memif_if_t mif,
memif_ring_t ring,
u16  slot 
)

Definition at line 289 of file private.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_init_regions_and_queues()

clib_error_t* memif_init_regions_and_queues ( memif_if_t mif)

Definition at line 303 of file memif.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_master_conn_fd_error()

clib_error_t* memif_master_conn_fd_error ( clib_file_t uf)

Definition at line 610 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_master_conn_fd_read_ready()

clib_error_t* memif_master_conn_fd_read_ready ( clib_file_t uf)

Definition at line 506 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_master_conn_fd_write_ready()

clib_error_t* memif_master_conn_fd_write_ready ( clib_file_t uf)

Definition at line 571 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_msg_send_disconnect()

clib_error_t* memif_msg_send_disconnect ( memif_if_t mif,
clib_error_t err 
)

Definition at line 190 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_plugin_api_hookup()

clib_error_t* memif_plugin_api_hookup ( vlib_main_t vm)

Definition at line 374 of file memif_api.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_slave_conn_fd_error()

clib_error_t* memif_slave_conn_fd_error ( clib_file_t uf)

Definition at line 596 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_slave_conn_fd_read_ready()

clib_error_t* memif_slave_conn_fd_read_ready ( clib_file_t uf)

Definition at line 545 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_slave_conn_fd_write_ready()

clib_error_t* memif_slave_conn_fd_write_ready ( clib_file_t uf)

Definition at line 588 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_socket_close()

void memif_socket_close ( clib_socket_t **  sock)

Definition at line 43 of file socket.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_socket_filename_add_del()

int memif_socket_filename_add_del ( u8  is_add,
u32  sock_id,
u8 sock_filename 
)

Definition at line 619 of file memif.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ memif_device_class

vnet_device_class_t memif_device_class

◆ memif_input_node

vlib_node_registration_t memif_input_node

(constructor) VLIB_REGISTER_NODE (memif_input_node)

Definition at line 913 of file node.c.

◆ memif_main

memif_main_t memif_main

Definition at line 43 of file memif.c.

◆ memif_process_event_t

enum { ... } memif_process_event_t