diff options
author | imarom <imarom@cisco.com> | 2016-12-18 14:59:51 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-12-18 15:01:41 +0200 |
commit | 6a6047fd7168f49641e3c9b4ea347e22b6378690 (patch) | |
tree | f312aec591f118c924425a2da887c915d377383f /src/stateless/cp | |
parent | 926d8e52a73cca2feee0aaa92ad2379d90575a41 (diff) |
trex-234 - when allocating too many PG IDs an error get stuck
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/stateless/cp')
-rw-r--r-- | src/stateless/cp/trex_stateless_port.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp index 62805dbc..e41cc88c 100644 --- a/src/stateless/cp/trex_stateless_port.cpp +++ b/src/stateless/cp/trex_stateless_port.cpp @@ -99,20 +99,26 @@ protected: ************************************/ class StreamsFeeder { public: + StreamsFeeder(TrexStatelessPort *port) { - /* start pesimistic */ m_success = false; - + + m_port = port; + } + + void feed() { + /* fetch the original streams */ - port->get_object_list(m_in_streams); + m_port->get_object_list(m_in_streams); for (const TrexStream *in_stream : m_in_streams) { TrexStream *out_stream = in_stream->clone(true); - get_stateless_obj()->m_rx_flow_stat.start_stream(out_stream); - m_out_streams.push_back(out_stream); + + get_stateless_obj()->m_rx_flow_stat.start_stream(out_stream); + } } @@ -147,6 +153,8 @@ private: vector<TrexStream *> m_in_streams; vector<TrexStream *> m_out_streams; bool m_success; + + TrexStatelessPort *m_port; }; @@ -263,6 +271,7 @@ TrexStatelessPort::start_traffic(const TrexPortMultiplier &mul, double duration, double factor = calculate_effective_factor(mul, force); StreamsFeeder feeder(this); + feeder.feed(); /* compiler it */ std::vector<TrexStreamsCompiledObj *> compiled_objs; |