17 #include <sys/types.h> 18 #include <sys/mount.h> 20 #include <sys/fcntl.h> 31 #if defined(__x86_64__) && !defined(CLIB_SANITIZE_ADDR) 34 #define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR (1ULL << 36) 37 #define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR 0 42 u32 log2_page_sz,
u32 numa_node,
63 *map_index = map->
index = map - vpm->
maps;
70 for (i = 0; i < a->
n_pages; i++)
139 if (
unformat (line_input,
"verbose"))
141 else if (
unformat (line_input,
"v"))
143 else if (
unformat (line_input,
"detail"))
145 else if (
unformat (line_input,
"d"))
147 else if (
unformat (line_input,
"map"))
165 .path =
"show physmem",
166 .short_help =
"show physmem [verbose | detail | map]",
180 else if (
unformat (input,
"max-size %U",
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).
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
#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_export int clib_pmalloc_init(clib_pmalloc_main_t *pm, uword base_addr, uword size)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
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,...)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
clib_mem_page_sz_t def_log2_page_sz
__clib_export u64 * clib_mem_vm_get_paddr(void *mem, clib_mem_page_sz_t log2_page_size, int n_pages)
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
__clib_export 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 * 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)
#define VLIB_PHYSMEM_DEFAULT_BASE_ADDDR
static void * clib_mem_alloc_aligned(uword size, uword align)
#define CLIB_CACHE_LINE_BYTES
__clib_export u8 * format_clib_error(u8 *s, va_list *va)
static uword clib_pmalloc_get_pa(clib_pmalloc_main_t *pm, void *va)