17 #include <sys/types.h> 18 #include <sys/mount.h> 20 #include <sys/fcntl.h> 35 #define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR (1ULL << 36) 38 #define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR 0 43 u32 log2_page_sz,
u32 numa_node,
64 *map_index = map->
index = map - vpm->
maps;
71 for (i = 0; i < a->
n_pages; i++)
129 u32 verbose = 0, map = 0;
135 if (
unformat (line_input,
"verbose"))
137 else if (
unformat (line_input,
"v"))
139 else if (
unformat (line_input,
"detail"))
141 else if (
unformat (line_input,
"d"))
143 else if (
unformat (line_input,
"map"))
161 .path =
"show physmem",
162 .short_help =
"show physmem [verbose | detail | map]",
u8 * format_clib_error(u8 *s, va_list *va)
vlib_physmem_main_t physmem_main
format_function_t format_pmalloc_map
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void * clib_pmalloc_create_shared_arena(clib_pmalloc_main_t *pm, char *name, uword size, u32 log2_page_sz, u32 numa_node)
vlib_physmem_map_t * vlib_physmem_get_map(vlib_main_t *vm, u32 index)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static uword min_log2(uword x)
clib_pmalloc_main_t * pmalloc_main
int clib_pmalloc_init(clib_pmalloc_main_t *pm, uword base_addr, uword size)
#define VLIB_PHYSMEM_MAIN_F_HAVE_PAGEMAP
format_function_t format_pmalloc
#define clib_error_return(e, args...)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
clib_error_t * vlib_physmem_shared_map_create(vlib_main_t *vm, char *name, uword size, u32 log2_page_sz, u32 numa_node, u32 *map_index)
clib_error_t * linux_vfio_init(vlib_main_t *vm)
static clib_error_t * clib_pmalloc_last_error(clib_pmalloc_main_t *pm)
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
#define vec_free(V)
Free vector's memory (no header).
#define VLIB_CLI_COMMAND(x,...)
vlib_physmem_map_t * maps
static uword pointer_to_uword(const void *p)
static clib_error_t * show_physmem(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_pmalloc_arena_t * clib_pmalloc_get_arena(clib_pmalloc_main_t *pm, void *va)
clib_error_t * vlib_physmem_init(vlib_main_t *vm)
static clib_error_t * vlib_physmem_config(vlib_main_t *vm, unformat_input_t *input)
u64 * clib_mem_vm_get_paddr(void *mem, int log2_page_size, int n_pages)
#define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR
static void * clib_mem_alloc_aligned(uword size, uword align)
#define CLIB_CACHE_LINE_BYTES
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static uword clib_pmalloc_get_pa(clib_pmalloc_main_t *pm, void *va)