summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-05-08 17:32:12 +0300
committerimarom <imarom@cisco.com>2016-05-09 16:48:16 +0300
commitdb9145d248720c633dd4da6c785e071198986326 (patch)
tree86e00a08895f65e2840b2bf8a921b9e9298f11a1 /src/stateless/dp
parent75ce59e5652f9094beab854d263a850cfc81a3de (diff)
added duration to remote push
Diffstat (limited to 'src/stateless/dp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp20
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.h7
-rw-r--r--src/stateless/dp/trex_stream_node.h4
3 files changed, 23 insertions, 8 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp
index 6450d0f9..dff5285d 100644
--- a/src/stateless/dp/trex_stateless_dp_core.cpp
+++ b/src/stateless/dp/trex_stateless_dp_core.cpp
@@ -301,7 +301,7 @@ bool TrexStatelessDpPerPort::push_pcap(uint8_t port_id,
assert(m_active_pcap_node == NULL);
m_active_pcap_node = pcap_node;
- m_state = TrexStatelessDpPerPort::ppSTATE_TRANSMITTING;
+ m_state = TrexStatelessDpPerPort::ppSTATE_PCAP_TX;
return (true);
}
@@ -898,7 +898,8 @@ TrexStatelessDpCore::push_pcap(uint8_t port_id,
const std::string &pcap_filename,
double ipg_usec,
double speedup,
- uint32_t count) {
+ uint32_t count,
+ double duration) {
TrexStatelessDpPerPort * lp_port = get_port_db(port_id);
@@ -917,13 +918,12 @@ TrexStatelessDpCore::push_pcap(uint8_t port_id,
return;
}
- m_state = TrexStatelessDpCore::STATE_TRANSMITTING;
- #if 0
- if ( duration > 0.0 ){
+ if (duration > 0.0) {
add_port_duration(duration, port_id, event_id);
}
- #endif
+
+ m_state = TrexStatelessDpCore::STATE_PCAP_TX;
}
@@ -1007,6 +1007,9 @@ bool CGenNodePCAP::create(uint8_t port_id,
m_port_id = port_id;
m_count = count;
+ /* mark this node as slow path */
+ set_slow_path(true);
+
if (ipg_usec != -1) {
/* fixed IPG */
m_ipg_sec = usec_to_sec(ipg_usec / speedup);
@@ -1046,6 +1049,11 @@ bool CGenNodePCAP::create(uint8_t port_id,
return true;
}
+/**
+ * cleanup for PCAP node
+ *
+ * @author imarom (08-May-16)
+ */
void CGenNodePCAP::destroy() {
if (m_raw_packet) {
diff --git a/src/stateless/dp/trex_stateless_dp_core.h b/src/stateless/dp/trex_stateless_dp_core.h
index 115f8873..0941f6f3 100644
--- a/src/stateless/dp/trex_stateless_dp_core.h
+++ b/src/stateless/dp/trex_stateless_dp_core.h
@@ -54,7 +54,8 @@ public:
enum state_e {
ppSTATE_IDLE,
ppSTATE_TRANSMITTING,
- ppSTATE_PAUSE
+ ppSTATE_PAUSE,
+ ppSTATE_PCAP_TX,
};
@@ -117,6 +118,7 @@ public:
enum state_e {
STATE_IDLE,
STATE_TRANSMITTING,
+ STATE_PCAP_TX,
STATE_TERMINATE
};
@@ -175,7 +177,8 @@ public:
const std::string &pcap_filename,
double ipg_usec,
double speedup,
- uint32_t count);
+ uint32_t count,
+ double duration);
/**
diff --git a/src/stateless/dp/trex_stream_node.h b/src/stateless/dp/trex_stream_node.h
index a970c1f7..bdbc5084 100644
--- a/src/stateless/dp/trex_stream_node.h
+++ b/src/stateless/dp/trex_stream_node.h
@@ -406,6 +406,10 @@ public:
double speedup,
uint32_t count);
+ /**
+ * destroy the node cleaning up any data
+ *
+ */
void destroy();
/**