Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vcl: basic support for apps that fork
[vpp.git]
/
src
/
vcl
/
vcl_cfg.c
diff --git
a/src/vcl/vcl_cfg.c
b/src/vcl/vcl_cfg.c
index
f7bddef
..
8baae82
100644
(file)
--- a/
src/vcl/vcl_cfg.c
+++ b/
src/vcl/vcl_cfg.c
@@
-21,8
+21,8
@@
*/
static vppcom_main_t _vppcom_main = {
.debug = VPPCOM_DEBUG_INIT,
*/
static vppcom_main_t _vppcom_main = {
.debug = VPPCOM_DEBUG_INIT,
- .init = 0,
- .
my_client_index = ~0
+ .i
s_i
nit = 0,
+ .
app_index = ~0,
};
vppcom_main_t *vcm = &_vppcom_main;
};
vppcom_main_t *vcm = &_vppcom_main;
@@
-33,6
+33,7
@@
vppcom_cfg_init (vppcom_cfg_t * vcl_cfg)
ASSERT (vcl_cfg);
vcl_cfg->heapsize = (256ULL << 20);
ASSERT (vcl_cfg);
vcl_cfg->heapsize = (256ULL << 20);
+ vcl_cfg->max_workers = 16;
vcl_cfg->vpp_api_q_length = 1024;
vcl_cfg->segment_baseva = 0x200000000ULL;
vcl_cfg->segment_size = (256 << 20);
vcl_cfg->vpp_api_q_length = 1024;
vcl_cfg->segment_baseva = 0x200000000ULL;
vcl_cfg->segment_size = (256 << 20);
@@
-169,6
+170,7
@@
vppcom_cfg_heapsize (char *conf_fname)
goto defaulted;
}
}
goto defaulted;
}
}
+ free (argv[i]);
}
defaulted:
}
defaulted:
@@
-230,8
+232,7
@@
vppcom_cfg_read_file (char *conf_fname)
if (fstat (fd, &s) < 0)
{
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;
}
getpid (), conf_fname);
goto file_done;
}
@@
-253,19
+254,24
@@
vppcom_cfg_read_file (char *conf_fname)
if (unformat (line_input, "vcl {"))
{
vc_cfg_input = 1;
if (unformat (line_input, "vcl {"))
{
vc_cfg_input = 1;
+ unformat_free (line_input);
continue;
}
if (vc_cfg_input)
{
continue;
}
if (vc_cfg_input)
{
- if (unformat (line_input, "heapsize %s", &chroot_path))
+ if (unformat (line_input, "heapsize %U", unformat_memory_size,
+ &vcl_cfg->heapsize))
{
{
- vec_terminate_c_string (chroot_path);
- VCFG_DBG (0,
- "VCL<%d>: configured heapsize %s, actual heapsize %ld"
- " (0x%lx)", getpid (), chroot_path, vcl_cfg->heapsize,
+ VCFG_DBG (0, "VCL<%d>: configured heapsize %lu", getpid (),
vcl_cfg->heapsize);
vcl_cfg->heapsize);
- vec_free (chroot_path);
+ }
+ 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);
}
else if (unformat (line_input, "api-prefix %s", &chroot_path))
{
}
else if (unformat (line_input, "api-prefix %s", &chroot_path))
{
@@
-276,9
+282,8
@@
vppcom_cfg_read_file (char *conf_fname)
chroot_path, 0);
vl_set_memory_root_path ((char *) chroot_path);
chroot_path, 0);
vl_set_memory_root_path ((char *) chroot_path);
- VCFG_DBG (0,
- "VCL<%d>: configured api-prefix (%s) and api filename"
- " (%s)", getpid (), chroot_path,
+ VCFG_DBG (0, "VCL<%d>: configured api-prefix (%s) and api "
+ "filename (%s)", getpid (), chroot_path,
vcl_cfg->vpp_api_filename);
chroot_path = 0; /* Don't vec_free() it! */
}
vcl_cfg->vpp_api_filename);
chroot_path = 0; /* Don't vec_free() it! */
}
@@
-489,6
+494,7
@@
vppcom_cfg_read_file (char *conf_fname)
vc_cfg_input = 0;
VCFG_DBG (0, "VCL<%d>: completed parsing vppcom config!",
getpid ());
vc_cfg_input = 0;
VCFG_DBG (0, "VCL<%d>: completed parsing vppcom config!",
getpid ());
+ unformat_free (line_input);
goto input_done;
}
else
goto input_done;
}
else
@@
-500,6
+506,7
@@
vppcom_cfg_read_file (char *conf_fname)
&line_input->buffer[line_input->index]);
}
}
&line_input->buffer[line_input->index]);
}
}
+ unformat_free (line_input);
}
}
}
}