summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/linux/physmem.c8
-rw-r--r--src/vlib/linux/vfio.c2
-rw-r--r--src/vlib/main.h2
-rw-r--r--src/vlib/physmem.h2
-rw-r--r--src/vlib/physmem_funcs.h4
-rw-r--r--src/vlib/unix/main.c1
6 files changed, 10 insertions, 9 deletions
diff --git a/src/vlib/linux/physmem.c b/src/vlib/linux/physmem.c
index f60a6f75adf..b3703388b84 100644
--- a/src/vlib/linux/physmem.c
+++ b/src/vlib/linux/physmem.c
@@ -114,7 +114,7 @@ unix_physmem_region_alloc (vlib_main_t * vm, char *name, u32 size,
u8 numa_node, u32 flags,
vlib_physmem_region_index_t * idx)
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
+ vlib_physmem_main_t *vpm = &physmem_main;
vlib_physmem_region_t *pr;
clib_error_t *error = 0;
clib_mem_vm_alloc_t alloc = { 0 };
@@ -208,7 +208,7 @@ done:
static void
unix_physmem_region_free (vlib_main_t * vm, vlib_physmem_region_index_t idx)
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
+ vlib_physmem_main_t *vpm = &physmem_main;
vlib_physmem_region_t *pr = vlib_physmem_get_region (vm, idx);
if (pr->fd > 0)
@@ -221,7 +221,7 @@ unix_physmem_region_free (vlib_main_t * vm, vlib_physmem_region_index_t idx)
clib_error_t *
unix_physmem_init (vlib_main_t * vm)
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
+ vlib_physmem_main_t *vpm = &physmem_main;
linux_vfio_main_t *lvm = &vfio_main;
clib_error_t *error = 0;
u64 *pt = 0;
@@ -254,7 +254,7 @@ static clib_error_t *
show_physmem (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
+ vlib_physmem_main_t *vpm = &physmem_main;
vlib_physmem_region_t *pr;
/* *INDENT-OFF* */
diff --git a/src/vlib/linux/vfio.c b/src/vlib/linux/vfio.c
index dffe49ce7b2..e39bf01fdc0 100644
--- a/src/vlib/linux/vfio.c
+++ b/src/vlib/linux/vfio.c
@@ -57,7 +57,7 @@ linux_vfio_main_t vfio_main;
static int
map_regions (vlib_main_t * vm, int fd)
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
+ vlib_physmem_main_t *vpm = &physmem_main;
vlib_physmem_region_t *pr;
struct vfio_iommu_type1_dma_map dm = { 0 };
int i;
diff --git a/src/vlib/main.h b/src/vlib/main.h
index 28412e823a9..2eec930e9b6 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -105,8 +105,6 @@ typedef struct vlib_main_t
vlib_buffer_main_t *buffer_main;
- vlib_physmem_main_t physmem_main;
-
/* Allocate/free buffer memory for DMA transfers, descriptor rings, etc.
buffer memory is guaranteed to be cache-aligned. */
diff --git a/src/vlib/physmem.h b/src/vlib/physmem.h
index e99db7de72c..2f54938ff10 100644
--- a/src/vlib/physmem.h
+++ b/src/vlib/physmem.h
@@ -73,6 +73,8 @@ typedef struct
vlib_physmem_region_t *regions;
} vlib_physmem_main_t;
+extern vlib_physmem_main_t physmem_main;
+
#endif /* included_vlib_physmem_h */
/*
diff --git a/src/vlib/physmem_funcs.h b/src/vlib/physmem_funcs.h
index 0013c2f70cd..bff66aa5726 100644
--- a/src/vlib/physmem_funcs.h
+++ b/src/vlib/physmem_funcs.h
@@ -43,7 +43,7 @@
always_inline vlib_physmem_region_t *
vlib_physmem_get_region (vlib_main_t * vm, u8 index)
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
+ vlib_physmem_main_t *vpm = &physmem_main;
return pool_elt_at_index (vpm->regions, index);
}
@@ -129,7 +129,7 @@ always_inline u64
vlib_physmem_virtual_to_physical (vlib_main_t * vm,
vlib_physmem_region_index_t idx, void *mem)
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
+ vlib_physmem_main_t *vpm = &physmem_main;
vlib_physmem_region_t *pr = pool_elt_at_index (vpm->regions, idx);
uword o = mem - pr->mem;
return vlib_physmem_offset_to_physical (vm, idx, o);
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index 7e868f99cc2..786addf2e0a 100644
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -61,6 +61,7 @@ char *vlib_default_runtime_dir = "vlib";
unix_main_t unix_main;
clib_file_main_t file_main;
+vlib_physmem_main_t physmem_main;
static clib_error_t *
unix_main_init (vlib_main_t * vm)