summaryrefslogtreecommitdiffstats
path: root/src/latency.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/latency.cpp')
-rw-r--r--src/latency.cpp33
1 files changed, 9 insertions, 24 deletions
diff --git a/src/latency.cpp b/src/latency.cpp
index acbe26d4..841913cf 100644
--- a/src/latency.cpp
+++ b/src/latency.cpp
@@ -338,9 +338,7 @@ bool CCPortLatency::dump_packet(rte_mbuf_t * m){
uint16_t pkt_size=rte_pktmbuf_pkt_len(m);
utl_DumpBuffer(stdout,p,pkt_size,0);
return (0);
-
-
-
+#if 0
if (pkt_size < ( sizeof(CRx_check_header)+14+20) ) {
assert(0);
}
@@ -348,16 +346,8 @@ bool CCPortLatency::dump_packet(rte_mbuf_t * m){
lp->dump(stdout);
-
- uint16_t vlan_offset=0;
- if ( unlikely( CGlobalInfo::m_options.preview.get_vlan_mode_enable() ) ){
- vlan_offset=4;
- }
-
- (void)vlan_offset;
-
-// utl_DumpBuffer(stdout,p,pkt_size,0);
return (0);
+#endif
}
@@ -565,9 +555,6 @@ bool CLatencyManager::Create(CLatencyManagerCfg * cfg){
m_nat_check_manager.Create();
}
- m_watchdog = NULL;
- m_watchdog_handle = -1;
-
return (true);
}
@@ -718,12 +705,10 @@ void CLatencyManager::reset(){
}
void CLatencyManager::tickle() {
- if (m_watchdog) {
- m_watchdog->tickle(m_watchdog_handle);
- }
+ m_monitor.tickle();
}
-void CLatencyManager::start(int iter, TrexWatchDog *watchdog) {
+void CLatencyManager::start(int iter, bool activate_watchdog) {
m_do_stop =false;
m_is_active =false;
int cnt=0;
@@ -740,9 +725,9 @@ void CLatencyManager::start(int iter, TrexWatchDog *watchdog) {
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);
+ if (activate_watchdog) {
+ m_monitor.create("STF RX CORE", 1);
+ TrexWatchDog::getInstance().register_monitor(&m_monitor);
}
while ( !m_p_queue.empty() ) {
@@ -812,8 +797,8 @@ void CLatencyManager::start(int iter, TrexWatchDog *watchdog) {
}
/* disable the monitor */
- if (m_watchdog) {
- m_watchdog->disable_monitor(m_watchdog_handle);
+ if (activate_watchdog) {
+ m_monitor.disable();
}
}