summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp/trex_stateless_dp_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp
index acbf1b88..c211b9f5 100644
--- a/src/stateless/dp/trex_stateless_dp_core.cpp
+++ b/src/stateless/dp/trex_stateless_dp_core.cpp
@@ -69,12 +69,31 @@ 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
+ */
void CGenNodeStateless::refresh(){
/* refill the stream info */
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
}
@@ -124,7 +143,8 @@ rte_mbuf_t * CGenNodeStateless::alloc_node_with_vm(){
/* run the VM program */
StreamDPVmInstructionsRunner runner;
- runner.run( m_vm_program_size,
+ runner.run( (uint32_t*)m_vm_flow_var,
+ m_vm_program_size,
m_vm_program,
m_vm_flow_var,
(uint8_t*)p);
@@ -302,7 +322,7 @@ bool TrexStatelessDpCore::set_stateless_next_node(CGenNodeStateless * cur_node,
/* can't be FREE_RESUSE */
assert(state != CGenNodeStateless::ss_FREE_RESUSE);
- if (next_node->get_state() == CGenNodeStateless::ss_INACTIVE ) {
+ if (state == CGenNodeStateless::ss_INACTIVE ) {
/* refill start info and scedule, no update in active streams */
next_node->refresh();