summaryrefslogtreecommitdiffstats
path: root/src/latency.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/latency.cpp')
-rw-r--r--src/latency.cpp21
1 files changed, 20 insertions, 1 deletions
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 <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();
}