diff options
author | imarom <imarom@cisco.com> | 2015-10-28 12:45:57 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2015-10-28 12:45:57 +0200 |
commit | cb8bc9bda11c951b8b91a635d8d4d6df8d5a0ab8 (patch) | |
tree | cf63a7ec23094b48bcf59e5c0d95aa6d6aeb4e26 /src/stateless/dp | |
parent | ea0b6efc3a41f425e46d81f4b6b8bbbf3238add1 (diff) |
support for multiple streams
Diffstat (limited to 'src/stateless/dp')
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 12 | ||||
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.h | 5 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index 20eadfc5..0262a80a 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -20,6 +20,7 @@ limitations under the License. */ #include <trex_stateless_dp_core.h> #include <trex_stateless_messaging.h> +#include <trex_stream.h> #include <bp_sim.h> @@ -74,10 +75,7 @@ TrexStatelessDpCore::handle_pkt_event(CGenNode *node) { } void -TrexStatelessDpCore::start_const_traffic(const uint8_t *pkt, - uint16_t pkt_len, - double pps) { - +TrexStatelessDpCore::add_cont_stream(double pps, const uint8_t *pkt, uint16_t pkt_len) { CGenNodeStateless *node = m_core->create_node_sl(); /* add periodic */ @@ -117,7 +115,13 @@ TrexStatelessDpCore::start_const_traffic(const uint8_t *pkt, m_state = TrexStatelessDpCore::STATE_TRANSMITTING; m_core->m_node_gen.add_node((CGenNode *)node); +} +void +TrexStatelessDpCore::start_traffic(TrexStreamsCompiledObj *obj) { + for (auto single_stream : obj->m_objs) { + add_cont_stream(single_stream.m_pps, single_stream.m_pkt, single_stream.m_pkt_len); + } } void diff --git a/src/stateless/dp/trex_stateless_dp_core.h b/src/stateless/dp/trex_stateless_dp_core.h index 65d894d2..da8484a6 100644 --- a/src/stateless/dp/trex_stateless_dp_core.h +++ b/src/stateless/dp/trex_stateless_dp_core.h @@ -28,6 +28,7 @@ class TrexStatelessCpToDpMsgBase; class TrexStatelessDpStart; class CFlowGenListPerThread; class CGenNode; +class TrexStreamsCompiledObj; class TrexStatelessDpCore { @@ -62,7 +63,7 @@ public: * @param pkt * @param pkt_len */ - void start_const_traffic(const uint8_t *pkt, uint16_t pkt_len, double pps); + void start_traffic(TrexStreamsCompiledObj *obj); /** * stop all traffic for this core @@ -107,6 +108,8 @@ private: */ void handle_cp_msg(TrexStatelessCpToDpMsgBase *msg); + void add_cont_stream(double pps, const uint8_t *pkt, uint16_t pkt_len); + uint8_t m_thread_id; state_e m_state; CNodeRing *m_ring_from_cp; |