summaryrefslogtreecommitdiffstats
path: root/src/stateless/dp/trex_stateless_dp_core.cpp
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-11-21 23:00:43 +0200
committerHanoh Haim <hhaim@cisco.com>2015-11-21 23:00:43 +0200
commit36dc8ea51adffce882e542123111baad7a1a7ea7 (patch)
tree88a20dd753d48f4e96daee953bac16170c901217 /src/stateless/dp/trex_stateless_dp_core.cpp
parente504584074249b7cdd3b1b12fc642651b1990322 (diff)
add back to back test of DP
Diffstat (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp')
-rw-r--r--src/stateless/dp/trex_stateless_dp_core.cpp11
1 files changed, 8 insertions, 3 deletions
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() ) {