summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-03-01 11:10:48 +0200
committerIdo Barnea <ibarnea@cisco.com>2016-03-02 10:13:33 +0200
commit8714436f26fe6ae10559f726573f1f01d2baa8b0 (patch)
tree6c0ded85db2903eb8bd90f683ee66649a2412917 /src/stateless/dp
parent42c621b92fca9c9ef916ce9896aecea0290ce2aa (diff)
tx stats per stream
Diffstat (limited to 'src/stateless/dp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp9
-rw-r--r--src/stateless/dp/trex_stream_node.h22
2 files changed, 26 insertions, 5 deletions
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;