diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-03-01 11:10:48 +0200 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-03-02 10:13:33 +0200 |
commit | 8714436f26fe6ae10559f726573f1f01d2baa8b0 (patch) | |
tree | 6c0ded85db2903eb8bd90f683ee66649a2412917 /src/stateless | |
parent | 42c621b92fca9c9ef916ce9896aecea0290ce2aa (diff) |
tx stats per stream
Diffstat (limited to 'src/stateless')
-rw-r--r-- | src/stateless/cp/trex_stream.h | 2 | ||||
-rw-r--r-- | src/stateless/cp/trex_streams_compiler.cpp | 3 | ||||
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 9 | ||||
-rw-r--r-- | src/stateless/dp/trex_stream_node.h | 22 |
4 files changed, 29 insertions, 7 deletions
diff --git a/src/stateless/cp/trex_stream.h b/src/stateless/cp/trex_stream.h index 161e9592..1abf0c04 100644 --- a/src/stateless/cp/trex_stream.h +++ b/src/stateless/cp/trex_stream.h @@ -514,7 +514,7 @@ public: bool m_seq_enabled; bool m_latency; uint32_t m_user_id; - + uint16_t m_hw_id; } m_rx_check; uint32_t m_burst_total_pkts; /* valid in case of burst stSINGLE_BURST,stMULTI_BURST*/ diff --git a/src/stateless/cp/trex_streams_compiler.cpp b/src/stateless/cp/trex_streams_compiler.cpp index 7c91754c..be5002da 100644 --- a/src/stateless/cp/trex_streams_compiler.cpp +++ b/src/stateless/cp/trex_streams_compiler.cpp @@ -476,7 +476,8 @@ TrexStreamsCompiler::compile_stream(TrexStream *stream, } TrexStream *fixed_rx_flow_stat_stream = stream->clone(true); - get_stateless_obj()->m_rx_flow_stat.start_stream(fixed_rx_flow_stat_stream); + + get_stateless_obj()->m_rx_flow_stat.start_stream(fixed_rx_flow_stat_stream, fixed_rx_flow_stat_stream->m_rx_check.m_hw_id); //???? check for errors /* can this stream be split to many cores ? */ if (!stream->is_splitable(dp_core_count)) { diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index 549f923f..0f578b99 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -565,7 +565,6 @@ void TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, TrexStream * stream, TrexStreamsCompiledObj *comp) { - CGenNodeStateless *node = m_core->create_node_sl(); /* add periodic */ @@ -581,7 +580,6 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, node->m_next_stream=0; /* will be fixed later */ - if ( stream->m_self_start ){ /* if self start it is in active mode */ node->m_state =CGenNodeStateless::ss_ACTIVE; @@ -597,7 +595,12 @@ TrexStatelessDpCore::add_stream(TrexStatelessDpPerPort * lp_port, node->m_src_port =0; node->m_original_packet_data_prefix = 0; - + if (stream->m_rx_check.m_enabled) { + node->set_stat_needed(); + uint8_t hw_id = stream->m_rx_check.m_hw_id; + assert (hw_id < MAX_FLOW_STATS); + node->set_stat_hw_id(hw_id); + } /* set socket id */ node->set_socket_id(m_core->m_node_gen.m_socket_id); diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h index b366a770..104e4d3b 100644 --- a/src/stateless/dp/trex_stream_node.h +++ b/src/stateless/dp/trex_stream_node.h @@ -62,7 +62,8 @@ public: SL_NODE_CONST_MBUF =4, - SL_NODE_VAR_PKT_SIZE =8 + SL_NODE_VAR_PKT_SIZE =8, + SL_NODE_STATS_NEEDED = 0x10 }; @@ -82,7 +83,8 @@ private: double m_next_time_offset; /* in sec */ uint16_t m_action_counter; - uint16_t m_pad11; + uint8_t m_stat_hw_id; // hw id used to count rx and tx stats + uint8_t m_pad11; uint32_t m_pad12; stream_state_t m_state; @@ -269,6 +271,22 @@ public: return ( m_socket_id ); } + void set_stat_hw_id(uint16_t hw_id) { + m_stat_hw_id = hw_id; + } + + socket_id_t get_stat_hw_id() { + return ( m_stat_hw_id ); + } + + inline void set_stat_needed() { + m_flags |= SL_NODE_STATS_NEEDED; + } + + inline bool is_stat_needed() { + return ((m_flags & SL_NODE_STATS_NEEDED) != 0); + } + inline void set_mbuf_cache_dir(pkt_dir_t dir){ if (dir) { m_flags |=NODE_FLAGS_DIR; |