vcl: ldp support SO_ORIGINAL_DST
[vpp.git] / src / vcl / vcl_cfg.c
index 1d8407b..edea60d 100644 (file)
@@ -252,6 +252,8 @@ vppcom_cfg_read_file (char *conf_fname)
 
   while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
     {
+      /* skip empty newlines as they confuse unformat_line_input */
+      unformat_skip_white_space (input);
       (void) unformat_user (input, unformat_line_input, line_input);
       unformat_skip_white_space (line_input);
 
@@ -414,6 +416,12 @@ vppcom_cfg_read_file (char *conf_fname)
              VCFG_DBG (0, "VCL<%d>: configured app_scope_global (%d)",
                        getpid (), vcl_cfg->app_scope_global);
            }
+         else if (unformat (line_input, "huge_page"))
+           {
+             vcl_cfg->huge_page = 1;
+             VCFG_DBG (0, "VCL<%d>: configured huge_page (%d)", getpid (),
+                       vcl_cfg->huge_page);
+           }
          else if (unformat (line_input, "namespace-secret %lu",
                             &vcl_cfg->namespace_secret))
            {
@@ -429,7 +437,7 @@ vppcom_cfg_read_file (char *conf_fname)
              u32 nsid_vec_len = vec_len (vcl_cfg->namespace_id);
              if (nsid_vec_len > max_nsid_vec_len)
                {
-                 _vec_len (vcl_cfg->namespace_id) = max_nsid_vec_len;
+                 vec_set_len (vcl_cfg->namespace_id, max_nsid_vec_len);
                  VCFG_DBG (0, "VCL<%d>: configured namespace_id is too long,"
                            " truncated to %d characters!",
                            getpid (), max_nsid_vec_len);
@@ -456,6 +464,11 @@ vppcom_cfg_read_file (char *conf_fname)
              VCFG_DBG (0, "VCL<%d>: configured with multithread workers",
                        getpid ());
            }
+         else if (unformat (line_input, "app_original_dst"))
+           {
+             vcl_cfg->app_original_dst = 1;
+             VCFG_DBG (0, "VCL<%d>: support original destination", getpid ());
+           }
          else if (unformat (line_input, "}"))
            {
              vc_cfg_input = 0;
@@ -589,6 +602,13 @@ vppcom_cfg (vppcom_cfg_t * vcl_cfg)
       VCFG_DBG (0, "VCL<%d>: configured app-socket-api (%s)", getpid (),
                vcl_cfg->vpp_app_socket_api);
     }
+  env_var_str = getenv (VPPCOM_ENV_APP_USE_MQ_EVENTFD);
+  if (env_var_str)
+    {
+      vcm->cfg.use_mq_eventfd = 1;
+      VCFG_DBG (0, "VCL<%d>: configured " VPPCOM_ENV_APP_USE_MQ_EVENTFD,
+               getpid ());
+    }
 }
 
 /*