summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/bp_sim.cpp8
-rwxr-xr-xsrc/bp_sim.h3
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp1
3 files changed, 7 insertions, 5 deletions
diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp
index c4f22195..d2b75122 100755
--- a/src/bp_sim.cpp
+++ b/src/bp_sim.cpp
@@ -3225,7 +3225,7 @@ bool CNodeGenerator::Create(CFlowGenListPerThread * parent){
m_socket_id =0;
m_is_realtime =CGlobalInfo::is_realtime();
m_realtime_his.Create();
- m_flow_sync_node = NULL;
+ m_last_sync_time_sec = 0;
return(true);
}
@@ -3840,7 +3840,7 @@ FORCE_NO_INLINE void CNodeGenerator::handle_time_strech(dsec_t cur_time,
CFlowGenListPerThread *thread) {
/* check if flow sync message was delayed too much */
- if ( (cur_time - m_flow_sync_node->m_time) > SYNC_TIME_OUT ) {
+ if ( (cur_time - m_last_sync_time_sec) > SYNC_TIME_OUT ) {
handle_maintenance(thread);
}
@@ -3975,6 +3975,9 @@ CNodeGenerator::handle_maintenance(CFlowGenListPerThread *thread) {
thread->tickle(); /* tickle the watchdog */
thread->check_msgs(); /* check messages */
m_v_if->flush_tx_queue(); /* flush pkt each timeout */
+
+ /* save last sync time as realtime */
+ m_last_sync_time_sec = now_sec();
}
@@ -4445,7 +4448,6 @@ void CFlowGenListPerThread::start_generate_stateful(std::string erf_file_name,
node->m_type = CGenNode::FLOW_SYNC;
node->m_time = m_cur_time_sec + SYNC_TIME_OUT ;
- m_node_gen.m_flow_sync_node = node;
m_node_gen.add_node(node);
#ifdef _DEBUG
diff --git a/src/bp_sim.h b/src/bp_sim.h
index 7f9fee81..5516dc94 100755
--- a/src/bp_sim.h
+++ b/src/bp_sim.h
@@ -2194,7 +2194,8 @@ public:
uint64_t m_non_active;
uint64_t m_limit;
CTimeHistogram m_realtime_his;
- const CGenNode *m_flow_sync_node;
+
+ dsec_t m_last_sync_time_sec;
};
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp
index 75af7d26..5ad15033 100644
--- a/src/stateless/dp/trex_stateless_dp_core.cpp
+++ b/src/stateless/dp/trex_stateless_dp_core.cpp
@@ -695,7 +695,6 @@ TrexStatelessDpCore::start_scheduler() {
node_sync->m_type = CGenNode::FLOW_SYNC;
node_sync->m_time = m_core->m_cur_time_sec + SYNC_TIME_OUT;
- m_core->m_node_gen.m_flow_sync_node = node_sync;
m_core->m_node_gen.add_node(node_sync);
double old_offset = 0.0;