aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Mazur <mkm@semihalf.com>2018-01-31 22:01:33 +0100
committerMichal Mazur <mkm@semihalf.com>2018-02-01 15:42:54 +0100
commit130c8f744801d71982e30993b884c76d9d97d309 (patch)
tree19bbeb56e1a45c87b6aa710786c1951d1da8122c
parentf4ee2e1317bcd182e513b0547aacb387c4feb256 (diff)
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 <mkm@semihalf.com>
-rw-r--r--src/plugins/odp/buffer.c3
-rwxr-xr-xsrc/plugins/odp/odp_packet.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/odp/buffer.c b/src/plugins/odp/buffer.c
index 63d7691..ae6679a 100644
--- a/src/plugins/odp/buffer.c
+++ b/src/plugins/odp/buffer.c
@@ -150,9 +150,6 @@ fill_free_list (vlib_main_t * vm,
vec_add1_aligned (fl->buffers, bi, CLIB_CACHE_LINE_BYTES);
- if (CLIB_DEBUG > 0)
- vlib_buffer_set_known_state (vm, bi, VLIB_BUFFER_KNOWN_FREE);
-
/* Initialize all new buffers. */
vlib_buffer_init_for_free_list (b, fl);
if (fl->buffer_init_function)
diff --git a/src/plugins/odp/odp_packet.c b/src/plugins/odp/odp_packet.c
index c53dcd5..840a7e9 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;