diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-03-22 17:36:43 +0200 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-03-23 10:26:03 +0200 |
commit | 9c03844bea5c9fc4423ed4c6ddf9376a9cdd7ac5 (patch) | |
tree | bc3783688a31285d6c7ad23493eae50dafda8ac1 /src/flow_stat.cpp | |
parent | 1e93f5b1fc20d7e8fd4b01b4e3c0715095b42e14 (diff) |
10G and VM work
Diffstat (limited to 'src/flow_stat.cpp')
-rw-r--r-- | src/flow_stat.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/flow_stat.cpp b/src/flow_stat.cpp index d44a91da..778c92b9 100644 --- a/src/flow_stat.cpp +++ b/src/flow_stat.cpp @@ -387,7 +387,7 @@ CFlowStatRuleMgr::CFlowStatRuleMgr() { m_api = NULL; m_max_hw_id = -1; m_num_started_streams = 0; - m_ring_to_rx = CMsgIns::Ins()->getCpRx()->getRingCpToDp(0); + m_ring_to_rx = NULL; } std::ostream& operator<<(std::ostream& os, const CFlowStatRuleMgr& cf) { @@ -439,6 +439,8 @@ int CFlowStatRuleMgr::add_stream(const TrexStream * stream) { std::cout << __METHOD_NAME__ << " user id:" << stream->m_rx_check.m_pg_id << std::endl; #endif + // Init everything here, and not in the constructor, since we relay on other objects + // By the time a stream is added everything else is initialized. if (! m_api ) { TrexStateless *tstateless = get_stateless_obj(); m_api = tstateless->get_platform_api(); @@ -455,6 +457,7 @@ int CFlowStatRuleMgr::add_stream(const TrexStream * stream) { for (uint8_t port = 0; port < m_num_ports; port++) { assert(m_api->reset_hw_flow_stats(port) == 0); } + m_ring_to_rx = CMsgIns::Ins()->getCpRx()->getRingCpToDp(0); } if (no_stat_supported) @@ -641,9 +644,9 @@ void CFlowStatRuleMgr::send_start_stop_msg_to_rx(bool is_start) { TrexStatelessCpToRxMsgBase *msg; if (is_start) { - msg = new TrexRxStartMsg(); + msg = new TrexStatelessRxStartMsg(); } else { - msg = new TrexRxStopMsg(); + msg = new TrexStatelessRxStopMsg(); } m_ring_to_rx->Enqueue((CGenNode *)msg); } |