From ecbb10f1ce8303c5803fa9331198ce6d98b3e3fa Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 16 Feb 2016 10:27:32 +0200 Subject: add action counter --- src/stateless/dp/trex_stateless_dp_core.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp') 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 */ -- cgit 1.2.3-korg