21 #include <sys/types.h> 23 #include <sys/ioctl.h> 24 #include <sys/socket.h> 28 #include <sys/prctl.h> 29 #include <sys/eventfd.h> 37 #include <vpp/app/version.h> 59 for (i = 0; i <
len; i++)
84 memcpy (dest, src, len);
153 ASSERT ((mif->
flags & MEMIF_IF_FLAG_IS_SLAVE) != 0);
260 if (mif->
flags & MEMIF_IF_FLAG_IS_SLAVE)
505 mif->
sock->private_data, 1);
573 mif->
sock->private_data, 0);
575 &e->
fd, e->
fd > -1 ? 1 : 0);
675 template.file_descriptor = client->fd;
677 template.description =
format (0,
"memif in conn on %s", msf->
filename);
#define memif_log_err(dev, f,...)
memif_version_t max_version
memif_interface_mode_t mode
static clib_error_t * memif_msg_receive_connect(memif_if_t *mif, memif_msg_t *msg)
#define vec_foreach_index(var, v)
Iterate over vector indices.
u8 * format_clib_error(u8 *s, va_list *va)
#define hash_set(h, key, value)
clib_error_t * memif_master_conn_fd_error(clib_file_t *uf)
clib_error_t * memif_conn_fd_accept_ready(clib_file_t *uf)
struct memif_if_t::@674 run
#define clib_fifo_sub2(f, p)
memif_msg_add_region_t add_region
clib_error_t * memif_slave_conn_fd_write_ready(clib_file_t *uf)
clib_socket_t ** pending_clients
static uword clib_fifo_elts(void *v)
#define memif_file_del(a)
static clib_error_t * memif_msg_receive_connected(memif_if_t *mif, memif_msg_t *msg)
static clib_error_t * memif_msg_receive_add_ring(memif_if_t *mif, memif_msg_t *msg, int fd)
memif_socket_file_t * socket_files
memif_log2_ring_size_t log2_ring_size
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
memif_msg_add_ring_t add_ring
#define MEMIF_MSG_ADD_RING_FLAG_S2M
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
memif_region_index_t region
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static uword clib_file_set_data_available_to_write(clib_file_main_t *um, u32 clib_file_index, uword is_available)
memif_version_t min_version
uint16_t private_hdr_size
#define memif_file_del_by_index(a)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
clib_error_t * memif_slave_conn_fd_read_ready(clib_file_t *uf)
void memif_socket_close(clib_socket_t **s)
static clib_error_t * memif_msg_receive(memif_if_t **mifp, clib_socket_t *sock, clib_file_t *uf)
static clib_error_t * memif_msg_receive_hello(memif_if_t *mif, memif_msg_t *msg)
static clib_error_t * clib_socket_sendmsg(clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
static clib_error_t * memif_conn_fd_write_ready(clib_file_t *uf, memif_if_t *mif)
memif_ring_index_t max_m2s_ring
clib_error_t * memif_init_regions_and_queues(memif_if_t *mif)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void memif_msg_snprintf(u8 *dest, u32 len, const char *fmt,...)
#define clib_error_return(e, args...)
clib_file_main_t file_main
static clib_error_t * clib_socket_recvmsg(clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
memif_region_offset_t offset
static void memif_msg_enq_add_region(memif_if_t *mif, u8 region)
#define MEMIF_MAX_M2S_RING
memif_region_offset_t offset
#define memif_file_add(a, b)
#define MEMIF_MAX_LOG2_RING_SIZE
mhash_t dev_instance_by_id
static void memif_msg_enq_init(memif_if_t *mif)
clib_error_t * memif_slave_conn_fd_error(clib_file_t *uf)
static u8 * memif_str2vec(uint8_t *str, int len)
clib_error_t * memif_msg_send_disconnect(memif_if_t *mif, clib_error_t *err)
static void memif_msg_enq_connected(memif_if_t *mif)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
clib_error_t * clib_socket_accept(clib_socket_t *server, clib_socket_t *client)
static clib_error_t * clib_socket_close(clib_socket_t *sock)
memif_msg_disconnect_t disconnect
static clib_error_t * memif_msg_receive_disconnect(memif_if_t *mif, memif_msg_t *msg)
#define vec_del1(v, i)
Delete the element at index I.
uword int_clib_file_index
static void memif_msg_enq_add_ring(memif_if_t *mif, u8 index, u8 direction)
memif_log2_ring_size_t max_log2_ring_size
static clib_error_t * memif_msg_receive_init(memif_if_t **mifp, memif_msg_t *msg, clib_socket_t *sock, uword socket_file_index)
memif_queue_t * tx_queues
clib_error_t * memif_connect(memif_if_t *mif)
static void memif_msg_enq_ack(memif_if_t *mif)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
memif_region_index_t index
clib_error_t * memif_master_conn_fd_write_ready(clib_file_t *uf)
void memif_disconnect(memif_if_t *mif, clib_error_t *err)
memif_log2_ring_size_t log2_ring_size
u8 * format_memif_device_name(u8 *s, va_list *args)
memif_ring_index_t max_s2m_ring
static uword * mhash_get(mhash_t *h, const void *key)
memif_msg_connect_t connect
static void clib_mem_free(void *p)
struct _socket_t clib_socket_t
#define vec_cmp(v1, v2)
Compare two vectors (only applicable to vectors of signed numbers).
static void * clib_mem_alloc(uword size)
static clib_error_t * memif_msg_receive_add_region(memif_if_t *mif, memif_msg_t *msg, int fd)
static void memif_msg_enq_connect(memif_if_t *mif)
uword * dev_instance_by_fd
uint8_t secret[MEMIF_SECRET_SIZE]
static void memif_msg_strlcpy(u8 *dest, u32 len, const u8 *src)
#define MEMIF_MAX_S2M_RING
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define memif_log_warn(dev, f,...)
memif_region_index_t max_region
#define clib_error_free(e)
clib_error_t * memif_master_conn_fd_read_ready(clib_file_t *uf)
memif_log2_ring_size_t log2_ring_size
struct memif_if_t::@673 cfg
#define clib_fifo_add2(f, p)
static clib_error_t * memif_msg_enq_hello(clib_socket_t *sock)
memif_msg_connected_t connected
#define memif_log_debug(dev, f,...)
memif_queue_t * rx_queues
#define CLIB_CACHE_LINE_BYTES
memif_msg_fifo_elt_t * msg_queue
memif_region_index_t region
memif_interface_mode_t mode
memif_region_size_t region_size