From 3c4a29e15f3663f6413fbee2562d7d0aa4e2f80d Mon Sep 17 00:00:00 2001 From: imarom Date: Wed, 1 Jun 2016 15:52:00 +0300 Subject: watchdog phase 2 --- src/latency.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/latency.cpp') diff --git a/src/latency.cpp b/src/latency.cpp index a7652bed..fd2a5b5a 100644 --- a/src/latency.cpp +++ b/src/latency.cpp @@ -22,6 +22,8 @@ limitations under the License. #include "latency.h" #include "bp_sim.h" #include "utl_json.h" +#include "trex_watchdog.h" + #include const uint8_t sctp_pkt[]={ @@ -562,6 +564,10 @@ bool CLatencyManager::Create(CLatencyManagerCfg * cfg){ if ( CGlobalInfo::is_learn_mode() ){ m_nat_check_manager.Create(); } + + m_watchdog = NULL; + m_watchdog_handle = -1; + return (true); } @@ -711,7 +717,13 @@ void CLatencyManager::reset(){ } -void CLatencyManager::start(int iter) { +void CLatencyManager::tickle() { + if (m_watchdog) { + m_watchdog->tickle(m_watchdog_handle); + } +} + +void CLatencyManager::start(int iter, TrexWatchDog *watchdog) { m_do_stop =false; m_is_active =false; int cnt=0; @@ -728,6 +740,10 @@ void CLatencyManager::start(int iter) { m_p_queue.push(node); bool do_try_rx_queue =CGlobalInfo::m_options.preview.get_vm_one_queue_enable()?true:false; + if (watchdog) { + m_watchdog = watchdog; + m_watchdog_handle = watchdog->register_monitor("STF RX CORE", 1); + } while ( !m_p_queue.empty() ) { node = m_p_queue.top(); @@ -748,6 +764,9 @@ void CLatencyManager::start(int iter) { switch (node->m_type) { case CGenNode::FLOW_SYNC: + + tickle(); + if ( CGlobalInfo::is_learn_mode() ) { m_nat_check_manager.handle_aging(); } -- cgit From 8feef53b5a272ec7a72f05d1a633d2a18071b775 Mon Sep 17 00:00:00 2001 From: imarom Date: Thu, 2 Jun 2016 13:40:02 +0300 Subject: WATCHDOG - disable monitors when done to avoid crash when joining on other threads --- src/latency.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/latency.cpp') diff --git a/src/latency.cpp b/src/latency.cpp index fd2a5b5a..acbe26d4 100644 --- a/src/latency.cpp +++ b/src/latency.cpp @@ -811,6 +811,11 @@ void CLatencyManager::start(int iter, TrexWatchDog *watchdog) { m_rx_check_manager.tw_drain(); } + /* disable the monitor */ + if (m_watchdog) { + m_watchdog->disable_monitor(m_watchdog_handle); + } + } void CLatencyManager::stop(){ -- cgit