diff options
author | 2016-06-07 13:02:08 +0300 | |
---|---|---|
committer | 2016-06-07 13:02:08 +0300 | |
commit | 38bcd9c376add0f94e3f660bbcf0558c55f31135 (patch) | |
tree | f5d6fd309f7995b94d0558ea4ec29ba00faa1c73 /src/latency.cpp | |
parent | 0814f72d66600967c9bf5f1c743ce0ee64e5c1f2 (diff) | |
parent | 918ae3cda75a01c8a4769df79bf6bfd0b270a41f (diff) |
Merge branch 'master' of csi-sceasr-b94:/auto/proj-pcube-b/apps/PL-b/tools/repo//trex-core
Diffstat (limited to 'src/latency.cpp')
-rw-r--r-- | src/latency.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/latency.cpp b/src/latency.cpp index a7652bed..acbe26d4 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 <common/basic_utils.h> 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(); } @@ -792,6 +811,11 @@ void CLatencyManager::start(int iter) { m_rx_check_manager.tw_drain(); } + /* disable the monitor */ + if (m_watchdog) { + m_watchdog->disable_monitor(m_watchdog_handle); + } + } void CLatencyManager::stop(){ |