From 36dc8ea51adffce882e542123111baad7a1a7ea7 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Sat, 21 Nov 2015 23:00:43 +0200 Subject: add back to back test of DP --- src/stateless/dp/trex_stateless_dp_core.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp') diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index e17c9075..6430e520 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -124,12 +124,12 @@ bool TrexStatelessDpPerPort::update_number_of_active_streams(uint32_t d){ } -void TrexStatelessDpPerPort::stop_traffic(uint8_t port_id){ +bool TrexStatelessDpPerPort::stop_traffic(uint8_t port_id){ /* there could be race of stop after stop */ if (m_state == TrexStatelessDpPerPort::ppSTATE_IDLE) { assert(m_active_streams==0); - return; + return false; } for (auto dp_stream : m_active_nodes) { @@ -149,6 +149,7 @@ void TrexStatelessDpPerPort::stop_traffic(uint8_t port_id){ assert(m_active_streams==0); m_active_nodes.clear(); m_state=TrexStatelessDpPerPort::ppSTATE_IDLE; + return (true); } @@ -517,7 +518,11 @@ TrexStatelessDpCore::stop_traffic(uint8_t port_id) { TrexStatelessDpPerPort * lp_port = get_port_db(port_id); - lp_port->stop_traffic(port_id); + if ( lp_port->stop_traffic(port_id) == false){ + /* nothing to do ! already stopped */ + return; + } + if ( are_all_ports_idle() ) { -- cgit 1.2.3-korg