X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=VNFs%2FDPPD-PROX%2Frun.c;h=c05f0a9ff9e2cb9f58063bb824d49cf76a0cb386;hb=18dbfb93ed8aa67fc9266fa1a6ab40baaf54872a;hp=2ad8aca1f6b603c3cf2d0cfef85a902609caba13;hpb=deae87b73684b3a7a96c64c918c0342a52262744;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/run.c b/VNFs/DPPD-PROX/run.c index 2ad8aca1..c05f0a9f 100644 --- a/VNFs/DPPD-PROX/run.c +++ b/VNFs/DPPD-PROX/run.c @@ -78,10 +78,7 @@ static void update_link_states(void) port_cfg = &prox_port_cfg[portid]; rte_eth_link_get_nowait(portid, &link); -#if RTE_VERSION < RTE_VERSION_NUM(16,4,0,0) - // On more recent DPDK, we use the speed_capa of the port, and not the negotiated speed port_cfg->link_speed = link.link_speed; -#endif 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); @@ -240,6 +237,13 @@ void __attribute__((noreturn)) run(uint32_t flags) 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) { @@ -257,6 +261,13 @@ void __attribute__((noreturn)) run(uint32_t flags) 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; + } } }