diff options
author | Florin Coras <fcoras@cisco.com> | 2023-03-09 18:23:05 -0800 |
---|---|---|
committer | Dave Barach <vpp@barachs.net> | 2023-03-10 16:43:33 +0000 |
commit | c6c4e866378318e966e011cc749b7a2e2ce741f1 (patch) | |
tree | c2d36721ae5f0471020abdafba9b67f14fbebc93 /src/vcl/ldp.c | |
parent | 767a9ab4b1f77760a633ba3de30a0dcad44cb4b1 (diff) |
vcl: init ldp config before vcl init
This avoids printing ldp debug messages while debug is disabled and vcl
is initializing.
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5dfd1d59032db937fea146b6b84b8e26307a0de0
Diffstat (limited to 'src/vcl/ldp.c')
-rw-r--r-- | src/vcl/ldp.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c index 9876c1ea17a..b750671ecd6 100644 --- a/src/vcl/ldp.c +++ b/src/vcl/ldp.c @@ -194,31 +194,9 @@ ldp_alloc_workers (void) pool_alloc (ldp->workers, LDP_MAX_NWORKERS); } -static int -ldp_init (void) +static void +ldp_init_cfg (void) { - ldp_worker_ctx_t *ldpw; - int rv; - - ASSERT (!ldp->init); - - ldp->init = 1; - ldp->vcl_needs_real_epoll = 1; - rv = vls_app_create (ldp_get_app_name ()); - if (rv != VPPCOM_OK) - { - ldp->vcl_needs_real_epoll = 0; - if (rv == VPPCOM_EEXIST) - return 0; - LDBG (2, "\nERROR: ldp_init: vppcom_app_create()" - " failed! rv = %d (%s)\n", rv, vppcom_retval_str (rv)); - ldp->init = 0; - return rv; - } - ldp->vcl_needs_real_epoll = 0; - ldp_alloc_workers (); - ldpw = ldp_worker_get_current (); - char *env_var_str = getenv (LDP_ENV_DEBUG); if (env_var_str) { @@ -298,12 +276,39 @@ ldp_init (void) { ldp->transparent_tls = 1; } +} + +static int +ldp_init (void) +{ + ldp_worker_ctx_t *ldpw; + int rv; + + ASSERT (!ldp->init); + + ldp_init_cfg (); + ldp->init = 1; + ldp->vcl_needs_real_epoll = 1; + rv = vls_app_create (ldp_get_app_name ()); + if (rv != VPPCOM_OK) + { + ldp->vcl_needs_real_epoll = 0; + if (rv == VPPCOM_EEXIST) + return 0; + LDBG (2, + "\nERROR: ldp_init: vppcom_app_create()" + " failed! rv = %d (%s)\n", + rv, vppcom_retval_str (rv)); + ldp->init = 0; + return rv; + } + ldp->vcl_needs_real_epoll = 0; + ldp_alloc_workers (); + ldpw = ldp_worker_get_current (); - /* *INDENT-OFF* */ pool_foreach (ldpw, ldp->workers) { clib_memset (&ldpw->clib_time, 0, sizeof (ldpw->clib_time)); } - /* *INDENT-ON* */ LDBG (0, "LDP initialization: done!"); |