From 130c8f744801d71982e30993b884c76d9d97d309 Mon Sep 17 00:00:00 2001 From: Michal Mazur Date: Wed, 31 Jan 2018 22:01:33 +0100 Subject: plugins: odp: Fix minor bugs 1) Remove function vlib_buffer_set_known_state because it is not multi-thread safe. 2) Stop all worker threads before deleting interfaces. 3) Fix style of odp_packet_exit function. 4) Fix infinite loop in odp_config. Change-Id: I4463b4e416e440ac326ddaac8e46a95d17b202d2 Signed-off-by: Michal Mazur --- src/plugins/odp/odp_packet.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/plugins/odp/odp_packet.c') diff --git a/src/plugins/odp/odp_packet.c b/src/plugins/odp/odp_packet.c index c53dcd52..840a7e91 100755 --- a/src/plugins/odp/odp_packet.c +++ b/src/plugins/odp/odp_packet.c @@ -394,6 +394,8 @@ odp_config (vlib_main_t * vm, unformat_input_t * input) char *param = NULL; unformat_input_t sub_input; + unformat_skip_white_space (input); + while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { if (unformat (input, "rx-sched-wait %u", &rx_sched_wait)) @@ -558,18 +560,22 @@ 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_exit (vlib_main_t * vm) { odp_packet_main_t *om = odp_packet_main; odp_packet_if_t *port; + vlib_worker_thread_barrier_sync (vm); + + /* *INDENT-OFF* */ pool_foreach (port, om->interfaces, ({ odp_packet_delete_if (vm, port->host_if_name); })); + /* *INDENT-ON* */ odp_pool_destroy (om->pool); - odp_shm_free (odp_shm_lookup("odp_packet_main")); + odp_shm_free (odp_shm_lookup ("odp_packet_main")); odp_packet_main = 0x0; return 0; -- cgit 1.2.3-korg