FD.io VPP  v20.01-rc0-813-gebef4a9e5
Vector Packet Processing
memory_shared.h File Reference
+ Include dependency graph for memory_shared.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ring_alloc_
 
struct  vl_api_shm_elem_config_
 
struct  vl_shmem_hdr_
 

Macros

#define foreach_vl_aring_size
 
#define foreach_clnt_aring_size
 
#define VL_SHM_VERSION   2
 
#define VL_API_EPOCH_MASK   0xFF
 
#define VL_API_EPOCH_SHIFT   8
 

Typedefs

typedef struct ring_alloc_ ring_alloc_t
 
typedef struct vl_api_shm_elem_config_ vl_api_shm_elem_config_t
 
typedef struct vl_shmem_hdr_ vl_shmem_hdr_t
 

Enumerations

enum  vl_api_shm_config_type_t { VL_API_VLIB_RING, VL_API_CLIENT_RING, VL_API_QUEUE }
 

Functions

 STATIC_ASSERT (sizeof(vl_api_shm_elem_config_t)==8, "Size must be exactly 8 bytes")
 
void * vl_msg_api_alloc (int nbytes)
 
void * vl_msg_api_alloc_zero (int nbytes)
 
void * vl_msg_api_alloc_or_null (int nbytes)
 
void * vl_msg_api_alloc_as_if_client (int nbytes)
 
void * vl_msg_api_alloc_zero_as_if_client (int nbytes)
 
void * vl_msg_api_alloc_as_if_client_or_null (int nbytes)
 
void * vl_mem_api_alloc_as_if_client_w_reg (vl_api_registration_t *reg, int nbytes)
 
void vl_msg_api_free (void *a)
 
void vl_msg_api_free_w_region (svm_region_t *vlib_rp, void *a)
 
int vl_map_shmem (const char *region_name, int is_vlib)
 
void vl_unmap_shmem (void)
 
void vl_unmap_shmem_client (void)
 
void vl_register_mapped_shmem_region (svm_region_t *rp)
 
void vl_msg_api_send_shmem (svm_queue_t *q, u8 *elem)
 
int vl_mem_api_can_send (svm_queue_t *q)
 
void vl_set_memory_region_name (const char *name)
 
void vl_set_memory_root_path (const char *root_path)
 
void vl_set_memory_uid (int uid)
 
void vl_set_memory_gid (int gid)
 
void vl_set_global_memory_baseva (u64 baseva)
 
void vl_set_global_memory_size (u64 size)
 
void vl_set_api_memory_size (u64 size)
 
void vl_set_global_pvt_heap_size (u64 size)
 
void vl_set_api_pvt_heap_size (u64 size)
 
void vl_init_shmem (svm_region_t *vlib_rp, vl_api_shm_elem_config_t *config, int is_vlib, int is_private_region)
 

Macro Definition Documentation

◆ foreach_clnt_aring_size

#define foreach_clnt_aring_size
Value:
_(1024+sizeof(ring_alloc_t), 1024) \
_(2048+sizeof(ring_alloc_t), 128) \
_(4096+sizeof(ring_alloc_t), 8)

Definition at line 71 of file memory_shared.h.

◆ foreach_vl_aring_size

#define foreach_vl_aring_size
Value:
_(64+sizeof(ring_alloc_t), 1024) \
_(256+sizeof(ring_alloc_t), 128) \
_(1024+sizeof(ring_alloc_t), 64)

Definition at line 66 of file memory_shared.h.

◆ VL_API_EPOCH_MASK

#define VL_API_EPOCH_MASK   0xFF

Definition at line 108 of file memory_shared.h.

◆ VL_API_EPOCH_SHIFT

#define VL_API_EPOCH_SHIFT   8

Definition at line 109 of file memory_shared.h.

◆ VL_SHM_VERSION

#define VL_SHM_VERSION   2

Definition at line 107 of file memory_shared.h.

Typedef Documentation

◆ ring_alloc_t

typedef struct ring_alloc_ ring_alloc_t

◆ vl_api_shm_elem_config_t

◆ vl_shmem_hdr_t

typedef struct vl_shmem_hdr_ vl_shmem_hdr_t

Enumeration Type Documentation

◆ vl_api_shm_config_type_t

Enumerator
VL_API_VLIB_RING 
VL_API_CLIENT_RING 
VL_API_QUEUE 

Definition at line 44 of file memory_shared.h.

Function Documentation

◆ STATIC_ASSERT()

STATIC_ASSERT ( sizeof(vl_api_shm_elem_config_t = =8,
"Size must be exactly 8 bytes"   
)

◆ vl_init_shmem()

void vl_init_shmem ( svm_region_t vlib_rp,
vl_api_shm_elem_config_t config,
int  is_vlib,
int  is_private_region 
)

Definition at line 493 of file memory_shared.c.

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

◆ vl_map_shmem()

int vl_map_shmem ( const char *  region_name,
int  is_vlib 
)

Definition at line 535 of file memory_shared.c.

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

◆ vl_mem_api_alloc_as_if_client_w_reg()

void* vl_mem_api_alloc_as_if_client_w_reg ( vl_api_registration_t reg,
int  nbytes 
)

Definition at line 262 of file memory_shared.c.

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

◆ vl_mem_api_can_send()

int vl_mem_api_can_send ( svm_queue_t q)

Definition at line 795 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_msg_api_alloc()

void* vl_msg_api_alloc ( int  nbytes)

Definition at line 201 of file memory_shared.c.

+ Here is the call graph for this function:

◆ vl_msg_api_alloc_as_if_client()

void* vl_msg_api_alloc_as_if_client ( int  nbytes)

Definition at line 238 of file memory_shared.c.

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

◆ vl_msg_api_alloc_as_if_client_or_null()

void* vl_msg_api_alloc_as_if_client_or_null ( int  nbytes)

Definition at line 255 of file memory_shared.c.

+ Here is the call graph for this function:

◆ vl_msg_api_alloc_or_null()

void* vl_msg_api_alloc_or_null ( int  nbytes)

Definition at line 226 of file memory_shared.c.

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

◆ vl_msg_api_alloc_zero()

void* vl_msg_api_alloc_zero ( int  nbytes)

Definition at line 216 of file memory_shared.c.

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

◆ vl_msg_api_alloc_zero_as_if_client()

void* vl_msg_api_alloc_zero_as_if_client ( int  nbytes)

Definition at line 245 of file memory_shared.c.

+ Here is the call graph for this function:

◆ vl_msg_api_free()

void vl_msg_api_free ( void *  a)

Definition at line 313 of file memory_shared.c.

+ Here is the call graph for this function:

◆ vl_msg_api_free_w_region()

void vl_msg_api_free_w_region ( svm_region_t vlib_rp,
void *  a 
)

Definition at line 269 of file memory_shared.c.

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

◆ vl_msg_api_send_shmem()

void vl_msg_api_send_shmem ( svm_queue_t q,
u8 elem 
)

Definition at line 754 of file memory_shared.c.

+ Here is the call graph for this function:

◆ vl_register_mapped_shmem_region()

void vl_register_mapped_shmem_region ( svm_region_t rp)

Definition at line 707 of file memory_shared.c.

◆ vl_set_api_memory_size()

void vl_set_api_memory_size ( u64  size)

Definition at line 384 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_set_api_pvt_heap_size()

void vl_set_api_pvt_heap_size ( u64  size)

Definition at line 400 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_set_global_memory_baseva()

void vl_set_global_memory_baseva ( u64  baseva)

Definition at line 368 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_set_global_memory_size()

void vl_set_global_memory_size ( u64  size)

Definition at line 376 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_set_global_pvt_heap_size()

void vl_set_global_pvt_heap_size ( u64  size)

Definition at line 392 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_set_memory_gid()

void vl_set_memory_gid ( int  gid)

Definition at line 360 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_set_memory_region_name()

void vl_set_memory_region_name ( const char *  name)

Definition at line 1000 of file memory_api.c.

+ Here is the caller graph for this function:

◆ vl_set_memory_root_path()

void vl_set_memory_root_path ( const char *  root_path)

Definition at line 344 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_set_memory_uid()

void vl_set_memory_uid ( int  uid)

Definition at line 352 of file memory_shared.c.

+ Here is the caller graph for this function:

◆ vl_unmap_shmem()

void vl_unmap_shmem ( void  )

Definition at line 742 of file memory_shared.c.

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

◆ vl_unmap_shmem_client()

void vl_unmap_shmem_client ( void  )

Definition at line 748 of file memory_shared.c.

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