|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef __included_ssvm_h__
16 #define __included_ssvm_h__
20 #include <sys/types.h>
23 #include <netinet/in.h>
42 #define MMAP_PAGESIZE (clib_mem_get_page_size())
45 #define SSVM_N_OPAQUE 7
101 if (
h->owner_pid == my_pid)
103 h->recursion_count++;
110 h->owner_pid = my_pid;
111 h->recursion_count = 1;
127 if (--
h->recursion_count == 0)
147 return ((
void *) oldheap);
168 #define foreach_ssvm_api_error \
169 _(NO_NAME, "No shared segment name", -100) \
170 _(NO_SIZE, "Size not set (server)", -101) \
171 _(CREATE_FAILURE, "Create failed", -102) \
172 _(SET_SIZE, "Set size failed", -103) \
173 _(MMAP, "mmap failed", -104) \
174 _(CLIENT_TIMEOUT, "Client map timeout", -105)
178 #define _(n,s,c) SSVM_API_ERROR_##n = c,
183 #define SSVM_API_ERROR_NO_NAME (-10)
int ssvm_server_init_private(ssvm_private_t *ssvm)
Initialize segment in a private heap.
void ssvm_delete_memfd(ssvm_private_t *memfd)
static void ssvm_pop_heap(void *oldheap)
static void * ssvm_push_heap(ssvm_shared_header_t *sh)
@ SSVM_N_SEGMENT_TYPES
Private segments.
ssvm_segment_type_t ssvm_type(const ssvm_private_t *ssvm)
static void ssvm_lock_non_recursive(ssvm_shared_header_t *h, u32 tag)
int ssvm_client_init_private(ssvm_private_t *ssvm)
#define foreach_ssvm_api_error
ssvm_shared_header_t * sh
static void ssvm_unlock(ssvm_shared_header_t *h)
#define clib_atomic_release(a)
enum ssvm_segment_type_ ssvm_segment_type_t
static void ssvm_unlock_non_recursive(ssvm_shared_header_t *h)
int ssvm_server_init(ssvm_private_t *ssvm, ssvm_segment_type_t type)
u8 * ssvm_name(const ssvm_private_t *ssvm)
#define clib_atomic_test_and_set(a)
int ssvm_client_init(ssvm_private_t *ssvm, ssvm_segment_type_t type)
Fixed length block allocator. Pools are built from clib vectors and bitmaps. Use pools when repeatedl...
int ssvm_server_init_memfd(ssvm_private_t *memfd)
Initialize memfd segment server.
int attach_timeout
shm segments attach timeout (sec)
u8 numa
UNUSED: numa requested at alloc time.
int ssvm_server_init_shm(ssvm_private_t *ssvm)
static void * ssvm_mem_alloc(ssvm_private_t *ssvm, uword size)
int ssvm_client_init_memfd(ssvm_private_t *memfd)
Initialize memfd segment client.
static void ssvm_lock(ssvm_shared_header_t *h, u32 my_pid, u32 tag)
int ssvm_client_init_shm(ssvm_private_t *ssvm)
void ssvm_delete(ssvm_private_t *ssvm)
static clib_mem_heap_t * clib_mem_set_heap(clib_mem_heap_t *heap)
static void * clib_mem_alloc(uword size)
vl_api_fib_path_type_t type
void ssvm_delete_shm(ssvm_private_t *ssvm)
void ssvm_delete_private(ssvm_private_t *ssvm)