aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rwxr-xr-xsrc/plugins/odp/odp_packet.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/plugins/odp/odp_packet.c b/src/plugins/odp/odp_packet.c
index 2cf6ff90..e1b259fd 100755
--- a/src/plugins/odp/odp_packet.c
+++ b/src/plugins/odp/odp_packet.c
@@ -278,7 +278,6 @@ odp_packet_delete_if (vlib_main_t * vm, u8 * host_if_name)
odp_packet_main_t *om = odp_packet_main;
odp_packet_if_t *oif = 0;
uword *p;
- vlib_thread_main_t *tm = vlib_get_thread_main ();
p = mhash_get (&om->if_index_by_host_if_name, host_if_name);
@@ -306,13 +305,7 @@ odp_packet_delete_if (vlib_main_t * vm, u8 * host_if_name)
pool_put (om->interfaces, oif);
- if (tm->n_vlib_mains > 1 && pool_elts (om->interfaces) == 0)
- {
- odp_pool_destroy (om->pool);
- }
-
return 0;
-
}
static clib_error_t *
@@ -559,6 +552,26 @@ odp_packet_init (vlib_main_t * vm)
VLIB_INIT_FUNCTION (odp_packet_init);
+static clib_error_t *
+odp_packet_exit (vlib_main_t *vm)
+{
+ odp_packet_main_t *om = odp_packet_main;
+ odp_packet_if_t *port;
+
+ pool_foreach (port, om->interfaces,
+ ({
+ odp_packet_delete_if (vm, port->host_if_name);
+ }));
+
+ odp_pool_destroy (om->pool);
+ odp_shm_free (odp_shm_lookup("odp_packet_main"));
+ odp_packet_main = 0x0;
+
+ return 0;
+}
+
+VLIB_MAIN_LOOP_EXIT_FUNCTION (odp_packet_exit);
+
/* *INDENT-OFF* */
VLIB_PLUGIN_REGISTER () = {
.version = VPP_BUILD_VER,