21 #define MEMIF_VERSION_MAJOR 0 22 #define MEMIF_VERSION_MINOR 1 23 #define MEMIF_VERSION ((MEMIF_VERSION_MAJOR << 8) | MEMIF_VERSION_MINOR) 25 #define MEMIF_MSG_TYPE_CONNECT_REQ 0 26 #define MEMIF_MSG_TYPE_CONNECT_RESP 1 27 #define MEMIF_MSG_TYPE_DISCONNECT 2 32 #define MEMIF_DEFAULT_RING_SIZE 1024 36 #define MEMIF_DEFAULT_BUFFER_SIZE 2048 43 typedef struct __attribute__ ((packed))
46 #define MEMIF_DESC_FLAG_NEXT (1 << 0) 59 u16 head __attribute__ ((aligned (128)));
60 u16 tail __attribute__ ((aligned (128)));
66 u32 cookie __attribute__ ((aligned (128)));
103 #define MEMIF_IF_FLAG_ADMIN_UP (1 << 0) 104 #define MEMIF_IF_FLAG_IS_SLAVE (1 << 1) 105 #define MEMIF_IF_FLAG_CONNECTING (1 << 2) 106 #define MEMIF_IF_FLAG_CONNECTED (1 << 3) 107 #define MEMIF_IF_FLAG_DELETING (1 << 4) 168 #define MEMIF_DEFAULT_SOCKET_FILENAME "/var/vpp/memif.sock" 200 #ifndef __NR_memfd_create 201 #if defined __x86_64__ 202 #define __NR_memfd_create 319 203 #elif defined __arm__ 204 #define __NR_memfd_create 385 205 #elif defined __aarch64__ 206 #define __NR_memfd_create 279 208 #error "__NR_memfd_create unknown for this architecture" 215 return syscall (__NR_memfd_create, name, flags);
246 #ifndef F_LINUX_SPECIFIC_BASE 247 #define F_LINUX_SPECIFIC_BASE 1024 249 #define MFD_ALLOW_SEALING 0x0002U 250 #define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9) 251 #define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10) 253 #define F_SEAL_SEAL 0x0001 254 #define F_SEAL_SHRINK 0x0002 255 #define F_SEAL_GROW 0x0004 256 #define F_SEAL_WRITE 0x0008
uword * pending_input_bitmap
STATIC_ASSERT_SIZEOF(memif_desc_t, 32)
static int memfd_create(const char *name, unsigned int flags)
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
static_always_inline void * memif_get_buffer(memif_if_t *mif, memif_ring_t *ring, u16 slot)
vlib_node_registration_t memif_input_node
(constructor) VLIB_REGISTER_NODE (memif_input_node)
struct _vlib_node_registration vlib_node_registration_t
int memif_delete_if(vlib_main_t *vm, u64 key)
struct _vnet_device_class vnet_device_class_t
enum @288 memif_process_event_t
memif_pending_conn_t * pending_conns
#define static_always_inline
memif_file_t interrupt_line
u32 per_interface_next_index
u16 msg_id_base
API message ID base.
u32 input_cpu_first_index
u8 * default_socket_filename
void memif_disconnect(vlib_main_t *vm, memif_if_t *mif)
clib_error_t * memif_plugin_api_hookup(vlib_main_t *vm)
memif_ring_data_t * ring_data
memif_listener_t * listeners
vnet_device_class_t memif_device_class
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static_always_inline memif_ring_t * memif_get_ring(memif_if_t *mif, memif_ring_type_t type, u16 ring_num)
int memif_create_if(vlib_main_t *vm, memif_create_if_args_t *args)