summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-12-24 16:07:41 +0200
committerHanoh Haim <hhaim@cisco.com>2015-12-24 16:07:41 +0200
commit32bdea5fd30ffc378a213e773634015a5d5f255f (patch)
tree23afb583991085dde25a59ff0f88c81de4adc59f /src/stateless/dp
parent0e3021bb883b10403efab042e8c308d9fa7c4630 (diff)
add refresh option to stream - should be enabled by stream bit
Diffstat (limited to 'src/stateless/dp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp16
-rw-r--r--src/stateless/dp/trex_stream_node.h5
2 files changed, 21 insertions, 0 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp
index f43f0d3a..f73824bc 100644
--- a/src/stateless/dp/trex_stateless_dp_core.cpp
+++ b/src/stateless/dp/trex_stateless_dp_core.cpp
@@ -69,6 +69,16 @@ void CGenNodeStateless::Dump(FILE *fd){
}
+
+void CGenNodeStateless::refresh_vm_bss(){
+ if ( m_vm_flow_var ) {
+ StreamVmDp * vm_s=m_ref_stream_info->m_vm_dp;
+ assert(vm_s);
+ memcpy(m_vm_flow_var,vm_s->get_bss(),vm_s->get_bss_size());
+ }
+}
+
+
/**
* this function called when stream restart after it was inactive
*/
@@ -78,6 +88,12 @@ void CGenNodeStateless::refresh(){
m_single_burst = m_single_burst_refill;
m_multi_bursts = m_ref_stream_info->m_num_bursts;
m_state = CGenNodeStateless::ss_ACTIVE;
+
+ /* refresh init value */
+#if 0
+ /* TBD should add a JSON varible for that */
+ refresh_vm_bss();
+#endif
}
diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h
index c9c0de43..70a66e6a 100644
--- a/src/stateless/dp/trex_stream_node.h
+++ b/src/stateless/dp/trex_stream_node.h
@@ -331,6 +331,11 @@ public:
void Dump(FILE *fd);
+private:
+
+ void refresh_vm_bss();
+
+
} __rte_cache_aligned;
static_assert(sizeof(CGenNodeStateless) == sizeof(CGenNode), "sizeof(CGenNodeStateless) != sizeof(CGenNode)" );