FD.io VPP  v18.11-rc0-18-g2a3fb1a
Vector Packet Processing
ssvm.h File Reference
+ Include dependency graph for ssvm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ssvm_shared_header_t
 
struct  ssvm_private_t
 

Macros

#define MMAP_PAGESIZE   (clib_mem_get_page_size())
 
#define SSVM_N_OPAQUE   7
 
#define foreach_ssvm_api_error
 
#define SSVM_API_ERROR_NO_NAME   (-10)
 

Typedefs

typedef enum ssvm_segment_type_ ssvm_segment_type_t
 

Enumerations

enum  ssvm_segment_type_ { SSVM_SEGMENT_SHM = 0, SSVM_SEGMENT_MEMFD, SSVM_SEGMENT_PRIVATE, SSVM_N_SEGMENT_TYPES }
 
enum  ssvm_api_error_enum_t { foreach_ssvm_api_error }
 

Functions

static void ssvm_lock (ssvm_shared_header_t *h, u32 my_pid, u32 tag)
 
static void ssvm_lock_non_recursive (ssvm_shared_header_t *h, u32 tag)
 
static void ssvm_unlock (ssvm_shared_header_t *h)
 
static void ssvm_unlock_non_recursive (ssvm_shared_header_t *h)
 
static void * ssvm_push_heap (ssvm_shared_header_t *sh)
 
static void ssvm_pop_heap (void *oldheap)
 
static void * ssvm_mem_alloc (ssvm_private_t *ssvm, uword size)
 
int ssvm_master_init (ssvm_private_t *ssvm, ssvm_segment_type_t type)
 
int ssvm_slave_init (ssvm_private_t *ssvm, ssvm_segment_type_t type)
 
void ssvm_delete (ssvm_private_t *ssvm)
 
int ssvm_master_init_shm (ssvm_private_t *ssvm)
 
int ssvm_slave_init_shm (ssvm_private_t *ssvm)
 
void ssvm_delete_shm (ssvm_private_t *ssvm)
 
int ssvm_master_init_memfd (ssvm_private_t *memfd)
 Initialize memfd segment master. More...
 
int ssvm_slave_init_memfd (ssvm_private_t *memfd)
 Initialize memfd segment slave. More...
 
void ssvm_delete_memfd (ssvm_private_t *memfd)
 
int ssvm_master_init_private (ssvm_private_t *ssvm)
 Initialize segment in a private heap. More...
 
int ssvm_slave_init_private (ssvm_private_t *ssvm)
 
void ssvm_delete_private (ssvm_private_t *ssvm)
 
ssvm_segment_type_t ssvm_type (const ssvm_private_t *ssvm)
 
u8ssvm_name (const ssvm_private_t *ssvm)
 

Macro Definition Documentation

#define foreach_ssvm_api_error
Value:
_(NO_NAME, "No shared segment name", -100) \
_(NO_SIZE, "Size not set (master)", -101) \
_(CREATE_FAILURE, "Create failed", -102) \
_(SET_SIZE, "Set size failed", -103) \
_(MMAP, "mmap failed", -104) \
_(SLAVE_TIMEOUT, "Slave map timeout", -105)

Definition at line 169 of file ssvm.h.

#define MMAP_PAGESIZE   (clib_mem_get_page_size())

Definition at line 42 of file ssvm.h.

#define SSVM_API_ERROR_NO_NAME   (-10)

Definition at line 184 of file ssvm.h.

#define SSVM_N_OPAQUE   7

Definition at line 45 of file ssvm.h.

Typedef Documentation

Enumeration Type Documentation

Enumerator
foreach_ssvm_api_error 

Definition at line 177 of file ssvm.h.

Enumerator
SSVM_SEGMENT_SHM 
SSVM_SEGMENT_MEMFD 
SSVM_SEGMENT_PRIVATE 
SSVM_N_SEGMENT_TYPES 

Private segments.

Definition at line 47 of file ssvm.h.

Function Documentation

void ssvm_delete ( ssvm_private_t ssvm)

Definition at line 392 of file ssvm.c.

+ Here is the caller graph for this function:

void ssvm_delete_memfd ( ssvm_private_t memfd)

Definition at line 318 of file ssvm.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ssvm_delete_private ( ssvm_private_t ssvm)

Definition at line 372 of file ssvm.c.

+ Here is the call graph for this function:

void ssvm_delete_shm ( ssvm_private_t ssvm)

Definition at line 189 of file ssvm.c.

+ Here is the call graph for this function:

static void ssvm_lock ( ssvm_shared_header_t h,
u32  my_pid,
u32  tag 
)
inlinestatic

Definition at line 98 of file ssvm.h.

static void ssvm_lock_non_recursive ( ssvm_shared_header_t h,
u32  tag 
)
inlinestatic

Definition at line 115 of file ssvm.h.

+ Here is the caller graph for this function:

int ssvm_master_init ( ssvm_private_t ssvm,
ssvm_segment_type_t  type 
)

Definition at line 380 of file ssvm.c.

+ Here is the caller graph for this function:

int ssvm_master_init_memfd ( ssvm_private_t memfd)

Initialize memfd segment master.

Definition at line 213 of file ssvm.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ssvm_master_init_private ( ssvm_private_t ssvm)

Initialize segment in a private heap.

Definition at line 329 of file ssvm.c.

+ Here is the call graph for this function:

int ssvm_master_init_shm ( ssvm_private_t ssvm)

Definition at line 29 of file ssvm.c.

+ Here is the call graph for this function:

static void* ssvm_mem_alloc ( ssvm_private_t ssvm,
uword  size 
)
inlinestatic

Definition at line 158 of file ssvm.h.

+ Here is the call graph for this function:

u8* ssvm_name ( const ssvm_private_t ssvm)

Definition at line 404 of file ssvm.c.

static void ssvm_pop_heap ( void *  oldheap)
inlinestatic

Definition at line 152 of file ssvm.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* ssvm_push_heap ( ssvm_shared_header_t sh)
inlinestatic

Definition at line 144 of file ssvm.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ssvm_slave_init ( ssvm_private_t ssvm,
ssvm_segment_type_t  type 
)

Definition at line 386 of file ssvm.c.

+ Here is the caller graph for this function:

int ssvm_slave_init_memfd ( ssvm_private_t memfd)

Initialize memfd segment slave.

Subtly different than svm_slave_init. The caller needs to acquire a usable file descriptor for the memfd segment e.g. via vppinfra/socket.c:default_socket_recvmsg

Definition at line 266 of file ssvm.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ssvm_slave_init_private ( ssvm_private_t ssvm)

Definition at line 365 of file ssvm.c.

int ssvm_slave_init_shm ( ssvm_private_t ssvm)

Definition at line 119 of file ssvm.c.

ssvm_segment_type_t ssvm_type ( const ssvm_private_t ssvm)

Definition at line 398 of file ssvm.c.

+ Here is the caller graph for this function:

static void ssvm_unlock ( ssvm_shared_header_t h)
inlinestatic

Definition at line 124 of file ssvm.h.

static void ssvm_unlock_non_recursive ( ssvm_shared_header_t h)
inlinestatic

Definition at line 136 of file ssvm.h.

+ Here is the caller graph for this function: