|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
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>
153 ASSERT ((mif->
flags & MEMIF_IF_FLAG_IS_SLAVE) != 0);
260 if (mif->
flags & MEMIF_IF_FLAG_IS_SLAVE)
272 if (
i->mode != mif->
mode)
505 mif->
sock->private_data, 1);
573 mif->
sock->private_data, 0);
575 &e->
fd, e->
fd > -1 ? 1 : 0);
676 template.file_descriptor = client->fd;
678 template.description =
format (0,
"memif in conn on %s", msf->
filename);
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
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_MSG_TYPE_DISCONNECT
memif_region_offset_t offset
clib_file_main_t file_main
#define hash_set(h, key, value)
static clib_error_t * memif_msg_receive(memif_if_t **mifp, clib_socket_t *sock, clib_file_t *uf)
#define memif_log_debug(dev, f,...)
memif_msg_add_ring_t add_ring
static clib_error_t * memif_msg_enq_hello(clib_socket_t *sock)
static void memif_msg_enq_add_ring(memif_if_t *mif, u8 index, u8 direction)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
memif_queue_t * tx_queues
memif_region_size_t region_size
static uword clib_fifo_elts(void *v)
static clib_error_t * clib_socket_recvmsg(clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
static void clib_mem_free(void *p)
clib_error_t * memif_master_conn_fd_read_ready(clib_file_t *uf)
memif_socket_file_t * socket_files
#define clib_error_return(e, args...)
clib_error_t * memif_master_conn_fd_error(clib_file_t *uf)
memif_msg_connect_t connect
clib_error_t * memif_master_conn_fd_write_ready(clib_file_t *uf)
static uword * mhash_get(mhash_t *h, const void *key)
memif_msg_fifo_elt_t * msg_queue
clib_error_t * memif_init_regions_and_queues(memif_if_t *mif)
memif_queue_t * rx_queues
static clib_error_t * memif_msg_receive_disconnect(memif_if_t *mif, memif_msg_t *msg)
@ MEMIF_MSG_TYPE_CONNECTED
#define memif_file_del(a)
vnet_hw_if_output_node_runtime_t * r
@ MEMIF_MSG_TYPE_ADD_RING
#define vec_cmp(v1, v2)
Compare two vectors (only applicable to vectors of signed numbers).
clib_error_t * memif_conn_fd_accept_ready(clib_file_t *uf)
memif_log2_ring_size_t log2_ring_size
__clib_export u8 * format_clib_error(u8 *s, va_list *va)
void memif_socket_close(clib_socket_t **s)
#define memif_file_del_by_index(a)
#define MEMIF_MAX_LOG2_RING_SIZE
static void memif_msg_enq_init(memif_if_t *mif)
clib_error_t * memif_slave_conn_fd_error(clib_file_t *uf)
clib_socket_t ** pending_clients
struct memif_if_t::@729 run
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
struct memif_if_t::@728 cfg
void memif_disconnect(memif_if_t *mif, clib_error_t *err)
static void memif_msg_enq_connected(memif_if_t *mif)
@ MEMIF_MSG_TYPE_ADD_REGION
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define MEMIF_MAX_M2S_RING
memif_interface_mode_t mode
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static clib_error_t * clib_socket_close(clib_socket_t *sock)
memif_region_index_t region
memif_region_index_t region
static u8 * memif_str2vec(uint8_t *str, int len)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static clib_error_t * memif_msg_receive_add_region(memif_if_t *mif, memif_msg_t *msg, int fd)
#define vec_foreach_index(var, v)
Iterate over vector indices.
static clib_error_t * clib_socket_sendmsg(clib_socket_t *s, void *msg, int msglen, int fds[], int num_fds)
memif_version_t min_version
uint16_t private_hdr_size
u8 * format_memif_device_name(u8 *s, va_list *args)
static uword clib_file_set_data_available_to_write(clib_file_main_t *um, u32 clib_file_index, uword is_available)
static clib_error_t * memif_msg_receive_add_ring(memif_if_t *mif, memif_msg_t *msg, int fd)
#define memif_file_add(a, b)
static clib_error_t * memif_conn_fd_write_ready(clib_file_t *uf, memif_if_t *mif)
clib_error_t * memif_connect(memif_if_t *mif)
#define CLIB_CACHE_LINE_BYTES
static void memif_msg_snprintf(u8 *dest, u32 len, const char *fmt,...)
clib_error_t * memif_slave_conn_fd_write_ready(clib_file_t *uf)
#define vec_free(V)
Free vector's memory (no header).
mhash_t dev_instance_by_id
clib_error_t * memif_msg_send_disconnect(memif_if_t *mif, clib_error_t *err)
#define MEMIF_MSG_ADD_RING_FLAG_S2M
static void memif_msg_strlcpy(u8 *dest, u32 len, const u8 *src)
description fragment has unexpected format
memif_version_t max_version
clib_error_t * memif_slave_conn_fd_read_ready(clib_file_t *uf)
memif_msg_add_region_t add_region
#define clib_fifo_add2(f, p)
memif_msg_connected_t connected
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
memif_region_offset_t offset
static clib_error_t * memif_msg_receive_connected(memif_if_t *mif, memif_msg_t *msg)
memif_msg_disconnect_t disconnect
static void memif_msg_enq_add_region(memif_if_t *mif, u8 region)
memif_log2_ring_size_t log2_ring_size
#define memif_log_warn(dev, f,...)
#define clib_error_free(e)
static void memif_msg_enq_ack(memif_if_t *mif)
static clib_error_t * memif_msg_receive_connect(memif_if_t *mif, memif_msg_t *msg)
struct _socket_t clib_socket_t
#define clib_fifo_sub2(f, p)
uword * dev_instance_by_fd
#define memif_log_err(dev, f,...)
memif_log2_ring_size_t log2_ring_size
memif_region_index_t index
#define MEMIF_MAX_S2M_RING
static void * clib_mem_alloc(uword size)
#define vec_del1(v, i)
Delete the element at index I.
uword int_clib_file_index
__clib_export clib_error_t * clib_socket_accept(clib_socket_t *server, clib_socket_t *client)
static void memif_msg_enq_connect(memif_if_t *mif)
static clib_error_t * memif_msg_receive_hello(memif_if_t *mif, memif_msg_t *msg)