From db9145d248720c633dd4da6c785e071198986326 Mon Sep 17 00:00:00 2001 From: imarom Date: Sun, 8 May 2016 17:32:12 +0300 Subject: added duration to remote push --- src/stateless/dp/trex_stateless_dp_core.cpp | 20 ++++++++++++++------ src/stateless/dp/trex_stateless_dp_core.h | 7 +++++-- src/stateless/dp/trex_stream_node.h | 4 ++++ 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'src/stateless/dp') 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(); /** -- cgit 1.2.3-korg