From ca80025805230b34daa10fc1eb16600080c2a54f Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Mon, 16 Jan 2017 21:29:39 +0100 Subject: dpdk: register rte_delay_us callback from vnet Change-Id: Ibf7fc9a54d3fbee431b4814fa8abc5ba29ed9eef Signed-off-by: Damjan Marion --- src/vpp/vnet/main.c | 62 ----------------------------------------------------- 1 file changed, 62 deletions(-) (limited to 'src/vpp') diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c index e4695e1e..a252b846 100644 --- a/src/vpp/vnet/main.c +++ b/src/vpp/vnet/main.c @@ -21,62 +21,6 @@ #include -#if DPDK -#include - -/* - * Called by the dpdk driver's rte_delay_us() function. - * Return 0 to have the dpdk do a regular delay loop. - * Return 1 if to skip the delay loop because we are suspending - * the calling vlib process instead. - */ -int -rte_delay_us_override (unsigned us) -{ - vlib_main_t *vm; - - /* Don't bother intercepting for short delays */ - if (us < 10) - return 0; - - /* - * Only intercept if we are in a vlib process. - * If we are called from a vlib worker thread or the vlib main - * thread then do not intercept. (Must not be called from an - * independent pthread). - */ - if (os_get_cpu_number () == 0) - { - /* - * We're in the vlib main thread or a vlib process. Make sure - * the process is running and we're not still initializing. - */ - vm = vlib_get_main (); - if (vlib_in_process_context (vm)) - { - /* Only suspend for the admin_down_process */ - vlib_process_t *proc = vlib_get_current_process (vm); - if (!(proc->flags & VLIB_PROCESS_IS_RUNNING) || - (proc->node_runtime.function != admin_up_down_process)) - return 0; - - f64 delay = 1e-6 * us; - vlib_process_suspend (vm, delay); - return 1; - } - } - return 0; // no override -} - -#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0) -static void -rte_delay_us_override_cb (unsigned us) -{ - if (rte_delay_us_override (us) == 0) - rte_delay_us_block (us); -} -#endif -#endif static void vpe_main_init (vlib_main_t * vm) @@ -89,12 +33,6 @@ vpe_main_init (vlib_main_t * vm) /* Turn off network stack components which we don't want */ vlib_mark_init_function_complete (vm, srp_init); -#if DPDK -#if RTE_VERSION >= RTE_VERSION_NUM(16, 11, 0, 0) - /* register custom delay function */ - rte_delay_us_callback_register (rte_delay_us_override_cb); -#endif -#endif } /* -- cgit 1.2.3-korg