FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
memif_private.h File Reference
+ Include dependency graph for memif_private.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  memif_region_t
 
struct  memif_queue_t
 
struct  memif_msg_queue_elt
 
struct  memif_conn_run_args_t
 
struct  memif_connection
 
struct  memif_list_elt_t
 
struct  memif_socket_t
 
struct  libmemif_main
 

Macros

#define MEMIF_NAME_LEN   32
 
#define MEMIF_DEFAULT_SOCKET_PATH   "/run/vpp/memif.sock"
 
#define MEMIF_DEFAULT_RING_SIZE   1024
 
#define MEMIF_DEFAULT_LOG2_RING_SIZE   10
 
#define MEMIF_DEFAULT_RX_QUEUES   1
 
#define MEMIF_DEFAULT_TX_QUEUES   1
 
#define MEMIF_DEFAULT_BUFFER_SIZE   2048
 
#define MEMIF_DEFAULT_RECONNECT_PERIOD_SEC   2
 
#define MEMIF_DEFAULT_RECONNECT_PERIOD_NSEC   0
 
#define MEMIF_MAX_M2S_RING   255
 
#define MEMIF_MAX_S2M_RING   255
 
#define MEMIF_MAX_REGION   255
 
#define MEMIF_MAX_LOG2_RING_SIZE   14
 
#define MEMIF_MAX_FDS   512
 
#define memif_min(a, b)   (((a) < (b)) ? (a) : (b))
 
#define EXPECT_TRUE(x)   __builtin_expect((x),1)
 
#define EXPECT_FALSE(x)   __builtin_expect((x),0)
 
#define DBG(...)
 
#define MEMIF_CONNECTION_FLAG_WRITE   (1 << 0)
 
#define F_LINUX_SPECIFIC_BASE   1024
 
#define MFD_ALLOW_SEALING   0x0002U
 
#define F_ADD_SEALS   (F_LINUX_SPECIFIC_BASE + 9)
 
#define F_GET_SEALS   (F_LINUX_SPECIFIC_BASE + 10)
 
#define F_SEAL_SEAL   0x0001 /* prevent further seals from being set */
 
#define F_SEAL_SHRINK   0x0002 /* prevent file from shrinking */
 
#define F_SEAL_GROW   0x0004 /* prevent file from growing */
 
#define F_SEAL_WRITE   0x0008 /* prevent writes */
 

Typedefs

typedef struct memif_msg_queue_elt memif_msg_queue_elt_t
 
typedef struct memif_connection memif_connection_t
 
typedef int() memif_fn(memif_connection_t *conn)
 
typedef struct libmemif_main libmemif_main_t
 

Enumerations

enum  memif_socket_type_t { MEMIF_SOCKET_TYPE_NONE = 0, MEMIF_SOCKET_TYPE_LISTENER, MEMIF_SOCKET_TYPE_CLIENT }
 

Functions

int memif_connect1 (memif_connection_t *c)
 
int memif_init_regions_and_queues (memif_connection_t *c)
 
int memif_disconnect_internal (memif_connection_t *c)
 
int memif_syscall_error_handler (int err_code)
 
int add_list_elt (libmemif_main_t *lm, memif_list_elt_t *e, memif_list_elt_t **list, uint16_t *len)
 
int get_list_elt (memif_list_elt_t **e, memif_list_elt_t *list, uint16_t len, int key)
 
int free_list_elt (memif_list_elt_t *list, uint16_t len, int key)
 
libmemif_main_tget_libmemif_main (memif_socket_t *ms)
 
static int memfd_create (const char *name, unsigned int flags)
 
static void * memif_get_buffer (memif_connection_t *conn, memif_ring_t *ring, uint16_t index)
 

Variables

libmemif_main_t libmemif_main
 

Macro Definition Documentation

◆ DBG

#define DBG (   ...)

Definition at line 66 of file memif_private.h.

◆ EXPECT_FALSE

#define EXPECT_FALSE (   x)    __builtin_expect((x),0)

Definition at line 57 of file memif_private.h.

◆ EXPECT_TRUE

#define EXPECT_TRUE (   x)    __builtin_expect((x),1)

Definition at line 56 of file memif_private.h.

◆ F_ADD_SEALS

#define F_ADD_SEALS   (F_LINUX_SPECIFIC_BASE + 9)

Definition at line 272 of file memif_private.h.

◆ F_GET_SEALS

#define F_GET_SEALS   (F_LINUX_SPECIFIC_BASE + 10)

Definition at line 273 of file memif_private.h.

◆ F_LINUX_SPECIFIC_BASE

#define F_LINUX_SPECIFIC_BASE   1024

Definition at line 264 of file memif_private.h.

◆ F_SEAL_GROW

#define F_SEAL_GROW   0x0004 /* prevent file from growing */

Definition at line 277 of file memif_private.h.

◆ F_SEAL_SEAL

#define F_SEAL_SEAL   0x0001 /* prevent further seals from being set */

Definition at line 275 of file memif_private.h.

◆ F_SEAL_SHRINK

#define F_SEAL_SHRINK   0x0002 /* prevent file from shrinking */

Definition at line 276 of file memif_private.h.

◆ F_SEAL_WRITE

#define F_SEAL_WRITE   0x0008 /* prevent writes */

Definition at line 278 of file memif_private.h.

◆ MEMIF_CONNECTION_FLAG_WRITE

#define MEMIF_CONNECTION_FLAG_WRITE   (1 << 0)

Definition at line 155 of file memif_private.h.

◆ MEMIF_DEFAULT_BUFFER_SIZE

#define MEMIF_DEFAULT_BUFFER_SIZE   2048

Definition at line 43 of file memif_private.h.

◆ MEMIF_DEFAULT_LOG2_RING_SIZE

#define MEMIF_DEFAULT_LOG2_RING_SIZE   10

Definition at line 40 of file memif_private.h.

◆ MEMIF_DEFAULT_RECONNECT_PERIOD_NSEC

#define MEMIF_DEFAULT_RECONNECT_PERIOD_NSEC   0

Definition at line 45 of file memif_private.h.

◆ MEMIF_DEFAULT_RECONNECT_PERIOD_SEC

#define MEMIF_DEFAULT_RECONNECT_PERIOD_SEC   2

Definition at line 44 of file memif_private.h.

◆ MEMIF_DEFAULT_RING_SIZE

#define MEMIF_DEFAULT_RING_SIZE   1024

Definition at line 39 of file memif_private.h.

◆ MEMIF_DEFAULT_RX_QUEUES

#define MEMIF_DEFAULT_RX_QUEUES   1

Definition at line 41 of file memif_private.h.

◆ MEMIF_DEFAULT_SOCKET_PATH

#define MEMIF_DEFAULT_SOCKET_PATH   "/run/vpp/memif.sock"

Definition at line 38 of file memif_private.h.

◆ MEMIF_DEFAULT_TX_QUEUES

#define MEMIF_DEFAULT_TX_QUEUES   1

Definition at line 42 of file memif_private.h.

◆ MEMIF_MAX_FDS

#define MEMIF_MAX_FDS   512

Definition at line 52 of file memif_private.h.

◆ MEMIF_MAX_LOG2_RING_SIZE

#define MEMIF_MAX_LOG2_RING_SIZE   14

Definition at line 50 of file memif_private.h.

◆ MEMIF_MAX_M2S_RING

#define MEMIF_MAX_M2S_RING   255

Definition at line 47 of file memif_private.h.

◆ MEMIF_MAX_REGION

#define MEMIF_MAX_REGION   255

Definition at line 49 of file memif_private.h.

◆ MEMIF_MAX_S2M_RING

#define MEMIF_MAX_S2M_RING   255

Definition at line 48 of file memif_private.h.

◆ memif_min

#define memif_min (   a,
 
)    (((a) < (b)) ? (a) : (b))

Definition at line 54 of file memif_private.h.

◆ MEMIF_NAME_LEN

#define MEMIF_NAME_LEN   32

Definition at line 34 of file memif_private.h.

◆ MFD_ALLOW_SEALING

#define MFD_ALLOW_SEALING   0x0002U

Definition at line 268 of file memif_private.h.

Typedef Documentation

◆ libmemif_main_t

◆ memif_connection_t

Definition at line 110 of file memif_private.h.

◆ memif_fn

typedef int() memif_fn(memif_connection_t *conn)

Definition at line 113 of file memif_private.h.

◆ memif_msg_queue_elt_t

Enumeration Type Documentation

◆ memif_socket_type_t

Enumerator
MEMIF_SOCKET_TYPE_NONE 
MEMIF_SOCKET_TYPE_LISTENER 
MEMIF_SOCKET_TYPE_CLIENT 

Definition at line 69 of file memif_private.h.

Function Documentation

◆ add_list_elt()

int add_list_elt ( libmemif_main_t lm,
memif_list_elt_t e,
memif_list_elt_t **  list,
uint16_t *  len 
)

Definition at line 330 of file main.c.

+ Here is the caller graph for this function:

◆ free_list_elt()

int free_list_elt ( memif_list_elt_t list,
uint16_t  len,
int  key 
)

Definition at line 390 of file main.c.

+ Here is the caller graph for this function:

◆ get_libmemif_main()

libmemif_main_t* get_libmemif_main ( memif_socket_t ms)

Definition at line 239 of file main.c.

+ Here is the caller graph for this function:

◆ get_list_elt()

int get_list_elt ( memif_list_elt_t **  e,
memif_list_elt_t list,
uint16_t  len,
int  key 
)

Definition at line 366 of file main.c.

+ Here is the caller graph for this function:

◆ memfd_create()

static int memfd_create ( const char *  name,
unsigned int  flags 
)
inlinestatic

Definition at line 249 of file memif_private.h.

◆ memif_connect1()

int memif_connect1 ( memif_connection_t c)

Definition at line 1880 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_disconnect_internal()

int memif_disconnect_internal ( memif_connection_t c)

Definition at line 1665 of file main.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ memif_get_buffer()

static void* memif_get_buffer ( memif_connection_t conn,
memif_ring_t ring,
uint16_t  index 
)
inlinestatic

Definition at line 256 of file memif_private.h.

◆ memif_init_regions_and_queues()

int memif_init_regions_and_queues ( memif_connection_t c)

Definition at line 2113 of file main.c.

+ Here is the call graph for this function:

◆ memif_syscall_error_handler()

int memif_syscall_error_handler ( int  err_code)

Definition at line 202 of file main.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ libmemif_main

Definition at line 68 of file main.c.