diff options
author | 2015-11-15 18:17:13 +0200 | |
---|---|---|
committer | 2015-11-15 18:17:13 +0200 | |
commit | f9365e5150f9479dfbf4436d22874f121afbb5c8 (patch) | |
tree | f97b9dfd52b880eeab0aba631e74231abdb851f1 /src/stateless | |
parent | 8017ebe740a1c1d138559795aea9d8ee72236da2 (diff) | |
parent | 94b1238942da24e47fb3e689bf695e815a604eb0 (diff) |
Merge branch 'rpc_intg1'
Diffstat (limited to 'src/stateless')
-rw-r--r-- | src/stateless/cp/trex_stateless_port.cpp | 4 | ||||
-rw-r--r-- | src/stateless/cp/trex_stateless_port.h | 2 | ||||
-rw-r--r-- | src/stateless/cp/trex_streams_compiler.cpp | 3 | ||||
-rw-r--r-- | src/stateless/cp/trex_streams_compiler.h | 8 | ||||
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 6 | ||||
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.h | 2 | ||||
-rw-r--r-- | src/stateless/messaging/trex_stateless_messaging.cpp | 6 | ||||
-rw-r--r-- | src/stateless/messaging/trex_stateless_messaging.h | 3 |
8 files changed, 11 insertions, 23 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp index 7f2382d3..cbc5a328 100644 --- a/src/stateless/cp/trex_stateless_port.cpp +++ b/src/stateless/cp/trex_stateless_port.cpp @@ -86,7 +86,7 @@ TrexStatelessPort::release(void) { * */ void -TrexStatelessPort::start_traffic(double mul) { +TrexStatelessPort::start_traffic(double mul, double duration) { /* command allowed only on state stream */ verify_state(PORT_STATE_STREAMS); @@ -105,7 +105,7 @@ TrexStatelessPort::start_traffic(double mul) { } /* generate a message to all the relevant DP cores to start transmitting */ - TrexStatelessCpToDpMsgBase *start_msg = new TrexStatelessDpStart(compiled_obj); + TrexStatelessCpToDpMsgBase *start_msg = new TrexStatelessDpStart(compiled_obj, duration); send_message_to_dp(start_msg); diff --git a/src/stateless/cp/trex_stateless_port.h b/src/stateless/cp/trex_stateless_port.h index 90bf936e..b533f793 100644 --- a/src/stateless/cp/trex_stateless_port.h +++ b/src/stateless/cp/trex_stateless_port.h @@ -72,7 +72,7 @@ public: * start traffic * throws TrexException in case of an error */ - void start_traffic(double mul); + void start_traffic(double mul, double duration = -1); /** * stop traffic diff --git a/src/stateless/cp/trex_streams_compiler.cpp b/src/stateless/cp/trex_streams_compiler.cpp index 80cdb31c..580db51c 100644 --- a/src/stateless/cp/trex_streams_compiler.cpp +++ b/src/stateless/cp/trex_streams_compiler.cpp @@ -27,7 +27,6 @@ limitations under the License. * stream compiled object *************************************/ TrexStreamsCompiledObj::TrexStreamsCompiledObj(uint8_t port_id, double mul) : m_port_id(port_id), m_mul(mul) { - m_duration_sim=-1.0; } TrexStreamsCompiledObj::~TrexStreamsCompiledObj() { @@ -61,8 +60,6 @@ TrexStreamsCompiledObj::clone() { new_compiled_obj->m_mul = m_mul; - new_compiled_obj->m_duration_sim = m_duration_sim; - return new_compiled_obj; } diff --git a/src/stateless/cp/trex_streams_compiler.h b/src/stateless/cp/trex_streams_compiler.h index 78ac1ac7..44c8a0fc 100644 --- a/src/stateless/cp/trex_streams_compiler.h +++ b/src/stateless/cp/trex_streams_compiler.h @@ -48,13 +48,6 @@ public: return m_objs; } - void set_simulation_duration(double duration){ - m_duration_sim=duration; - } - - double get_simulation_duration(){ - return (m_duration_sim); - } /** * clone the compiled object * @@ -71,7 +64,6 @@ private: uint8_t m_port_id; double m_mul; - double m_duration_sim; /* duration for all simulation */ }; class TrexStreamsCompiler { diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index 96c18dbd..eabd6fdb 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -207,14 +207,12 @@ TrexStatelessDpCore::add_cont_stream(TrexStream * stream, } void -TrexStatelessDpCore::start_traffic(TrexStreamsCompiledObj *obj) { +TrexStatelessDpCore::start_traffic(TrexStreamsCompiledObj *obj, double duration) { for (auto single_stream : obj->get_objects()) { add_cont_stream(single_stream.m_stream,obj); } - double duration=obj->get_simulation_duration(); - - if ( duration >0.0){ + if ( duration > 0.0 ){ add_duration( duration ); } } diff --git a/src/stateless/dp/trex_stateless_dp_core.h b/src/stateless/dp/trex_stateless_dp_core.h index 1029213d..7448d215 100644 --- a/src/stateless/dp/trex_stateless_dp_core.h +++ b/src/stateless/dp/trex_stateless_dp_core.h @@ -75,7 +75,7 @@ public: * @param pkt * @param pkt_len */ - void start_traffic(TrexStreamsCompiledObj *obj); + void start_traffic(TrexStreamsCompiledObj *obj, double duration = -1); /** * stop all traffic for this core diff --git a/src/stateless/messaging/trex_stateless_messaging.cpp b/src/stateless/messaging/trex_stateless_messaging.cpp index 032559bc..d8ebc52c 100644 --- a/src/stateless/messaging/trex_stateless_messaging.cpp +++ b/src/stateless/messaging/trex_stateless_messaging.cpp @@ -26,7 +26,7 @@ limitations under the License. /************************* start traffic message ************************/ -TrexStatelessDpStart::TrexStatelessDpStart(TrexStreamsCompiledObj *obj) : m_obj(obj) { +TrexStatelessDpStart::TrexStatelessDpStart(TrexStreamsCompiledObj *obj, double duration) : m_obj(obj), m_duration(duration) { } @@ -39,7 +39,7 @@ TrexStatelessDpStart::clone() { TrexStreamsCompiledObj *new_obj = m_obj->clone(); - TrexStatelessCpToDpMsgBase *new_msg = new TrexStatelessDpStart(new_obj); + TrexStatelessCpToDpMsgBase *new_msg = new TrexStatelessDpStart(new_obj, m_duration); return new_msg; } @@ -53,7 +53,7 @@ TrexStatelessDpStart::~TrexStatelessDpStart() { bool TrexStatelessDpStart::handle(TrexStatelessDpCore *dp_core) { - dp_core->start_traffic(m_obj); + dp_core->start_traffic(m_obj, m_duration); return true; } diff --git a/src/stateless/messaging/trex_stateless_messaging.h b/src/stateless/messaging/trex_stateless_messaging.h index d288fc83..90897665 100644 --- a/src/stateless/messaging/trex_stateless_messaging.h +++ b/src/stateless/messaging/trex_stateless_messaging.h @@ -66,7 +66,7 @@ public: class TrexStatelessDpStart : public TrexStatelessCpToDpMsgBase { public: - TrexStatelessDpStart(TrexStreamsCompiledObj *obj); + TrexStatelessDpStart(TrexStreamsCompiledObj *obj, double duration); ~TrexStatelessDpStart(); @@ -77,6 +77,7 @@ public: private: TrexStreamsCompiledObj *m_obj; + double m_duration; }; /** |