aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2018-09-03 12:35:27 +0200
committerKlement Sekera <ksekera@cisco.com>2018-09-03 12:35:27 +0200
commit7ff0a265a8b5692268c0f44385712c7be8e32775 (patch)
tree83b8664d739dc22e3f83d141e09126b0a68da042 /src
parent732021070fa0c731896ab3e29f802d3834c72ab7 (diff)
vapi: init clib mem heap on connect if needed
Change-Id: Id45a3a37dd77771289622314406dccf50b64f04d Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vpp-api/vapi/vapi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vpp-api/vapi/vapi.c b/src/vpp-api/vapi/vapi.c
index 1a0fdbb627a..70382d17bbb 100644
--- a/src/vpp-api/vapi/vapi.c
+++ b/src/vpp-api/vapi/vapi.c
@@ -306,6 +306,10 @@ vapi_connect (vapi_ctx_t ctx, const char *name,
{
return VAPI_EINVAL;
}
+ if (!clib_mem_get_per_cpu_heap () && !clib_mem_init (0, 1024 * 1024 * 32))
+ {
+ return VAPI_ENOMEM;
+ }
ctx->requests_size = max_outstanding_requests;
const size_t size = ctx->requests_size * sizeof (*ctx->requests);
void *tmp = realloc (ctx->requests, size);