summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp/trex_stateless_dp_core.cpp
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-02-16 10:27:32 +0200
committerHanoh Haim <hhaim@cisco.com>2016-02-16 10:27:32 +0200
commitecbb10f1ce8303c5803fa9331198ce6d98b3e3fa (patch)
tree4e9d8437b9bdda1961852c7fa2db611cd398d8cf /src/stateless/dp/trex_stateless_dp_core.cpp
parentaebe518a0f109f25928cf82eb998e7b7602a2c03 (diff)
add action counter
Diffstat (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp19
1 files changed, 16 insertions, 3 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 */