summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp/trex_stream_node.h
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-04-06 17:29:28 +0300
committerimarom <imarom@cisco.com>2016-04-10 12:37:20 +0300
commitff443a39bc967fa58c5fb16d626bb96a2abb59f0 (patch)
tree4cc848c8ef1f9fbe2a99bc55670c04088756a2a9 /src/stateless/dp/trex_stream_node.h
parent1d62dfca8a6c7a3a54c8c08ef1a1332582ba38cb (diff)
NULL stream and multi core better support for streams
Diffstat (limited to 'src/stateless/dp/trex_stream_node.h')
-rw-r--r--src/stateless/dp/trex_stream_node.h20
1 files changed, 16 insertions, 4 deletions
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{