FD.io VPP  v21.01.1
Vector Packet Processing
mem.c File Reference
+ Include dependency graph for mem.c:

Go to the source code of this file.

Macros

#define F_LINUX_SPECIFIC_BASE   1024
 
#define F_ADD_SEALS   (F_LINUX_SPECIFIC_BASE + 9)
 
#define F_GET_SEALS   (F_LINUX_SPECIFIC_BASE + 10)
 
#define F_SEAL_SEAL   0x0001 /* prevent further seals from being set */
 
#define F_SEAL_SHRINK   0x0002 /* prevent file from shrinking */
 
#define F_SEAL_GROW   0x0004 /* prevent file from growing */
 
#define F_SEAL_WRITE   0x0008 /* prevent writes */
 
#define MAP_FIXED_NOREPLACE   0x100000
 

Functions

static void map_lock ()
 
static void map_unlock ()
 
__clib_export uword clib_mem_get_default_hugepage_size (void)
 
static clib_mem_page_sz_t legacy_get_log2_default_hugepage_size (void)
 
void clib_mem_main_init ()
 
__clib_export u64 clib_mem_get_fd_page_size (int fd)
 
__clib_export clib_mem_page_sz_t clib_mem_get_fd_log2_page_size (int fd)
 
__clib_export void clib_mem_vm_randomize_va (uword *requested_va, clib_mem_page_sz_t log2_page_size)
 
static int legacy_memfd_create (u8 *name)
 
__clib_export int clib_mem_vm_create_fd (clib_mem_page_sz_t log2_page_size, char *fmt,...)
 
uword clib_mem_vm_reserve (uword start, uword size, clib_mem_page_sz_t log2_page_sz)
 
__clib_export clib_mem_vm_map_hdr_tclib_mem_vm_get_next_map_hdr (clib_mem_vm_map_hdr_t *hdr)
 
void * clib_mem_vm_map_internal (void *base, clib_mem_page_sz_t log2_page_sz, uword size, int fd, uword offset, char *name)
 
__clib_export int clib_mem_vm_unmap (void *base)
 
__clib_export void clib_mem_get_page_stats (void *start, clib_mem_page_sz_t log2_page_size, uword n_pages, clib_mem_page_stats_t *stats)
 
__clib_export u64clib_mem_vm_get_paddr (void *mem, clib_mem_page_sz_t log2_page_size, int n_pages)
 
__clib_export int clib_mem_set_numa_affinity (u8 numa_node, int force)
 
__clib_export int clib_mem_set_default_numa_affinity ()
 

Macro Definition Documentation

◆ F_ADD_SEALS

#define F_ADD_SEALS   (F_LINUX_SPECIFIC_BASE + 9)

Definition at line 41 of file mem.c.

◆ F_GET_SEALS

#define F_GET_SEALS   (F_LINUX_SPECIFIC_BASE + 10)

Definition at line 42 of file mem.c.

◆ F_LINUX_SPECIFIC_BASE

#define F_LINUX_SPECIFIC_BASE   1024

Definition at line 37 of file mem.c.

◆ F_SEAL_GROW

#define F_SEAL_GROW   0x0004 /* prevent file from growing */

Definition at line 46 of file mem.c.

◆ F_SEAL_SEAL

#define F_SEAL_SEAL   0x0001 /* prevent further seals from being set */

Definition at line 44 of file mem.c.

◆ F_SEAL_SHRINK

#define F_SEAL_SHRINK   0x0002 /* prevent file from shrinking */

Definition at line 45 of file mem.c.

◆ F_SEAL_WRITE

#define F_SEAL_WRITE   0x0008 /* prevent writes */

Definition at line 47 of file mem.c.

◆ MAP_FIXED_NOREPLACE

#define MAP_FIXED_NOREPLACE   0x100000

Definition at line 63 of file mem.c.

Function Documentation

◆ clib_mem_get_default_hugepage_size()

__clib_export uword clib_mem_get_default_hugepage_size ( void  )

Definition at line 80 of file mem.c.

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

◆ clib_mem_get_fd_log2_page_size()

__clib_export clib_mem_page_sz_t clib_mem_get_fd_log2_page_size ( int  fd)

Definition at line 190 of file mem.c.

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

◆ clib_mem_get_fd_page_size()

__clib_export u64 clib_mem_get_fd_page_size ( int  fd)

Definition at line 181 of file mem.c.

+ Here is the caller graph for this function:

◆ clib_mem_get_page_stats()

__clib_export void clib_mem_get_page_stats ( void *  start,
clib_mem_page_sz_t  log2_page_size,
uword  n_pages,
clib_mem_page_stats_t stats 
)

Definition at line 553 of file mem.c.

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

◆ clib_mem_main_init()

void clib_mem_main_init ( )

Definition at line 137 of file mem.c.

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

◆ clib_mem_set_default_numa_affinity()

__clib_export int clib_mem_set_default_numa_affinity ( )

Definition at line 670 of file mem.c.

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

◆ clib_mem_set_numa_affinity()

__clib_export int clib_mem_set_numa_affinity ( u8  numa_node,
int  force 
)

Definition at line 635 of file mem.c.

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

◆ clib_mem_vm_create_fd()

__clib_export int clib_mem_vm_create_fd ( clib_mem_page_sz_t  log2_page_size,
char *  fmt,
  ... 
)

Definition at line 264 of file mem.c.

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

◆ clib_mem_vm_get_next_map_hdr()

__clib_export clib_mem_vm_map_hdr_t* clib_mem_vm_get_next_map_hdr ( clib_mem_vm_map_hdr_t hdr)

Definition at line 388 of file mem.c.

+ Here is the caller graph for this function:

◆ clib_mem_vm_get_paddr()

__clib_export u64* clib_mem_vm_get_paddr ( void *  mem,
clib_mem_page_sz_t  log2_page_size,
int  n_pages 
)

Definition at line 593 of file mem.c.

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

◆ clib_mem_vm_map_internal()

void* clib_mem_vm_map_internal ( void *  base,
clib_mem_page_sz_t  log2_page_sz,
uword  size,
int  fd,
uword  offset,
char *  name 
)

Definition at line 408 of file mem.c.

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

◆ clib_mem_vm_randomize_va()

__clib_export void clib_mem_vm_randomize_va ( uword requested_va,
clib_mem_page_sz_t  log2_page_size 
)

Definition at line 197 of file mem.c.

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

◆ clib_mem_vm_reserve()

uword clib_mem_vm_reserve ( uword  start,
uword  size,
clib_mem_page_sz_t  log2_page_sz 
)

Definition at line 332 of file mem.c.

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

◆ clib_mem_vm_unmap()

__clib_export int clib_mem_vm_unmap ( void *  base)

Definition at line 511 of file mem.c.

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

◆ legacy_get_log2_default_hugepage_size()

static clib_mem_page_sz_t legacy_get_log2_default_hugepage_size ( void  )
static

Definition at line 114 of file mem.c.

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

◆ legacy_memfd_create()

static int legacy_memfd_create ( u8 name)
static

Definition at line 214 of file mem.c.

◆ map_lock()

static void map_lock ( )
static

Definition at line 67 of file mem.c.

+ Here is the caller graph for this function:

◆ map_unlock()

static void map_unlock ( )
static

Definition at line 74 of file mem.c.

+ Here is the caller graph for this function: