summaryrefslogtreecommitdiffstats
path: root/src/stateless/cp/trex_vm_splitter.h
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-12-22 02:44:01 -0500
committerimarom <imarom@cisco.com>2015-12-23 09:59:39 -0500
commit0901331fc21088307fc4a264d5b38089a1ce7f1a (patch)
tree6fc1335f787e7877eae49901a58246457abadbcf /src/stateless/cp/trex_vm_splitter.h
parent4400ebfd85c5700ff11a3532ea0e01ec06bf4928 (diff)
support for VM split - 1st phase
Diffstat (limited to 'src/stateless/cp/trex_vm_splitter.h')
-rw-r--r--src/stateless/cp/trex_vm_splitter.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/stateless/cp/trex_vm_splitter.h b/src/stateless/cp/trex_vm_splitter.h
new file mode 100644
index 00000000..37c61599
--- /dev/null
+++ b/src/stateless/cp/trex_vm_splitter.h
@@ -0,0 +1,54 @@
+/*
+ Itay Marom
+ Cisco Systems, Inc.
+*/
+
+/*
+Copyright (c) 2015-2015 Cisco Systems, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+#ifndef __TREX_VM_SPLITTER_H__
+#define __TREX_VM_SPLITTER_H__
+
+#include <trex_stream.h>
+
+
+class TrexVmSplitter {
+
+public:
+
+ TrexVmSplitter() {
+ m_dp_core_count = 0;
+ }
+
+ /**
+ * split a stream's VM to per core streams
+ */
+ void split(TrexStream *stream, std::vector<TrexStream *> core_streams);
+
+
+private:
+ bool split_internal();
+ bool split_by_flow_var(const StreamVmInstructionFlowMan *instr);
+ bool split_by_flow_client_var(const StreamVmInstructionFlowClient *instr);
+
+ void duplicate_vm();
+
+ TrexStream *m_stream;
+ std::vector<TrexStream *> *m_core_streams;
+ uint8_t m_dp_core_count;
+};
+
+
+#endif /* __TREX_VM_SPLITTER_H__ */