summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-24 07:13:52 -0500
committerIdo Barnea <ibarnea@cisco.com>2016-02-24 14:21:29 +0200
commit3eb4f868ef5bc728a46c8012c914f6a9381f4cdb (patch)
tree723fc6473f36b06d47a1c6e24dd644d45db42e58 /src
parentf0ab9eba97221e491cf7b3dd846eb8c23d920ec2 (diff)
VM bug youtrack: trex-187
and rx stats
Diffstat (limited to 'src')
-rw-r--r--src/stateless/cp/trex_stream.h3
-rw-r--r--src/stateless/cp/trex_stream_vm.cpp8
-rw-r--r--src/stateless/cp/trex_stream_vm.h2
-rw-r--r--src/stateless/cp/trex_vm_splitter.cpp2
4 files changed, 9 insertions, 6 deletions
diff --git a/src/stateless/cp/trex_stream.h b/src/stateless/cp/trex_stream.h
index af4d4a73..36f9d407 100644
--- a/src/stateless/cp/trex_stream.h
+++ b/src/stateless/cp/trex_stream.h
@@ -402,7 +402,8 @@ public:
/* on full clone we copy also VM */
if (full) {
- m_vm.copy_instructions(dp->m_vm);
+ m_vm.clone(dp->m_vm);
+
}
/* copy VM DP product */
diff --git a/src/stateless/cp/trex_stream_vm.cpp b/src/stateless/cp/trex_stream_vm.cpp
index b0cadfb6..59efd6fc 100644
--- a/src/stateless/cp/trex_stream_vm.cpp
+++ b/src/stateless/cp/trex_stream_vm.cpp
@@ -886,14 +886,14 @@ StreamVm::set_split_instruction(StreamVmInstructionVar *instr) {
}
/**
- * copy instructions from this VM to 'other'
+ * clone VM from this VM to 'other'
*
* @author imarom (22-Dec-15)
*
* @param other
*/
void
-StreamVm::copy_instructions(StreamVm &other) const {
+StreamVm::clone(StreamVm &other) const {
/* clear previous if any exists */
for (auto instr : other.m_inst_list) {
delete instr;
@@ -903,6 +903,7 @@ StreamVm::copy_instructions(StreamVm &other) const {
for (auto instr : m_inst_list) {
StreamVmInstruction *new_instr = instr->clone();
+
other.m_inst_list.push_back(new_instr);
/* for the split instruction - find the right one */
@@ -913,6 +914,7 @@ StreamVm::copy_instructions(StreamVm &other) const {
}
}
+ other.m_is_random_var = m_is_random_var;
}
/**
@@ -973,7 +975,7 @@ StreamVm::calc_expected_pkt_size(uint16_t regular_pkt_size) const {
StreamVm dummy;
- this->copy_instructions(dummy);
+ this->clone(dummy);
dummy.compile(regular_pkt_size);
assert(dummy.m_expected_pkt_size != 0);
diff --git a/src/stateless/cp/trex_stream_vm.h b/src/stateless/cp/trex_stream_vm.h
index 0bd00711..d43d7d4b 100644
--- a/src/stateless/cp/trex_stream_vm.h
+++ b/src/stateless/cp/trex_stream_vm.h
@@ -1451,7 +1451,7 @@ public:
* clone VM instructions
*
*/
- void copy_instructions(StreamVm &other) const;
+ void clone(StreamVm &other) const;
bool is_vm_empty() const {
diff --git a/src/stateless/cp/trex_vm_splitter.cpp b/src/stateless/cp/trex_vm_splitter.cpp
index 5e6d4fbd..963b4525 100644
--- a/src/stateless/cp/trex_vm_splitter.cpp
+++ b/src/stateless/cp/trex_vm_splitter.cpp
@@ -190,7 +190,7 @@ void
TrexVmSplitter::duplicate_vm() {
/* for each core - duplicate the instructions */
for (TrexStream *core_stream : *m_core_streams) {
- m_stream->m_vm.copy_instructions(core_stream->m_vm);
+ m_stream->m_vm.clone(core_stream->m_vm);
}
}