summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless/dp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp24
-rw-r--r--src/stateless/dp/trex_stream_node.h9
2 files changed, 30 insertions, 3 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();
diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h
index d33785fe..70a66e6a 100644
--- a/src/stateless/dp/trex_stream_node.h
+++ b/src/stateless/dp/trex_stream_node.h
@@ -102,11 +102,13 @@ private:
uint8_t * m_vm_flow_var; /* pointer to the vm flow var */
uint8_t * m_vm_program; /* pointer to the program */
uint16_t m_vm_program_size; /* up to 64K op codes */
+ uint16_t m_pad2;
+ uint32_t m_pad3;
/* End Fast Field VM Section */
/* pad to match the size of CGenNode */
- uint8_t m_pad_end[30];
+ uint8_t m_pad_end[20];
public:
@@ -329,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)" );