aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-01-23 21:13:45 +0100
committerDave Wallace <dwallacelf@gmail.com>2017-02-03 14:08:47 +0000
commit3b46cba8f4e909bc363403c6c92215159abb2f11 (patch)
treed3d40532a31794a3e521e55a5390e26259115914 /src/vpp/vnet
parent2ae991e27afb3fe2944dd4f60eb2b03f29365c95 (diff)
Plugin infrastructure improvements
This patch replaces requirement for vlib_plugin_register function in the plugin so file and introduces new macro: VLIB_PLUGIN_REGISTER () = { .version = "version string", .version_required = "requred version", .default_disabled = 1, .early_init = "early_init_function_name", }; Plugin will nor be loaded if .default_disabled is set to 1 unless explicitely enabled in startup.conf. If .verstion_required is set, plugin will not be loaded if there is version mismatch between plugin and vpp. This can be bypassed by setting "skip-version-check" for specific plugin. If .early-init string is present, plugin loader will try to resolve this specific symbol in the plugin namespace and make a function call. Following startup.conf configuration is added: plugins { path /path/to/plugin/directory plugin ila_plugin.so { enable skip-version-check } plugin acl_plugin.so { disable } } Change-Id: I706c691dd34d94ffe9e02b59831af8859a95f061 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vpp/vnet')
-rw-r--r--src/vpp/vnet/main.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c
index a252b846..4a96ca94 100644
--- a/src/vpp/vnet/main.c
+++ b/src/vpp/vnet/main.c
@@ -18,7 +18,7 @@
#include <vlib/unix/unix.h>
#include <vnet/plugin/plugin.h>
#include <vnet/ethernet/ethernet.h>
-
+#include <vpp/app/version.h>
#include <vpp/api/vpe_msg_enum.h>
@@ -39,16 +39,7 @@ vpe_main_init (vlib_main_t * vm)
* Load plugins from /usr/lib/vpp_plugins by default
*/
char *vlib_plugin_path = "/usr/lib/vpp_plugins";
-
-void *
-vnet_get_handoff_structure (void)
-{
- static vnet_plugin_handoff_t _rv, *rv = &_rv;
-
- rv->vnet_main = vnet_get_main ();
- rv->ethernet_main = &ethernet_main;
- return (void *) rv;
-}
+char *vlib_plugin_app_version = VPP_BUILD_VER;
int
main (int argc, char *argv[])
@@ -59,7 +50,6 @@ main (int argc, char *argv[])
uword main_heap_size = (1ULL << 30);
u8 *sizep;
u32 size;
- void vlib_set_get_handoff_structure_cb (void *cb);
#if __x86_64__
CLIB_UNUSED (const char *msg)
@@ -206,7 +196,6 @@ defaulted:
#if DPDK == 0
unix_physmem_init (vm, 0 /* fail_if_physical_memory_not_present */ );
#endif
- vlib_set_get_handoff_structure_cb (&vnet_get_handoff_structure);
return vlib_unix_main (argc, argv);
}
else