#include "input.h"
#include "input_curses.h"
#include "input_conn.h"
+#include "handle_master.h"
static int needs_refresh;
static uint64_t update_interval;
port_cfg = &prox_port_cfg[portid];
rte_eth_link_get_nowait(portid, &link);
- port_cfg->link_up = link.link_status;
port_cfg->link_speed = link.link_speed;
+ if (port_cfg->link_up != link.link_status) {
+ port_cfg->link_up = link.link_status;
+ plog_info("port %d: Link speed now %d Mbps\n", portid, link.link_speed);
+ }
}
}
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;
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)
cmd_rx_tx_info();
print_warnings();
- while (stop_prox == 0) {
-
- if (update_interval < update_interval_threshold)
- busy_wait_until(next_update);
- else
- multiplexed_input_stats(next_update);
-
- next_update += update_interval;
-
- stats_update(stats_cons_flags);
- stats_cons_notify();
-
- if (stop_tsc && rte_rdtsc() >= stop_tsc) {
- stop_prox = 1;
+ 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;
+ }
+ if ((prox_cfg.heartbeat_tsc) && (prox_cfg.heartbeat_timeout) && (rte_rdtsc() >= prox_cfg.heartbeat_tsc)) {
+ plog_info("Stopping to handle client as heartbeat timed out\n");
+ stop_core_all(-1);
+ stop_handling_client();
+ req_refresh();
+ prox_cfg.heartbeat_tsc = 0;
+ }
+ }
+ } else {
+ while (stop_prox == 0) {
+
+ if (update_interval < update_interval_threshold)
+ busy_wait_until(next_update);
+ else
+ multiplexed_input_stats(next_update);
+
+ next_update += update_interval;
+
+ stats_update(stats_cons_flags);
+ stats_cons_notify();
+
+ if (stop_tsc && rte_rdtsc() >= stop_tsc) {
+ stop_prox = 1;
+ }
+ if ((prox_cfg.heartbeat_tsc) && (prox_cfg.heartbeat_timeout) && (rte_rdtsc() >= prox_cfg.heartbeat_tsc)) {
+ plog_info("Stopping to handle client as heartbeat timed out\n");
+ stop_core_all(-1);
+ stop_handling_client();
+ req_refresh();
+ prox_cfg.heartbeat_tsc = 0;
+ }
}
}