aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ikev2
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-07-09 10:04:18 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-07-09 15:24:41 +0000
commit21a438465ca0dee88d13d9dd9621929116c95614 (patch)
tree863a47f5c77e24b7fdee96db22080ff0db52e397 /src/plugins/ikev2
parent3f5ebed6ea3a024b7396afe81f895719a8286681 (diff)
vat: unload unused vat plugins
If the corresponding vpp plugin is absent, return a non-zero clib_error_t * from vat_plugin_register ("xxx plugin not loaded"). The vat plugin calls dlclose on the vat plugin, and it disappears. Depending on the plugin configuration, this can reduce the vpp virtual size by several gigabytes. Added a VAT_PLUGIN(<plugin-name>) macro to vat_helper_macros, clean up boilerplate vat_plugin_register() implementations. Fixed a number of non-standard vat_plugin_register methods. Type: refactor Change-Id: Iac908e5af7d5497c78d6aa9c3c51cdae08374045 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/plugins/ikev2')
-rw-r--r--src/plugins/ikev2/ikev2_test.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/plugins/ikev2/ikev2_test.c b/src/plugins/ikev2/ikev2_test.c
index 68c50684824..57724b84161 100644
--- a/src/plugins/ikev2/ikev2_test.c
+++ b/src/plugins/ikev2/ikev2_test.c
@@ -807,7 +807,7 @@ _(ikev2_initiate_del_child_sa, "<ispi>") \
_(ikev2_initiate_rekey_child_sa, "<ispi>")
static void
-ikev2_vat_api_hookup (vat_main_t * vam)
+ikev2_api_hookup (vat_main_t * vam)
{
ikev2_test_main_t *sm = &ikev2_test_main;
/* Hook up handlers for replies from the data plane plug-in */
@@ -833,24 +833,7 @@ ikev2_vat_api_hookup (vat_main_t * vam)
#undef _
}
-clib_error_t *
-vat_plugin_register (vat_main_t * vam)
-{
- ikev2_test_main_t *sm = &ikev2_test_main;
- u8 *name;
-
- sm->vat_main = vam;
-
- name = format (0, "ikev2_%08x%c", api_version, 0);
- sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name);
-
- if (sm->msg_id_base != (u16) ~ 0)
- ikev2_vat_api_hookup (vam);
-
- vec_free (name);
-
- return 0;
-}
+VAT_PLUGIN_REGISTER (ikev2);
/*
* fd.io coding-style-patch-verification: ON