X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Frun.c;h=6ffd76bec3bf71e0771db2705b545be81b131198;hb=9e5b1c09840e5536ad74b4143e31cbd04d7e966c;hp=971d71480a573a5b5998fb9f67500ea9ab760fb4;hpb=4eca0440aee462f842567d5ef8b8796c27f4dd1b;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/run.c b/VNFs/DPPD-PROX/run.c index 971d7148..6ffd76be 100644 --- a/VNFs/DPPD-PROX/run.c +++ b/VNFs/DPPD-PROX/run.c @@ -37,6 +37,7 @@ #include "input.h" #include "input_curses.h" #include "input_conn.h" +#include "handle_master.h" static int needs_refresh; static uint64_t update_interval; @@ -79,6 +80,7 @@ static void update_link_states(void) rte_eth_link_get_nowait(portid, &link); port_cfg->link_up = link.link_status; port_cfg->link_speed = link.link_speed; + plog_info("Link speed now %d Mbps\n", port_cfg->link_speed); } } @@ -127,7 +129,10 @@ static void busy_wait_until(uint64_t deadline) static void multiplexed_input_stats(uint64_t deadline) { - input_proc_until(deadline); + if (deadline) + input_proc_until(deadline); + else + input_proc(); if (needs_refresh) { needs_refresh = 0; @@ -164,6 +169,7 @@ void __attribute__((noreturn)) run(uint32_t flags) uint64_t cur_tsc; uint64_t next_update; uint64_t stop_tsc = 0; + int ret = 0; const uint64_t update_interval_threshold = usec_to_tsc(1); if (flags & DSF_LISTEN_TCP) @@ -209,20 +215,43 @@ void __attribute__((noreturn)) run(uint32_t flags) cmd_rx_tx_info(); print_warnings(); - while (stop_prox == 0) { + struct task_master *task = (struct task_master *)lcore_cfg[prox_cfg.master].tasks_all[0]; + if (handle_ctrl_plane) { + while (stop_prox == 0) { + ret = 1; + // Run ctrl plane for max 10 msec to let screen and keyboard updates + if (prox_cfg.flags & DSF_CTRL_PLANE_ENABLED) { + uint64_t ctrl_plane_update = rte_rdtsc() + msec_to_tsc(10); + while ((ret) && (rte_rdtsc() < ctrl_plane_update)) + ret = handle_ctrl_plane(lcore_cfg[prox_cfg.master].tasks_all[0], NULL, 0); + } + multiplexed_input_stats(0); + if (rte_rdtsc() < next_update) + continue; + next_update += update_interval; + stats_update(stats_cons_flags); + stats_cons_notify(); + + if (stop_tsc && rte_rdtsc() >= stop_tsc) { + stop_prox = 1; + } + } + } else { + while (stop_prox == 0) { - if (update_interval < update_interval_threshold) - busy_wait_until(next_update); - else - multiplexed_input_stats(next_update); + if (update_interval < update_interval_threshold) + busy_wait_until(next_update); + else + multiplexed_input_stats(next_update); - next_update += update_interval; + next_update += update_interval; - stats_update(stats_cons_flags); - stats_cons_notify(); + stats_update(stats_cons_flags); + stats_cons_notify(); - if (stop_tsc && rte_rdtsc() >= stop_tsc) { - stop_prox = 1; + if (stop_tsc && rte_rdtsc() >= stop_tsc) { + stop_prox = 1; + } } }