FD.io VPP  v21.01.1
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_server_init (ssvm_private_t *ssvm, ssvm_segment_type_t type)
 
int ssvm_client_init (ssvm_private_t *ssvm, ssvm_segment_type_t type)
 
void ssvm_delete (ssvm_private_t *ssvm)
 
int ssvm_server_init_shm (ssvm_private_t *ssvm)
 
int ssvm_client_init_shm (ssvm_private_t *ssvm)
 
void ssvm_delete_shm (ssvm_private_t *ssvm)
 
int ssvm_server_init_memfd (ssvm_private_t *memfd)
 Initialize memfd segment server. More...
 
int ssvm_client_init_memfd (ssvm_private_t *memfd)
 Initialize memfd segment client. More...
 
void ssvm_delete_memfd (ssvm_private_t *memfd)
 
int ssvm_server_init_private (ssvm_private_t *ssvm)
 Initialize segment in a private heap. More...
 
int ssvm_client_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 (server)", -101) \
_(CREATE_FAILURE, "Create failed", -102) \
_(SET_SIZE, "Set size failed", -103) \
_(MMAP, "mmap failed", -104) \
_(CLIENT_TIMEOUT, "Client map timeout", -105)
#define MMAP(s)
Definition: dlmalloc.c:325

Definition at line 168 of file ssvm.h.

◆ MMAP_PAGESIZE

#define MMAP_PAGESIZE   (clib_mem_get_page_size())

Definition at line 42 of file ssvm.h.

◆ SSVM_API_ERROR_NO_NAME

#define SSVM_API_ERROR_NO_NAME   (-10)

Definition at line 183 of file ssvm.h.

◆ SSVM_N_OPAQUE

#define SSVM_N_OPAQUE   7

Definition at line 45 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 176 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 47 of file ssvm.h.

Function Documentation

◆ ssvm_client_init()

int ssvm_client_init ( ssvm_private_t ssvm,
ssvm_segment_type_t  type 
)

Definition at line 439 of file ssvm.c.

+ Here is the caller graph for this function:

◆ ssvm_client_init_memfd()

int ssvm_client_init_memfd ( ssvm_private_t memfd)

Initialize memfd segment client.

Subtly different than svm_client_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 292 of file ssvm.c.

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

◆ ssvm_client_init_private()

int ssvm_client_init_private ( ssvm_private_t ssvm)

Definition at line 418 of file ssvm.c.

◆ ssvm_client_init_shm()

int ssvm_client_init_shm ( ssvm_private_t ssvm)

Definition at line 120 of file ssvm.c.

◆ ssvm_delete()

void ssvm_delete ( ssvm_private_t ssvm)

Definition at line 445 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 347 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 425 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 190 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 99 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 116 of file ssvm.h.

◆ ssvm_mem_alloc()

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

Definition at line 157 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 457 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 151 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 143 of file ssvm.h.

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

◆ ssvm_server_init()

int ssvm_server_init ( ssvm_private_t ssvm,
ssvm_segment_type_t  type 
)

Definition at line 433 of file ssvm.c.

+ Here is the caller graph for this function:

◆ ssvm_server_init_memfd()

int ssvm_server_init_memfd ( ssvm_private_t memfd)

Initialize memfd segment server.

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_server_init_private()

int ssvm_server_init_private ( ssvm_private_t ssvm)

Initialize segment in a private heap.

Definition at line 361 of file ssvm.c.

+ Here is the call graph for this function:

◆ ssvm_server_init_shm()

int ssvm_server_init_shm ( ssvm_private_t ssvm)

Definition at line 29 of file ssvm.c.

+ Here is the call graph for this function:

◆ ssvm_type()

ssvm_segment_type_t ssvm_type ( const ssvm_private_t ssvm)

Definition at line 451 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 125 of file ssvm.h.

◆ ssvm_unlock_non_recursive()

static void ssvm_unlock_non_recursive ( ssvm_shared_header_t h)
inlinestatic

Definition at line 136 of file ssvm.h.