diff options
Diffstat (limited to 'src/stateless/dp')
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 1 | ||||
-rw-r--r-- | src/stateless/dp/trex_stream_node.h | 20 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index f125a46a..42ff9e24 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -627,6 +627,7 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, node->m_pause =0; node->m_stream_type = stream->m_type; node->m_next_time_offset = 1.0 / stream->get_pps(); + node->m_null_stream = (stream->m_null_stream ? 1 : 0); /* stateless specific fields */ switch ( stream->m_type ) { diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h index 104e4d3b..fa6fd8bd 100644 --- a/src/stateless/dp/trex_stream_node.h +++ b/src/stateless/dp/trex_stream_node.h @@ -84,7 +84,7 @@ private: double m_next_time_offset; /* in sec */ uint16_t m_action_counter; uint8_t m_stat_hw_id; // hw id used to count rx and tx stats - uint8_t m_pad11; + uint8_t m_null_stream; uint32_t m_pad12; stream_state_t m_state; @@ -170,6 +170,15 @@ public: } } + bool is_node_active() { + /* bitwise or - faster instead of two IFs */ + return ((m_pause | m_null_stream) == 0); + } + + bool is_null_stream() { + return (m_null_stream == 1); + } + inline uint8_t get_stream_type(){ return (m_stream_type); } @@ -199,7 +208,7 @@ public: inline void handle_continues(CFlowGenListPerThread *thread) { - if (unlikely (is_pause()==false)) { + if (likely (is_node_active())) { thread->m_node_gen.m_v_if->send_node( (CGenNode *)this); } @@ -211,7 +220,9 @@ public: } inline void handle_multi_burst(CFlowGenListPerThread *thread) { - thread->m_node_gen.m_v_if->send_node( (CGenNode *)this); + if (likely (is_node_active())) { + thread->m_node_gen.m_v_if->send_node( (CGenNode *)this); + } m_single_burst--; if (m_single_burst > 0 ) { @@ -225,7 +236,8 @@ public: set_state(CGenNodeStateless::ss_INACTIVE); if ( thread->set_stateless_next_node(this,m_next_stream) ){ /* update the next stream time using isg */ - m_next_stream->update_refresh_time(m_time); + //m_next_stream->update_refresh_time(m_time + m_next_time_offset); + m_next_stream->update_refresh_time(m_time + m_ref_stream_info->m_delay_next_stream_sec); thread->m_node_gen.m_p_queue.push( (CGenNode *)m_next_stream); }else{ |