diff options
Diffstat (limited to 'src/stateless/dp')
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 19 | ||||
-rw-r--r-- | src/stateless/dp/trex_stream_node.h | 3 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index a84269ab..39080453 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -348,9 +348,20 @@ bool TrexStatelessDpCore::set_stateless_next_node(CGenNodeStateless * cur_node, assert(state != CGenNodeStateless::ss_FREE_RESUSE); if (state == CGenNodeStateless::ss_INACTIVE ) { - /* refill start info and scedule, no update in active streams */ - next_node->refresh(); - schedule = true; + if (cur_node->m_action_counter > 0) { + cur_node->m_action_counter--; + if (cur_node->m_action_counter==0) { + to_stop_port = lp_port->update_number_of_active_streams(1); + }else{ + /* refill start info and scedule, no update in active streams */ + next_node->refresh(); + schedule = true; + } + }else{ + /* refill start info and scedule, no update in active streams */ + next_node->refresh(); + schedule = true; + } }else{ to_stop_port = lp_port->update_number_of_active_streams(1); @@ -554,6 +565,8 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, node->m_cache_mbuf=0; node->m_type = CGenNode::STATELESS_PKT; + node->m_action_counter = stream->m_action_count; + /* clone the stream from control plane memory to DP memory */ node->m_ref_stream_info = stream->clone(); /* no need for this memory anymore on the control plane memory */ diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h index db7f19e8..ab43defe 100644 --- a/src/stateless/dp/trex_stream_node.h +++ b/src/stateless/dp/trex_stream_node.h @@ -81,7 +81,8 @@ private: void * m_cache_mbuf; double m_next_time_offset; /* in sec */ - uint32_t m_pad11; + uint16_t m_action_counter; + uint16_t m_pad11; uint32_t m_pad12; stream_state_t m_state; |