|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
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 (vlib_get_n_threads ())
28 #define MEMIF_MAX_S2M_RING 256
29 #define MEMIF_MAX_REGION 256
30 #define MEMIF_MAX_LOG2_RING_SIZE 14
33 #define memif_log_debug(dev, f, ...) do { \
34 memif_if_t *_dev = (memif_if_t *) dev; \
36 vlib_log(VLIB_LOG_LEVEL_DEBUG, memif_main.log_class, "%U: " f, \
37 format_vnet_hw_if_index_name, vnet_get_main(), \
38 _dev->hw_if_index, ##__VA_ARGS__); \
40 vlib_log(VLIB_LOG_LEVEL_DEBUG, memif_main.log_class, f, \
44 #define memif_log_warn(dev, f, ...) do { \
45 memif_if_t *_dev = (memif_if_t *) dev; \
47 vlib_log(VLIB_LOG_LEVEL_WARNING, memif_main.log_class, "%U: " f, \
48 format_vnet_hw_if_index_name, vnet_get_main(), \
49 _dev->hw_if_index, ##__VA_ARGS__); \
51 vlib_log(VLIB_LOG_LEVEL_WARNING, memif_main.log_class, f, \
55 #define memif_log_err(dev, f, ...) do { \
56 memif_if_t *_dev = (memif_if_t *) dev; \
58 vlib_log(VLIB_LOG_LEVEL_ERR, memif_main.log_class, "%U: " f, \
59 format_vnet_hw_if_index_name, vnet_get_main(), \
60 _dev->hw_if_index, ##__VA_ARGS__); \
62 vlib_log(VLIB_LOG_LEVEL_ERR, memif_main.log_class, f, \
66 #define memif_file_add(a, b) \
69 *a = clib_file_add (&file_main, b); \
70 memif_log_debug (0, "clib_file_add fd %d private_data %u idx %u", \
71 (b)->file_descriptor, (b)->private_data, *a); \
75 #define memif_file_del(a) \
78 memif_log_debug (0, "clib_file_del idx %u", a - file_main.file_pool); \
79 clib_file_del (&file_main, a); \
83 #define memif_file_del_by_index(a) \
86 memif_log_debug (0, "clib_file_del idx %u", a); \
87 clib_file_del_by_index (&file_main, a); \
147 #define foreach_memif_if_flag \
148 _(0, ADMIN_UP, "admin-up") \
149 _(1, IS_SLAVE, "slave") \
150 _(2, CONNECTING, "connecting") \
151 _(3, CONNECTED, "connected") \
152 _(4, DELETING, "deleting") \
153 _(5, ZERO_COPY, "zero-copy") \
158 #define _(a, b, c) MEMIF_IF_FLAG_##b = (1 << a),
227 #define MEMIF_RX_VECTOR_SZ VLIB_FRAME_SIZE
vlib_node_registration_t memif_input_node
(constructor) VLIB_REGISTER_NODE (memif_input_node)
clib_error_t * memif_init_regions_and_queues(memif_if_t *mif)
memif_interface_mode_t mode
vlib_log_class_t log_class
u8 * format_memif_device_name(u8 *s, va_list *args)
clib_error_t * memif_conn_fd_accept_ready(clib_file_t *uf)
int memif_socket_filename_add_del(u8 is_add, u32 sock_id, u8 *sock_filename)
struct _vnet_device_class vnet_device_class_t
u32 per_interface_next_index
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
memif_queue_t * tx_queues
memif_region_size_t region_size
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)
uint32_t memif_region_offset_t
memif_per_thread_data_t * per_thread_data
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
memif_msg_fifo_elt_t * msg_queue
memif_queue_t * rx_queues
clib_error_t * memif_master_conn_fd_read_ready(clib_file_t *uf)
u16 first_buffer_vec_index
int memif_delete_if(vlib_main_t *vm, memif_if_t *mif)
@ MEMIF_PROCESS_EVENT_START
memif_region_index_t region
#define CLIB_ALIGN_MARK(name, alignment)
memif_log2_ring_size_t log2_ring_size
clib_error_t * memif_msg_send_disconnect(memif_if_t *mif, clib_error_t *err)
clib_socket_t ** pending_clients
clib_error_t * memif_master_conn_fd_error(clib_file_t *uf)
int memif_create_if(vlib_main_t *vm, memif_create_if_args_t *args)
memif_interface_mode_t mode
vnet_device_class_t memif_device_class
memif_region_index_t region
#define static_always_inline
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
#define foreach_memif_if_flag
uint16_t memif_region_index_t
clib_error_t * memif_master_conn_fd_write_ready(clib_file_t *uf)
clib_error_t * memif_connect(memif_if_t *mif)
memif_copy_op_t * copy_ops
struct _vlib_node_registration vlib_node_registration_t
uword * socket_file_index_by_sock_id
clib_error_t * memif_slave_conn_fd_read_ready(clib_file_t *uf)
uint8_t memif_log2_ring_size_t
mhash_t dev_instance_by_id
uint64_t memif_region_size_t
#define MEMIF_RX_VECTOR_SZ
clib_error_t * memif_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
memif_region_offset_t offset
clib_error_t * memif_slave_conn_fd_write_ready(clib_file_t *uf)
clib_error_t * memif_plugin_api_hookup(vlib_main_t *vm)
@ MEMIF_PROCESS_EVENT_STOP
u8 pad[3]
log2 (size of the packing page block)
void memif_socket_close(clib_socket_t **sock)
struct _socket_t clib_socket_t
clib_error_t * memif_slave_conn_fd_error(clib_file_t *uf)
memif_region_offset_t offset
uword * dev_instance_by_fd
memif_log2_ring_size_t log2_ring_size
u16 msg_id_base
API message ID base.
uword int_clib_file_index
@ MEMIF_PROCESS_EVENT_ADMIN_UP_DOWN
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags