aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_cfg.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-13 15:52:38 -0800
committerDamjan Marion <dmarion@me.com>2018-11-18 19:46:38 +0000
commit053a0e44edb21713e0825f9c09ba4af12e686b38 (patch)
tree950e303daf1b367eab26cc823c0efc23ae170b1d /src/vcl/vcl_cfg.c
parent0c4fec0134f32bc913299b37d048a99293b1a851 (diff)
vcl/session: apps with process workers
Allow apps to register child processes as app workers. In particular, on fork vcl now registers the child process with vpp as a new worker. Change-Id: I52a65fbc3292962b1f6e1fe0f6153f739e6e0d4a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vcl_cfg.c')
-rw-r--r--src/vcl/vcl_cfg.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/vcl/vcl_cfg.c b/src/vcl/vcl_cfg.c
index e39e5177908..3e92941d720 100644
--- a/src/vcl/vcl_cfg.c
+++ b/src/vcl/vcl_cfg.c
@@ -22,6 +22,7 @@
static vppcom_main_t _vppcom_main = {
.debug = VPPCOM_DEBUG_INIT,
.is_init = 0,
+ .main_api_client_index = ~0,
.my_client_index = ~0
};
@@ -170,6 +171,7 @@ vppcom_cfg_heapsize (char *conf_fname)
goto defaulted;
}
}
+ free (argv[i]);
}
defaulted:
@@ -231,8 +233,7 @@ vppcom_cfg_read_file (char *conf_fname)
if (fstat (fd, &s) < 0)
{
- VCFG_DBG (0,
- "VCL<%d>: failed to stat `%s', using default configuration",
+ VCFG_DBG (0, "VCL<%d>: failed to stat `%s' using default configuration",
getpid (), conf_fname);
goto file_done;
}
@@ -254,17 +255,21 @@ vppcom_cfg_read_file (char *conf_fname)
if (unformat (line_input, "vcl {"))
{
vc_cfg_input = 1;
+ unformat_free (line_input);
continue;
}
if (vc_cfg_input)
{
- if (unformat (line_input, "heapsize %lu", &vcl_cfg->heapsize))
+ if (unformat (line_input, "heapsize %U", unformat_memory_size,
+ &vcl_cfg->heapsize))
{
VCFG_DBG (0, "VCL<%d>: configured heapsize %lu", getpid (),
vcl_cfg->heapsize);
}
- if (unformat (line_input, "max-workers %u", &vcl_cfg->max_workers))
+ else
+ if (unformat
+ (line_input, "max-workers %u", &vcl_cfg->max_workers))
{
VCFG_DBG (0, "VCL<%d>: configured max-workers %u", getpid (),
vcl_cfg->max_workers);
@@ -490,6 +495,7 @@ vppcom_cfg_read_file (char *conf_fname)
vc_cfg_input = 0;
VCFG_DBG (0, "VCL<%d>: completed parsing vppcom config!",
getpid ());
+ unformat_free (line_input);
goto input_done;
}
else
@@ -501,6 +507,7 @@ vppcom_cfg_read_file (char *conf_fname)
&line_input->buffer[line_input->index]);
}
}
+ unformat_free (line_input);
}
}