21 #define MEMIF_DEFAULT_SOCKET_FILENAME "memif.sock" 22 #define MEMIF_DEFAULT_RING_SIZE 1024 23 #define MEMIF_DEFAULT_RX_QUEUES 1 24 #define MEMIF_DEFAULT_TX_QUEUES 1 25 #define MEMIF_DEFAULT_BUFFER_SIZE 2048 27 #define MEMIF_MAX_M2S_RING (vec_len (vlib_mains) - 1) 28 #define MEMIF_MAX_S2M_RING (vec_len (vlib_mains) - 1) 29 #define MEMIF_MAX_REGION 255 30 #define MEMIF_MAX_LOG2_RING_SIZE 14 33 #define memif_file_add(a, b) do { \ 34 *a = clib_file_add (&file_main, b); \ 35 vlib_log_warn ((&memif_main)->log_class, \ 36 "clib_file_add fd %d private_data %u idx %u", \ 37 (b)->file_descriptor, (b)->private_data, *a); \ 40 #define memif_file_del(a) do { \ 41 vlib_log_warn ((&memif_main)->log_class, \ 42 "clib_file_del idx %u",a - file_main.file_pool); \ 43 clib_file_del (&file_main, a); \ 46 #define memif_file_del_by_index(a) do { \ 47 vlib_log_warn ((&memif_main)->log_class, "clib_file_del idx %u", a); \ 48 clib_file_del_by_index (&file_main, a); \ 104 #define foreach_memif_if_flag \ 105 _(0, ADMIN_UP, "admin-up") \ 106 _(1, IS_SLAVE, "slave") \ 107 _(2, CONNECTING, "connecting") \ 108 _(3, CONNECTED, "connected") \ 109 _(4, DELETING, "deleting") \ 110 _(5, ZERO_COPY, "zero-copy") \ 115 #define _(a, b, c) MEMIF_IF_FLAG_##b = (1 << a), 183 #define MEMIF_RX_VECTOR_SZ VLIB_FRAME_SIZE
vlib_log_class_t log_class
vlib_node_registration_t memif_input_node
(constructor) VLIB_REGISTER_NODE (memif_input_node)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
clib_socket_t ** pending_clients
u8 * format_memif_device_name(u8 *s, va_list *args)
memif_socket_file_t * socket_files
memif_log2_ring_size_t log2_ring_size
void memif_disconnect(memif_if_t *mif, clib_error_t *err)
enum @444 memif_process_event_t
uint16_t memif_region_index_t
clib_error_t * memif_msg_send_disconnect(memif_if_t *mif, clib_error_t *err)
int memif_socket_filename_add_del(u8 is_add, u32 sock_id, u8 *sock_filename)
u16 first_buffer_vec_index
struct _vnet_device_class vnet_device_class_t
#define static_always_inline
clib_error_t * memif_master_conn_fd_read_ready(clib_file_t *uf)
memif_log2_ring_size_t log2_ring_size
vnet_device_class_t memif_device_class
u32 per_interface_next_index
memif_region_offset_t offset
u16 msg_id_base
API message ID base.
mhash_t dev_instance_by_id
clib_error_t * memif_master_conn_fd_error(clib_file_t *uf)
memif_region_index_t region
memif_copy_op_t * copy_ops
clib_error_t * memif_master_conn_fd_write_ready(clib_file_t *uf)
int memif_delete_if(vlib_main_t *vm, memif_if_t *mif)
uint32_t memif_region_offset_t
uint8_t memif_log2_ring_size_t
#define foreach_memif_if_flag
uword int_clib_file_index
memif_queue_t * tx_queues
int memif_create_if(vlib_main_t *vm, memif_create_if_args_t *args)
clib_error_t * memif_connect(memif_if_t *mif)
uint32_t memif_interface_id_t
static_always_inline void * memif_get_buffer(memif_if_t *mif, memif_ring_t *ring, u16 slot)
vlib_buffer_t buffer_template
struct _socket_t clib_socket_t
clib_error_t * memif_slave_conn_fd_write_ready(clib_file_t *uf)
clib_error_t * memif_slave_conn_fd_error(clib_file_t *uf)
clib_error_t * memif_slave_conn_fd_read_ready(clib_file_t *uf)
memif_region_offset_t offset
uword * dev_instance_by_fd
struct _vlib_node_registration vlib_node_registration_t
uint64_t memif_region_size_t
#define MEMIF_RX_VECTOR_SZ
void memif_socket_close(clib_socket_t **sock)
clib_error_t * memif_init_regions_and_queues(memif_if_t *mif)
memif_log2_ring_size_t log2_ring_size
clib_error_t * memif_plugin_api_hookup(vlib_main_t *vm)
memif_per_thread_data_t * per_thread_data
memif_queue_t * rx_queues
clib_error_t * memif_conn_fd_accept_ready(clib_file_t *uf)
memif_desc_t desc_template
uword * socket_file_index_by_sock_id
memif_msg_fifo_elt_t * msg_queue
memif_region_index_t region
memif_region_size_t region_size