summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-07-20 18:10:35 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-09-07 16:09:21 +0000
commit49d66f1f42cbc310e4fa0dc526b9fdb91d0ca220 (patch)
treed6ebe20d0d6791650cd28b6b800d1dee2950f439 /src/vlib/main.c
parentd630713d733718701f38176f98d563fd32679d06 (diff)
vlib physmem rework
This patch adds supprot support for multiple numa-aware physmem regions. Change-Id: I5c69a6f4da33c8ee21bdb8604d52fd2886f2327e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 5d99e899273..7875f62ad37 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -1705,22 +1705,16 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
if (!vm->name)
vm->name = "VLIB";
- vec_validate (vm->buffer_main, 0);
- if (vlib_buffer_callbacks)
+ if ((error = unix_physmem_init (vm)))
{
- /* external plugin has registered own buffer callbacks
- so we just copy them */
- vlib_buffer_main_t *bm = vm->buffer_main;
- clib_memcpy (&bm->cb, vlib_buffer_callbacks,
- sizeof (vlib_buffer_callbacks_t));
- bm->callbacks_registered = 1;
+ clib_error_report (error);
+ goto done;
}
- else
+
+ if ((error = vlib_buffer_main_init (vm)))
{
- vlib_physmem_main_t *vpm = &vm->physmem_main;
- vlib_buffer_cb_init (vm);
- unix_physmem_init (vm, 0 /* fail_if_physical_memory_not_present */ );
- vlib_buffer_add_mem_range (vm, vpm->virtual.start, vpm->virtual.size);
+ clib_error_report (error);
+ goto done;
}
if ((error = vlib_thread_init (vm)))