FD.io VPP  v20.05.1-6-gf53edbc3b
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

◆ foreach_ssvm_api_error

#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)
#define MMAP(s)
Definition: dlmalloc.c:325

Definition at line 169 of file ssvm.h.

◆ MMAP_PAGESIZE

#define MMAP_PAGESIZE   (clib_mem_get_page_size())

Definition at line 43 of file ssvm.h.

◆ SSVM_API_ERROR_NO_NAME

#define SSVM_API_ERROR_NO_NAME   (-10)

Definition at line 184 of file ssvm.h.

◆ SSVM_N_OPAQUE

#define SSVM_N_OPAQUE   7

Definition at line 46 of file ssvm.h.

Typedef Documentation

◆ ssvm_segment_type_t

Enumeration Type Documentation

◆ ssvm_api_error_enum_t

Enumerator
foreach_ssvm_api_error 

Definition at line 177 of file ssvm.h.

◆ ssvm_segment_type_

Enumerator
SSVM_SEGMENT_SHM 
SSVM_SEGMENT_MEMFD 
SSVM_SEGMENT_PRIVATE 
SSVM_N_SEGMENT_TYPES 

Private segments.

Definition at line 48 of file ssvm.h.

Function Documentation

◆ ssvm_delete()

void ssvm_delete ( ssvm_private_t ssvm)

Definition at line 427 of file ssvm.c.

+ Here is the caller graph for this function:

◆ ssvm_delete_memfd()

void ssvm_delete_memfd ( ssvm_private_t memfd)

Definition at line 329 of file ssvm.c.

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

◆ ssvm_delete_private()

void ssvm_delete_private ( ssvm_private_t ssvm)

Definition at line 407 of file ssvm.c.

+ Here is the call graph for this function:

◆ ssvm_delete_shm()

void ssvm_delete_shm ( ssvm_private_t ssvm)

Definition at line 193 of file ssvm.c.

+ Here is the call graph for this function:

◆ ssvm_lock()

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

Definition at line 100 of file ssvm.h.

◆ ssvm_lock_non_recursive()

static void ssvm_lock_non_recursive ( ssvm_shared_header_t h,
u32  tag 
)
inlinestatic

Definition at line 117 of file ssvm.h.

◆ ssvm_master_init()

int ssvm_master_init ( ssvm_private_t ssvm,
ssvm_segment_type_t  type 
)

Definition at line 415 of file ssvm.c.

+ Here is the caller graph for this function:

◆ ssvm_master_init_memfd()

int ssvm_master_init_memfd ( ssvm_private_t memfd)

Initialize memfd segment master.

Definition at line 217 of file ssvm.c.

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

◆ ssvm_master_init_private()

int ssvm_master_init_private ( ssvm_private_t ssvm)

Initialize segment in a private heap.

Definition at line 340 of file ssvm.c.

+ Here is the call graph for this function:

◆ ssvm_master_init_shm()

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:

◆ ssvm_mem_alloc()

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:

◆ ssvm_name()

u8* ssvm_name ( const ssvm_private_t ssvm)

Definition at line 439 of file ssvm.c.

+ Here is the caller graph for this function:

◆ ssvm_pop_heap()

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:

◆ ssvm_push_heap()

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:

◆ ssvm_slave_init()

int ssvm_slave_init ( ssvm_private_t ssvm,
ssvm_segment_type_t  type 
)

Definition at line 421 of file ssvm.c.

+ Here is the caller graph for this function:

◆ ssvm_slave_init_memfd()

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 277 of file ssvm.c.

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

◆ ssvm_slave_init_private()

int ssvm_slave_init_private ( ssvm_private_t ssvm)

Definition at line 400 of file ssvm.c.

◆ ssvm_slave_init_shm()

int ssvm_slave_init_shm ( ssvm_private_t ssvm)

Definition at line 123 of file ssvm.c.

◆ ssvm_type()

ssvm_segment_type_t ssvm_type ( const ssvm_private_t ssvm)

Definition at line 433 of file ssvm.c.

+ Here is the caller graph for this function:

◆ ssvm_unlock()

static void ssvm_unlock ( ssvm_shared_header_t h)
inlinestatic

Definition at line 126 of file ssvm.h.

◆ ssvm_unlock_non_recursive()

static void ssvm_unlock_non_recursive ( ssvm_shared_header_t h)
inlinestatic

Definition at line 137 of file ssvm.h.