20 #define MEMIF_DEFAULT_SOCKET_DIR "/run/vpp" 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 35 #define DBG(...) clib_warning(__VA_ARGS__) 36 #define DBG_UNIX_LOG(...) clib_unix_warning(__VA_ARGS__) 39 #define DBG_UNIX_LOG(...) 43 #define memif_file_add(a, b) do { \ 45 *a = unix_file_add (&unix_main, b); \ 46 clib_warning ("unix_file_add fd %d private_data %u idx %u", \ 47 (b)->file_descriptor, (b)->private_data, *a); \ 50 #define memif_file_del(a) do { \ 51 clib_warning ("unix_file_del idx %u",a - unix_main.file_pool); \ 52 unix_file_del (&unix_main, a); \ 55 #define memif_file_del_by_index(a) do { \ 56 clib_warning ("unix_file_del idx %u", a); \ 57 unix_file_del_by_index (&unix_main, a); \ 60 #define memif_file_add(a, b) do { \ 62 *a = unix_file_add (&unix_main, b); \ 64 #define memif_file_del(a) unix_file_del(&unix_main, a) 65 #define memif_file_del_by_index(a) unix_file_del_by_index(&unix_main, a) 114 #define foreach_memif_if_flag \ 115 _(0, ADMIN_UP, "admin-up") \ 116 _(1, IS_SLAVE, "slave") \ 117 _(2, CONNECTING, "connecting") \ 118 _(3, CONNECTED, "connected") \ 119 _(4, DELETING, "deleting") 123 #define _(a, b, c) MEMIF_IF_FLAG_##b = (1 << a), 232 #ifndef __NR_memfd_create 233 #if defined __x86_64__ 234 #define __NR_memfd_create 319 235 #elif defined __arm__ 236 #define __NR_memfd_create 385 237 #elif defined __aarch64__ 238 #define __NR_memfd_create 279 240 #error "__NR_memfd_create unknown for this architecture" 247 return syscall (__NR_memfd_create, name, flags);
257 #ifndef F_LINUX_SPECIFIC_BASE 258 #define F_LINUX_SPECIFIC_BASE 1024 260 #define MFD_ALLOW_SEALING 0x0002U 261 #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) 262 #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) 264 #define F_SEAL_SEAL 0x0001 265 #define F_SEAL_SHRINK 0x0002 266 #define F_SEAL_GROW 0x0004 267 #define F_SEAL_WRITE 0x0008
uint64_t memif_region_offset_t
vlib_node_registration_t memif_input_node
(constructor) VLIB_REGISTER_NODE (memif_input_node)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
u8 * format_memif_device_name(u8 *s, va_list *args)
mhash_t socket_file_index_by_filename
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)
struct _vlib_node_registration vlib_node_registration_t
clib_error_t * memif_slave_conn_fd_write_ready(unix_file_t *uf)
clib_error_t * memif_msg_send_disconnect(memif_if_t *mif, clib_error_t *err)
uint16_t memif_region_index_t
struct _vnet_device_class vnet_device_class_t
#define static_always_inline
memif_log2_ring_size_t log2_ring_size
vnet_device_class_t memif_device_class
u32 per_interface_next_index
static int memfd_create(const char *name, unsigned int flags)
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(unix_file_t *uf)
memif_region_index_t region
clib_error_t * memif_slave_conn_fd_error(unix_file_t *uf)
int memif_delete_if(vlib_main_t *vm, memif_if_t *mif)
#define foreach_memif_if_flag
memif_queue_t * tx_queues
uint64_t memif_region_size_t
uint32_t memif_interface_id_t
int memif_create_if(vlib_main_t *vm, memif_create_if_args_t *args)
clib_error_t * memif_connect(memif_if_t *mif)
enum @329 memif_process_event_t
clib_error_t * memif_conn_fd_accept_ready(unix_file_t *uf)
static_always_inline void * memif_get_buffer(memif_if_t *mif, memif_ring_t *ring, u16 slot)
uword conn_unix_file_index
memif_region_offset_t offset
clib_error_t * memif_master_conn_fd_write_ready(unix_file_t *uf)
uword * dev_instance_by_fd
clib_error_t * memif_master_conn_fd_read_ready(unix_file_t *uf)
uword int_unix_file_index
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_queue_t * rx_queues
clib_error_t * memif_slave_conn_fd_read_ready(unix_file_t *uf)
uword * pending_file_indices
memif_msg_fifo_elt_t * msg_queue
uint8_t memif_log2_ring_size_t
memif_region_index_t region
memif_region_size_t region_size