summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-03-07 12:52:31 -0500
committerFlorin Coras <florin.coras@gmail.com>2017-03-07 21:33:46 +0000
commit45e4f365086267ef2551b1dedf4e309bdd00a34a (patch)
tree140db35fa966369f131575648dcce7b61799b6e5
parent3466c30261950823828d1dad0d2fb170ee2f9aaf (diff)
Missing plugin binary API command fns found after brief search
Create hash tables before loading plugins. Previous init sequence wiped out most if not all of them. Change-Id: I5dd628895f68f740d525951511a9fef1822d39da Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--src/vat/api_format.c2
-rw-r--r--src/vat/plugin.c1
-rw-r--r--src/vpp/api/api_main.c10
-rw-r--r--src/vpp/vnet/main.c6
4 files changed, 17 insertions, 2 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index b5943f030a6..fb596fe69d0 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -18314,13 +18314,13 @@ vat_api_hookup (vat_main_t * vam)
#if (VPP_API_TEST_BUILTIN==0)
vl_msg_api_set_first_available_msg_id (VL_MSG_FIRST_AVAILABLE);
-#endif
vam->sw_if_index_by_interface_name = hash_create_string (0, sizeof (uword));
vam->function_by_name = hash_create_string (0, sizeof (uword));
vam->help_by_name = hash_create_string (0, sizeof (uword));
+#endif
/* API messages we can send */
#define _(n,h) hash_set_mem (vam->function_by_name, #n, api_##n);
diff --git a/src/vat/plugin.c b/src/vat/plugin.c
index c1cc928c217..20de8c50b6f 100644
--- a/src/vat/plugin.c
+++ b/src/vat/plugin.c
@@ -181,7 +181,6 @@ vat_plugin_init (vat_main_t * vam)
{
plugin_main_t *pm = &vat_plugin_main;
-
pm->plugin_path = format (0, "%s%c", vat_plugin_path, 0);
if (vat_plugin_name_filter)
pm->plugin_name_filter = format (0, "%s%c", vat_plugin_name_filter, 0);
diff --git a/src/vpp/api/api_main.c b/src/vpp/api/api_main.c
index 6ae510b16b6..7913bc01e9d 100644
--- a/src/vpp/api/api_main.c
+++ b/src/vpp/api/api_main.c
@@ -56,6 +56,16 @@ api_main_init (vlib_main_t * vm)
VLIB_INIT_FUNCTION (api_main_init);
+void
+vat_plugin_hash_create (void)
+{
+ vat_main_t *vam = &vat_main;
+
+ vam->sw_if_index_by_interface_name = hash_create_string (0, sizeof (uword));
+ vam->function_by_name = hash_create_string (0, sizeof (uword));
+ vam->help_by_name = hash_create_string (0, sizeof (uword));
+}
+
static clib_error_t *
api_command_fn (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
index 4a96ca94321..a566d956dfe 100644
--- a/src/vpp/vnet/main.c
+++ b/src/vpp/vnet/main.c
@@ -25,6 +25,8 @@
static void
vpe_main_init (vlib_main_t * vm)
{
+ void vat_plugin_hash_create (void);
+
if (CLIB_DEBUG > 0)
vlib_unix_cli_set_prompt ("DBGvpp# ");
else
@@ -33,6 +35,10 @@ vpe_main_init (vlib_main_t * vm)
/* Turn off network stack components which we don't want */
vlib_mark_init_function_complete (vm, srp_init);
+ /*
+ * Create the binary api plugin hashes before loading plugins
+ */
+ vat_plugin_hash_create ();
}
/*