diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-11-22 18:02:22 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-11-22 18:02:22 +0200 |
commit | bd8b640077591377375f2ab5ec6c542119ead0a2 (patch) | |
tree | 9349dfe4649fb14df3a3f2e27324036b1a773782 /src/stateless/dp/trex_stream_node.h | |
parent | b08b2c0990d29141a1c6eecc6a8fed405cf8b979 (diff) |
dp support for pause/resume only continues is supported
Diffstat (limited to 'src/stateless/dp/trex_stream_node.h')
-rw-r--r-- | src/stateless/dp/trex_stream_node.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h index 20e32b78..ccf99eaa 100644 --- a/src/stateless/dp/trex_stream_node.h +++ b/src/stateless/dp/trex_stream_node.h @@ -48,6 +48,7 @@ public: static_assert(sizeof(CGenNodeCommand) == sizeof(CGenNode), "sizeof(CGenNodeCommand) != sizeof(CGenNode)" ); + /* this is a event for stateless */ struct CGenNodeStateless : public CGenNodeBase { friend class TrexStatelessDpCore; @@ -74,7 +75,7 @@ private: stream_state_t m_state; uint8_t m_port_id; uint8_t m_stream_type; /* see TrexStream::STREAM_TYPE ,stream_type_t */ - uint8_t m_pad; + uint8_t m_pause; uint32_t m_single_burst; /* the number of bursts in case of burst */ uint32_t m_single_burst_refill; @@ -112,7 +113,18 @@ public: /* only to be safe */ m_ref_stream_info= NULL; m_next_stream= NULL; + } + bool is_pause(){ + return (m_pause==1?true:false); + } + + void set_pause(bool enable){ + if ( enable ){ + m_pause=1; + }else{ + m_pause=0; + } } inline uint8_t get_stream_type(){ @@ -143,7 +155,10 @@ public: void refresh(); inline void handle_continues(CFlowGenListPerThread *thread) { - thread->m_node_gen.m_v_if->send_node( (CGenNode *)this); + + if (unlikely (is_pause()==false)) { + thread->m_node_gen.m_v_if->send_node( (CGenNode *)this); + } /* in case of continues */ m_time += m_next_time_offset; |